From 9a00edc81ddda825a695e8d5137c3f9cdd2292c5 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Wed, 23 Sep 2020 15:17:12 +0200 Subject: [PATCH] RefCount change to u32 (#2635) --- CHANGELOG.md | 3 +++ packages/types-known/src/spec/centrifuge-chain.ts | 1 + packages/types-known/src/spec/kusama.ts | 11 ++++++++++- packages/types-known/src/spec/polkadot.ts | 5 ++++- packages/types-known/src/spec/rococo.ts | 3 ++- packages/types-known/src/spec/westend.ts | 6 +++++- packages/types/src/interfaces/system/definitions.ts | 3 ++- 7 files changed, 27 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8debe8c5515b..5be7f8985155 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,11 @@ ## 1.35.0-beta.x +- **Breaking change** The `RefCount` type (used by `query.system.accounts`) has been changed to a `u32`. On older chains supply the `RefCount: 'RefCountTo259'` override + Changes: +- Adjust `RefCount` type as per substrate 2.0 - Add bounty type definitions from treasury - Add support for `grandpa_proveFinality` RPC diff --git a/packages/types-known/src/spec/centrifuge-chain.ts b/packages/types-known/src/spec/centrifuge-chain.ts index f1995ad25ce8..ae63118190aa 100644 --- a/packages/types-known/src/spec/centrifuge-chain.ts +++ b/packages/types-known/src/spec/centrifuge-chain.ts @@ -32,6 +32,7 @@ const sharedTypes = { leafHash: 'H256', sortedHashes: 'H256' }, + RefCount: 'RefCountTo259', ResourceId: '[u8; 32]', 'chainbridge::ChainId': 'u8' }; diff --git a/packages/types-known/src/spec/kusama.ts b/packages/types-known/src/spec/kusama.ts index 77c77612471c..8073361617af 100644 --- a/packages/types-known/src/spec/kusama.ts +++ b/packages/types-known/src/spec/kusama.ts @@ -25,6 +25,7 @@ const versioned: OverrideVersionedType[] = [ Keys: 'SessionKeys5', Multiplier: 'Fixed64', OpenTip: 'OpenTipTo225', + RefCount: 'RefCountTo259', ReferendumInfo: 'ReferendumInfoTo239', RewardDestination: 'RewardDestinationTo257', SlashingSpans: 'SlashingSpansTo204', @@ -43,6 +44,7 @@ const versioned: OverrideVersionedType[] = [ Keys: 'SessionKeys5', Multiplier: 'Fixed64', OpenTip: 'OpenTipTo225', + RefCount: 'RefCountTo259', ReferendumInfo: 'ReferendumInfoTo239', RewardDestination: 'RewardDestinationTo257', SlashingSpans: 'SlashingSpansTo204', @@ -62,6 +64,7 @@ const versioned: OverrideVersionedType[] = [ Keys: 'SessionKeys5', Multiplier: 'Fixed64', OpenTip: 'OpenTipTo225', + RefCount: 'RefCountTo259', ReferendumInfo: 'ReferendumInfoTo239', RewardDestination: 'RewardDestinationTo257', StakingLedger: 'StakingLedgerTo223', @@ -78,6 +81,7 @@ const versioned: OverrideVersionedType[] = [ DispatchInfo: 'DispatchInfoTo244', Multiplier: 'Fixed64', OpenTip: 'OpenTipTo225', + RefCount: 'RefCountTo259', ReferendumInfo: 'ReferendumInfoTo239', RewardDestination: 'RewardDestinationTo257', StakingLedger: 'StakingLedgerTo240', @@ -92,6 +96,7 @@ const versioned: OverrideVersionedType[] = [ DispatchInfo: 'DispatchInfoTo244', Multiplier: 'Fixed64', OpenTip: 'OpenTipTo225', + RefCount: 'RefCountTo259', RewardDestination: 'RewardDestinationTo257', StakingLedger: 'StakingLedgerTo240', Weight: 'u32' @@ -104,6 +109,7 @@ const versioned: OverrideVersionedType[] = [ CompactAssignments: 'CompactAssignmentsTo257', DispatchInfo: 'DispatchInfoTo244', OpenTip: 'OpenTipTo225', + RefCount: 'RefCountTo259', RewardDestination: 'RewardDestinationTo257' } }, @@ -113,6 +119,7 @@ const versioned: OverrideVersionedType[] = [ ...sharedTypes, CompactAssignments: 'CompactAssignmentsTo257', OpenTip: 'OpenTipTo225', + RefCount: 'RefCountTo259', RewardDestination: 'RewardDestinationTo257' } }, @@ -121,13 +128,15 @@ const versioned: OverrideVersionedType[] = [ types: { ...sharedTypes, CompactAssignments: 'CompactAssignmentsTo257', + RefCount: 'RefCountTo259', RewardDestination: 'RewardDestinationTo257' } }, { minmax: [2023, undefined], types: { - ...sharedTypes + ...sharedTypes, + RefCount: 'RefCountTo259' } } ]; diff --git a/packages/types-known/src/spec/polkadot.ts b/packages/types-known/src/spec/polkadot.ts index 6a24400633a1..cf836fdd952c 100644 --- a/packages/types-known/src/spec/polkadot.ts +++ b/packages/types-known/src/spec/polkadot.ts @@ -21,6 +21,7 @@ const versioned: OverrideVersionedType[] = [ ...sharedTypes, CompactAssignments: 'CompactAssignmentsTo257', OpenTip: 'OpenTipTo225', + RefCount: 'RefCountTo259', RewardDestination: 'RewardDestinationTo257' } }, @@ -29,13 +30,15 @@ const versioned: OverrideVersionedType[] = [ types: { ...sharedTypes, CompactAssignments: 'CompactAssignmentsTo257', + RefCount: 'RefCountTo259', RewardDestination: 'RewardDestinationTo257' } }, { minmax: [23, undefined], types: { - ...sharedTypes + ...sharedTypes, + RefCount: 'RefCountTo259' } } ]; diff --git a/packages/types-known/src/spec/rococo.ts b/packages/types-known/src/spec/rococo.ts index 04f51f7bb5ce..f81993957315 100644 --- a/packages/types-known/src/spec/rococo.ts +++ b/packages/types-known/src/spec/rococo.ts @@ -15,7 +15,8 @@ const versioned: OverrideVersionedType[] = [ minmax: [0, undefined], types: { ...sharedTypes, - CompactAssignments: 'CompactAssignmentsTo257' + CompactAssignments: 'CompactAssignmentsTo257', + RefCount: 'RefCountTo259' } } ]; diff --git a/packages/types-known/src/spec/westend.ts b/packages/types-known/src/spec/westend.ts index fdab36167667..a48b69e9bfa8 100644 --- a/packages/types-known/src/spec/westend.ts +++ b/packages/types-known/src/spec/westend.ts @@ -21,6 +21,7 @@ const versioned: OverrideVersionedType[] = [ CompactAssignments: 'CompactAssignmentsTo257', Multiplier: 'Fixed64', OpenTip: 'OpenTipTo225', + RefCount: 'RefCountTo259', RewardDestination: 'RewardDestinationTo257', Weight: 'u32' } @@ -31,6 +32,7 @@ const versioned: OverrideVersionedType[] = [ ...sharedTypes, CompactAssignments: 'CompactAssignmentsTo257', OpenTip: 'OpenTipTo225', + RefCount: 'RefCountTo259', RewardDestination: 'RewardDestinationTo257' } }, @@ -39,13 +41,15 @@ const versioned: OverrideVersionedType[] = [ types: { ...sharedTypes, CompactAssignments: 'CompactAssignmentsTo257', + RefCount: 'RefCountTo259', RewardDestination: 'RewardDestinationTo257' } }, { minmax: [43, undefined], types: { - ...sharedTypes + ...sharedTypes, + RefCount: 'RefCountTo259' } } ]; diff --git a/packages/types/src/interfaces/system/definitions.ts b/packages/types/src/interfaces/system/definitions.ts index c20d80a23690..878ba86b7456 100644 --- a/packages/types/src/interfaces/system/definitions.ts +++ b/packages/types/src/interfaces/system/definitions.ts @@ -274,7 +274,8 @@ export default { Initialization: 'Null' } }, - RefCount: 'u8', + RefCount: 'u32', + RefCountTo259: 'u8', TransactionValidityError: { _enum: { Invalid: 'InvalidTransaction',