Update types for Polkadot runtime 23 (#2550)

* Update types for Polkadot runtime 23

* Expand change info

* version upgrades

* Linting
This commit is contained in:
Jaco Greeff
2020-08-31 16:50:56 +02:00
committed by GitHub
parent 59e92fa344
commit ebe6d03762
4 changed files with 50 additions and 18 deletions
+6 -2
View File
@@ -2,9 +2,10 @@
## 1.31.0-beta.x
Upgrade priority: Low, unless using the new `RewardDestination` or transparent `.at(hash)` queries is used
Upgrade priority: Medium, especially for staking users on Polkadot, Kusama & Westend (type updates applied for v23 onwards) or if transparent `.at(hash)` queries are required/used
- **Important** Substrate changed the `RewardDestination` enum with an extra field for payout-to-any account. If on an older chain consider adding `RewardDestination: 'RewardDestinationTo257'` (Newer chains with this requirement met in their Substrate version should update the API for support)
- **Important** Substrate changed the `RewardDestination` enum with an extra field for payout-to-any account for staking preferences. If on an older chain consider adding `RewardDestination: 'RewardDestinationTo257'`
- **Important** Substrate changed the `CompactAssignment` type enhanced types for session solution submissions. If on an older chain consider adding `CompactAssignments: 'CompactAssignmentsTo257'`
- Fix documentation language and typos (Thanks to https://github.com/Meuko)
- Add missing `TransactionPriority` type (Thanks to https://github.com/aniiantt)
@@ -20,6 +21,9 @@ Upgrade priority: Low, unless using the new `RewardDestination` or transparent `
- `derive.democracy.locks` now returns delegated locks for an account as well
- Adjust unlocking derives with appropriate in-place additions (less object allocations)
- `.sign` on submittables is marked deprecated (not due for removal, but rather use `.signAsync` for consistency with `.signAndSend`)
- Adjust types for `CompactAssignments` & `RewardDestination` for Polkadot, Kusama & Westend
- `@polkadot/util` 3.4
- `@polkadot/wasm-crypto` 1.4
## 1.30.1 Aug 24, 2020
+19 -6
View File
@@ -10,8 +10,7 @@ const sharedTypes = {
LookupSource: 'AccountId',
ProxyType: {
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'IdentityJudgement']
},
RewardDestination: 'RewardDestinationTo257'
}
};
const versioned: OverrideVersionedType[] = [
@@ -28,6 +27,7 @@ const versioned: OverrideVersionedType[] = [
Multiplier: 'Fixed64',
OpenTip: 'OpenTipTo225',
ReferendumInfo: 'ReferendumInfoTo239',
RewardDestination: 'RewardDestinationTo257',
SlashingSpans: 'SlashingSpansTo204',
StakingLedger: 'StakingLedgerTo223',
Votes: 'VotesTo230',
@@ -45,6 +45,7 @@ const versioned: OverrideVersionedType[] = [
Multiplier: 'Fixed64',
OpenTip: 'OpenTipTo225',
ReferendumInfo: 'ReferendumInfoTo239',
RewardDestination: 'RewardDestinationTo257',
SlashingSpans: 'SlashingSpansTo204',
StakingLedger: 'StakingLedgerTo223',
Votes: 'VotesTo230',
@@ -63,6 +64,7 @@ const versioned: OverrideVersionedType[] = [
Multiplier: 'Fixed64',
OpenTip: 'OpenTipTo225',
ReferendumInfo: 'ReferendumInfoTo239',
RewardDestination: 'RewardDestinationTo257',
StakingLedger: 'StakingLedgerTo223',
Votes: 'VotesTo230',
Weight: 'u32'
@@ -78,6 +80,7 @@ const versioned: OverrideVersionedType[] = [
Multiplier: 'Fixed64',
OpenTip: 'OpenTipTo225',
ReferendumInfo: 'ReferendumInfoTo239',
RewardDestination: 'RewardDestinationTo257',
StakingLedger: 'StakingLedgerTo240',
Weight: 'u32'
}
@@ -90,6 +93,7 @@ const versioned: OverrideVersionedType[] = [
DispatchInfo: 'DispatchInfoTo244',
Multiplier: 'Fixed64',
OpenTip: 'OpenTipTo225',
RewardDestination: 'RewardDestinationTo257',
StakingLedger: 'StakingLedgerTo240',
Weight: 'u32'
}
@@ -100,7 +104,8 @@ const versioned: OverrideVersionedType[] = [
...sharedTypes,
CompactAssignments: 'CompactAssignmentsTo257',
DispatchInfo: 'DispatchInfoTo244',
OpenTip: 'OpenTipTo225'
OpenTip: 'OpenTipTo225',
RewardDestination: 'RewardDestinationTo257'
}
},
{
@@ -108,14 +113,22 @@ const versioned: OverrideVersionedType[] = [
types: {
...sharedTypes,
CompactAssignments: 'CompactAssignmentsTo257',
OpenTip: 'OpenTipTo225'
OpenTip: 'OpenTipTo225',
RewardDestination: 'RewardDestinationTo257'
}
},
{
minmax: [2013, undefined],
minmax: [2013, 2022],
types: {
...sharedTypes,
CompactAssignments: 'CompactAssignmentsTo257'
CompactAssignments: 'CompactAssignmentsTo257',
RewardDestination: 'RewardDestinationTo257'
}
},
{
minmax: [2023, undefined],
types: {
...sharedTypes
}
}
];
+12 -5
View File
@@ -11,8 +11,7 @@ const sharedTypes = {
ProxyType: {
// was: SudoBalances
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'Unused', 'IdentityJudgement']
},
RewardDestination: 'RewardDestinationTo257'
}
};
// these are override types for Polkadot
@@ -22,14 +21,22 @@ const versioned: OverrideVersionedType[] = [
types: {
...sharedTypes,
CompactAssignments: 'CompactAssignmentsTo257',
OpenTip: 'OpenTipTo225'
OpenTip: 'OpenTipTo225',
RewardDestination: 'RewardDestinationTo257'
}
},
{
minmax: [13, undefined],
minmax: [13, 22],
types: {
...sharedTypes,
CompactAssignments: 'CompactAssignmentsTo257'
CompactAssignments: 'CompactAssignmentsTo257',
RewardDestination: 'RewardDestinationTo257'
}
},
{
minmax: [23, undefined],
types: {
...sharedTypes
}
}
];
+13 -5
View File
@@ -11,8 +11,7 @@ const sharedTypes = {
ProxyType: {
// was: SudoBalances
_enum: ['Any', 'NonTransfer', 'Staking', 'Unused', 'IdentityJudgement']
},
RewardDestination: 'RewardDestinationTo257'
}
};
const versioned: OverrideVersionedType[] = [
@@ -23,6 +22,7 @@ const versioned: OverrideVersionedType[] = [
CompactAssignments: 'CompactAssignmentsTo257',
Multiplier: 'Fixed64',
OpenTip: 'OpenTipTo225',
RewardDestination: 'RewardDestinationTo257',
Weight: 'u32'
}
},
@@ -31,14 +31,22 @@ const versioned: OverrideVersionedType[] = [
types: {
...sharedTypes,
CompactAssignments: 'CompactAssignmentsTo257',
OpenTip: 'OpenTipTo225'
OpenTip: 'OpenTipTo225',
RewardDestination: 'RewardDestinationTo257'
}
},
{
minmax: [23, undefined],
minmax: [23, 42],
types: {
...sharedTypes,
CompactAssignments: 'CompactAssignmentsTo257'
CompactAssignments: 'CompactAssignmentsTo257',
RewardDestination: 'RewardDestinationTo257'
}
},
{
minmax: [43, undefined],
types: {
...sharedTypes
}
}
];