diff --git a/CHANGELOG.md b/CHANGELOG.md index 96e8a69b2c..a945f8d614 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # CHANGELOG +## 3.7.x + +Upgrade priority: Low. However recoemmended for current Substrate master, Polkadot and Rococo users and those wishing to support the upcoming Polkadot 28 runtime with the new `MultiAddress`. + +- **Breaking change** As indicated in the 3.5.1 release notes, th Address/LookupSource default have now been adjusted for `MultiAddress` by default. This extensible format is mean to cater for all address types, removing a lot of discrepancies between chains. + +Changes: + +- Apply `MultiAddress` as a default +- Adds support for the upcoming Polkadot 28 and Kusama 2028 runtimes + + ## 3.6.1 Jan 24, 2020 Upgrade priority: Medium if not already on at least 3.3.1. The next upgrade of Kusama/Polkadot requires it. diff --git a/packages/api/src/augment/tx.ts b/packages/api/src/augment/tx.ts index bcc67be6f7..6d82e82ca6 100644 --- a/packages/api/src/augment/tx.ts +++ b/packages/api/src/augment/tx.ts @@ -14,7 +14,7 @@ import type { GrandpaEquivocationProof, KeyOwnerProof } from '@polkadot/types/in import type { IdentityFields, IdentityInfo, IdentityJudgement, RegistrarIndex } from '@polkadot/types/interfaces/identity'; import type { Heartbeat } from '@polkadot/types/interfaces/imOnline'; import type { ProxyType } from '@polkadot/types/interfaces/proxy'; -import type { AccountId, AccountIndex, Address, AssetId, Balance, BalanceOf, BlockNumber, Call, CallHashOf, ChangesTrieConfiguration, Hash, Header, KeyValue, LookupSource, Moment, OpaqueCall, Perbill, Percent, Weight } from '@polkadot/types/interfaces/runtime'; +import type { AccountId, AccountIndex, AssetId, Balance, BalanceOf, BlockNumber, Call, CallHashOf, ChangesTrieConfiguration, Hash, Header, KeyValue, LookupSource, Moment, OpaqueCall, Perbill, Percent, Weight } from '@polkadot/types/interfaces/runtime'; import type { Period, Priority } from '@polkadot/types/interfaces/scheduler'; import type { Keys } from '@polkadot/types/interfaces/session'; import type { SocietyJudgement } from '@polkadot/types/interfaces/society'; @@ -46,7 +46,7 @@ declare module '@polkadot/api/types/submittable' { * Weight: `O(1)` * Modes: Post-existence of `who`; Pre & post Zombie-status of `who`. **/ - burn: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, amount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, Compact]>; + burn: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, who: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, Compact]>; /** * Issue a new class of fungible assets from a public origin. * @@ -72,7 +72,7 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(1)` **/ - create: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, admin: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, maxZombies: u32 | AnyNumber | Uint8Array, minBalance: TAssetBalance | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, u32, TAssetBalance]>; + create: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, admin: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, maxZombies: u32 | AnyNumber | Uint8Array, minBalance: TAssetBalance | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, u32, TAssetBalance]>; /** * Destroy a class of fungible assets owned by the sender. * @@ -109,7 +109,7 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(1)` **/ - forceCreate: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, owner: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, maxZombies: Compact | AnyNumber | Uint8Array, minBalance: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, Compact, Compact]>; + forceCreate: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, owner: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, maxZombies: Compact | AnyNumber | Uint8Array, minBalance: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, Compact, Compact]>; /** * Destroy a class of fungible assets. * @@ -144,7 +144,7 @@ declare module '@polkadot/api/types/submittable' { * Modes: Pre-existence of `dest`; Post-existence of `source`; Prior & post zombie-status * of `source`; Account pre-existence of `dest`. **/ - forceTransfer: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, source: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, dest: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, amount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, LookupSource, Compact]>; + forceTransfer: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, source: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, dest: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, LookupSource, Compact]>; /** * Disallow further unprivileged transfers from an account. * @@ -157,7 +157,7 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(1)` **/ - freeze: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource]>; + freeze: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, who: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource]>; /** * Disallow further unprivileged transfers for the asset class. * @@ -184,7 +184,7 @@ declare module '@polkadot/api/types/submittable' { * Weight: `O(1)` * Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`. **/ - mint: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, beneficiary: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, amount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, Compact]>; + mint: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, beneficiary: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, Compact]>; /** * Set the maximum number of zombie accounts for an asset. * @@ -239,7 +239,7 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(1)` **/ - setTeam: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, issuer: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, admin: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, freezer: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, LookupSource, LookupSource]>; + setTeam: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, issuer: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, admin: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freezer: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, LookupSource, LookupSource]>; /** * Allow unprivileged transfers from an account again. * @@ -252,7 +252,7 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(1)` **/ - thaw: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource]>; + thaw: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, who: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource]>; /** * Allow unprivileged transfers for the asset again. * @@ -285,7 +285,7 @@ declare module '@polkadot/api/types/submittable' { * Modes: Pre-existence of `target`; Post-existence of sender; Prior & post zombie-status * of sender; Account pre-existence of `target`. **/ - transfer: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, amount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, Compact]>; + transfer: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, target: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, Compact]>; /** * Change the Owner of an asset. * @@ -298,7 +298,7 @@ declare module '@polkadot/api/types/submittable' { * * Weight: `O(1)` **/ - transferOwnership: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, owner: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource]>; + transferOwnership: AugmentedSubmittable<(id: Compact | AnyNumber | Uint8Array, owner: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource]>; }; authorship: { [key: string]: SubmittableExtrinsicFunction; @@ -338,7 +338,7 @@ declare module '@polkadot/api/types/submittable' { * not assumed to be in the overlay. * # **/ - forceTransfer: AugmentedSubmittable<(source: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, dest: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, value: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [LookupSource, LookupSource, Compact]>; + forceTransfer: AugmentedSubmittable<(source: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, dest: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, value: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [LookupSource, LookupSource, Compact]>; /** * Set the balances of a given account. * @@ -359,7 +359,7 @@ declare module '@polkadot/api/types/submittable' { * - DB Weight: 1 Read, 1 Write to `who` * # **/ - setBalance: AugmentedSubmittable<(who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, newFree: Compact | AnyNumber | Uint8Array, newReserved: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [LookupSource, Compact, Compact]>; + setBalance: AugmentedSubmittable<(who: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, newFree: Compact | AnyNumber | Uint8Array, newReserved: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [LookupSource, Compact, Compact]>; /** * Transfer some liquid free balance to another account. * @@ -389,7 +389,7 @@ declare module '@polkadot/api/types/submittable' { * - Origin account is already in memory, so no DB operations for them. * # **/ - transfer: AugmentedSubmittable<(dest: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, value: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [LookupSource, Compact]>; + transfer: AugmentedSubmittable<(dest: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, value: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [LookupSource, Compact]>; /** * Same as the [`transfer`] call, but with a check that the transfer will not kill the * origin account. @@ -403,7 +403,7 @@ declare module '@polkadot/api/types/submittable' { * - DB Weight: 1 Read and 1 Write to dest (sender is in overlay already) * # **/ - transferKeepAlive: AugmentedSubmittable<(dest: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, value: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [LookupSource, Compact]>; + transferKeepAlive: AugmentedSubmittable<(dest: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, value: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [LookupSource, Compact]>; }; bounties: { [key: string]: SubmittableExtrinsicFunction; @@ -441,7 +441,7 @@ declare module '@polkadot/api/types/submittable' { * - O(1). * # **/ - awardBounty: AugmentedSubmittable<(bountyId: Compact | AnyNumber | Uint8Array, beneficiary: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource]>; + awardBounty: AugmentedSubmittable<(bountyId: Compact | AnyNumber | Uint8Array, beneficiary: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource]>; /** * Claim the payout from an awarded bounty after payout delay. * @@ -504,7 +504,7 @@ declare module '@polkadot/api/types/submittable' { * - O(1). * # **/ - proposeCurator: AugmentedSubmittable<(bountyId: Compact | AnyNumber | Uint8Array, curator: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, fee: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, Compact]>; + proposeCurator: AugmentedSubmittable<(bountyId: Compact | AnyNumber | Uint8Array, curator: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, fee: Compact | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, Compact]>; /** * Unassign curator from a bounty. * @@ -538,7 +538,7 @@ declare module '@polkadot/api/types/submittable' { * * If no account exists and the call value is not less than `existential_deposit`, * a regular account will be created and any value will be transferred. **/ - call: AugmentedSubmittable<(dest: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, value: Compact | AnyNumber | Uint8Array, gasLimit: Compact | AnyNumber | Uint8Array, data: Bytes | string | Uint8Array) => SubmittableExtrinsic, [LookupSource, Compact, Compact, Bytes]>; + call: AugmentedSubmittable<(dest: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, value: Compact | AnyNumber | Uint8Array, gasLimit: Compact | AnyNumber | Uint8Array, data: Bytes | string | Uint8Array) => SubmittableExtrinsic, [LookupSource, Compact, Compact, Bytes]>; /** * Allows block producers to claim a small reward for evicting a contract. If a block * producer fails to do so, a regular users will be allowed to claim the reward. @@ -1082,7 +1082,7 @@ declare module '@polkadot/api/types/submittable' { * will go into phragmen, we assume full block for now. * # **/ - removeMember: AugmentedSubmittable<(who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, hasReplacement: bool | boolean | Uint8Array) => SubmittableExtrinsic, [LookupSource, bool]>; + removeMember: AugmentedSubmittable<(who: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, hasReplacement: bool | boolean | Uint8Array) => SubmittableExtrinsic, [LookupSource, bool]>; /** * Remove `origin` as a voter. * @@ -1215,7 +1215,7 @@ declare module '@polkadot/api/types/submittable' { * The dispatch origin for this call must be _Signed_ and the sender must have a registered * sub identity of `sub`. **/ - addSub: AugmentedSubmittable<(sub: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, data: Data | { None: any } | { Raw: any } | { BlakeTwo256: any } | { Sha256: any } | { Keccak256: any } | { ShaThree256: any } | string | Uint8Array) => SubmittableExtrinsic, [LookupSource, Data]>; + addSub: AugmentedSubmittable<(sub: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, data: Data | { None: any } | { Raw: any } | { BlakeTwo256: any } | { Sha256: any } | { Keccak256: any } | { ShaThree256: any } | string | Uint8Array) => SubmittableExtrinsic, [LookupSource, Data]>; /** * Cancel a previous request. * @@ -1278,7 +1278,7 @@ declare module '@polkadot/api/types/submittable' { * - One event. * # **/ - killIdentity: AugmentedSubmittable<(target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic, [LookupSource]>; + killIdentity: AugmentedSubmittable<(target: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic, [LookupSource]>; /** * Provide a judgement for an account's identity. * @@ -1300,7 +1300,7 @@ declare module '@polkadot/api/types/submittable' { * - One event. * # **/ - provideJudgement: AugmentedSubmittable<(regIndex: Compact | AnyNumber | Uint8Array, target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, judgement: IdentityJudgement | { Unknown: any } | { FeePaid: any } | { Reasonable: any } | { KnownGood: any } | { OutOfDate: any } | { LowQuality: any } | { Erroneous: any } | string | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, IdentityJudgement]>; + provideJudgement: AugmentedSubmittable<(regIndex: Compact | AnyNumber | Uint8Array, target: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, judgement: IdentityJudgement | { Unknown: any } | { FeePaid: any } | { Reasonable: any } | { KnownGood: any } | { OutOfDate: any } | { LowQuality: any } | { Erroneous: any } | string | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource, IdentityJudgement]>; /** * Remove the sender as a sub-account. * @@ -1323,14 +1323,14 @@ declare module '@polkadot/api/types/submittable' { * The dispatch origin for this call must be _Signed_ and the sender must have a registered * sub identity of `sub`. **/ - removeSub: AugmentedSubmittable<(sub: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic, [LookupSource]>; + removeSub: AugmentedSubmittable<(sub: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic, [LookupSource]>; /** * Alter the associated name of the given sub-account. * * The dispatch origin for this call must be _Signed_ and the sender must have a registered * sub identity of `sub`. **/ - renameSub: AugmentedSubmittable<(sub: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, data: Data | { None: any } | { Raw: any } | { BlakeTwo256: any } | { Sha256: any } | { Keccak256: any } | { ShaThree256: any } | string | Uint8Array) => SubmittableExtrinsic, [LookupSource, Data]>; + renameSub: AugmentedSubmittable<(sub: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, data: Data | { None: any } | { Raw: any } | { BlakeTwo256: any } | { Sha256: any } | { Keccak256: any } | { ShaThree256: any } | string | Uint8Array) => SubmittableExtrinsic, [LookupSource, Data]>; /** * Request a judgement from a registrar. * @@ -2538,7 +2538,7 @@ declare module '@polkadot/api/types/submittable' { * Total Complexity: O(M + logM + C) * # **/ - vote: AugmentedSubmittable<(candidate: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, approve: bool | boolean | Uint8Array) => SubmittableExtrinsic, [LookupSource, bool]>; + vote: AugmentedSubmittable<(candidate: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, approve: bool | boolean | Uint8Array) => SubmittableExtrinsic, [LookupSource, bool]>; /** * As a member, vouch for someone to join society by placing a bid on their behalf. * @@ -2613,7 +2613,7 @@ declare module '@polkadot/api/types/submittable' { * - Write: Bonded, Payee, [Origin Account], Locks, Ledger * # **/ - bond: AugmentedSubmittable<(controller: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, value: Compact | AnyNumber | Uint8Array, payee: RewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | string | Uint8Array) => SubmittableExtrinsic, [LookupSource, Compact, RewardDestination]>; + bond: AugmentedSubmittable<(controller: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, value: Compact | AnyNumber | Uint8Array, payee: RewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | string | Uint8Array) => SubmittableExtrinsic, [LookupSource, Compact, RewardDestination]>; /** * Add some extra amount that have appeared in the stash `free_balance` into the balance up * for staking. @@ -2748,7 +2748,7 @@ declare module '@polkadot/api/types/submittable' { * Note: Making this call only makes sense if you first set the validator preferences to * block any further nominations. **/ - kick: AugmentedSubmittable<(who: Vec | (LookupSource | Address | AccountId | AccountIndex | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; + kick: AugmentedSubmittable<(who: Vec | (LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; /** * Declare the desire to nominate `targets` for the origin controller. * @@ -2770,7 +2770,7 @@ declare module '@polkadot/api/types/submittable' { * - Writes: Validators, Nominators * # **/ - nominate: AugmentedSubmittable<(targets: Vec | (LookupSource | Address | AccountId | AccountIndex | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; + nominate: AugmentedSubmittable<(targets: Vec | (LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; /** * Pay out all the stakers behind a single validator for a single era. * @@ -2865,7 +2865,7 @@ declare module '@polkadot/api/types/submittable' { * - Write: Bonded, Ledger New Controller, Ledger Old Controller * # **/ - setController: AugmentedSubmittable<(controller: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic, [LookupSource]>; + setController: AugmentedSubmittable<(controller: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic, [LookupSource]>; /** * Set `HistoryDepth` value. This function will delete any history information * when `HistoryDepth` is reduced. @@ -3098,7 +3098,7 @@ declare module '@polkadot/api/types/submittable' { * - One DB change. * # **/ - setKey: AugmentedSubmittable<(updated: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic, [LookupSource]>; + setKey: AugmentedSubmittable<(updated: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic, [LookupSource]>; /** * Authenticates the sudo key and dispatches a function call with `Root` origin. * @@ -3125,7 +3125,7 @@ declare module '@polkadot/api/types/submittable' { * - Weight of derivative `call` execution + 10,000. * # **/ - sudoAs: AugmentedSubmittable<(who: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [LookupSource, Call]>; + sudoAs: AugmentedSubmittable<(who: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [LookupSource, Call]>; /** * Authenticates the sudo key and dispatches a function call with `Root` origin. * This function does not check the weight of the call, and instead allows the @@ -3612,7 +3612,7 @@ declare module '@polkadot/api/types/submittable' { * - DbWrites: `ProposalCount`, `Proposals`, `origin account` * # **/ - proposeSpend: AugmentedSubmittable<(value: Compact | AnyNumber | Uint8Array, beneficiary: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource]>; + proposeSpend: AugmentedSubmittable<(value: Compact | AnyNumber | Uint8Array, beneficiary: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic, [Compact, LookupSource]>; /** * Reject a proposed spend. The original deposit will be slashed. * @@ -3703,7 +3703,7 @@ declare module '@polkadot/api/types/submittable' { * - Writes: Vesting Storage, Balances Locks, Target Account, Source Account * # **/ - forceVestedTransfer: AugmentedSubmittable<(source: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, schedule: VestingInfo | { locked?: any; perBlock?: any; startingBlock?: any } | string | Uint8Array) => SubmittableExtrinsic, [LookupSource, LookupSource, VestingInfo]>; + forceVestedTransfer: AugmentedSubmittable<(source: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, target: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, schedule: VestingInfo | { locked?: any; perBlock?: any; startingBlock?: any } | string | Uint8Array) => SubmittableExtrinsic, [LookupSource, LookupSource, VestingInfo]>; /** * Unlock any vested funds of the sender account. * @@ -3737,7 +3737,7 @@ declare module '@polkadot/api/types/submittable' { * - Writes: Vesting Storage, Balances Locks, Target Account * # **/ - vestOther: AugmentedSubmittable<(target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array) => SubmittableExtrinsic, [LookupSource]>; + vestOther: AugmentedSubmittable<(target: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic, [LookupSource]>; /** * Create a vested transfer. * @@ -3756,7 +3756,7 @@ declare module '@polkadot/api/types/submittable' { * - Writes: Vesting Storage, Balances Locks, Target Account, [Sender Account] * # **/ - vestedTransfer: AugmentedSubmittable<(target: LookupSource | Address | AccountId | AccountIndex | string | Uint8Array, schedule: VestingInfo | { locked?: any; perBlock?: any; startingBlock?: any } | string | Uint8Array) => SubmittableExtrinsic, [LookupSource, VestingInfo]>; + vestedTransfer: AugmentedSubmittable<(target: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, schedule: VestingInfo | { locked?: any; perBlock?: any; startingBlock?: any } | string | Uint8Array) => SubmittableExtrinsic, [LookupSource, VestingInfo]>; }; } diff --git a/packages/api/src/promise/index.spec.ts b/packages/api/src/promise/index.spec.ts index cb40a2234d..9331c5efc8 100644 --- a/packages/api/src/promise/index.spec.ts +++ b/packages/api/src/promise/index.spec.ts @@ -12,7 +12,7 @@ import { hexToU8a } from '@polkadot/util'; import { SingleAccountSigner } from '../../test/util'; import { ApiPromise } from '.'; -const TRANSFER_SIG = '0x7a10e5ed9a14284eca7bea53f81631981dddda5a3d2dee973b136475947264801465726e4829ae3994d9058df638d959d4e043c7f1924299546790dda1dea20a'; +const TRANSFER_SIG = '0x54f39e43f32376a5ab6cdfd4d0ce57802aa9ff85514a7ffa9f2a949078f02beca16af87427c45fe60d54aa847fd241d127ed39e21b101806f6b1f50f7a82500b'; describe('ApiPromise', (): void => { const registry = new TypeRegistry(); diff --git a/packages/metadata/src/decorate/extrinsics/index.spec.ts b/packages/metadata/src/decorate/extrinsics/index.spec.ts index d6fbb26766..c7d6ef1ad9 100644 --- a/packages/metadata/src/decorate/extrinsics/index.spec.ts +++ b/packages/metadata/src/decorate/extrinsics/index.spec.ts @@ -15,6 +15,7 @@ const registry = new TypeRegistry(); const metadata = new Metadata(registry, metadataStatic); registry.setMetadata(metadata); +registry.register({ Address: 'IndicesLookupSource', LookupSource: 'IndicesLookupSource' }); const extrinsics = decorateExtrinsics(registry, metadata.asLatest, metadata.version); diff --git a/packages/types-known/src/spec/node.ts b/packages/types-known/src/spec/node.ts index 629dbd7230..d4beb1b9a3 100644 --- a/packages/types-known/src/spec/node.ts +++ b/packages/types-known/src/spec/node.ts @@ -8,21 +8,13 @@ import type { OverrideVersionedType } from '@polkadot/types/types'; // these are override types for Polkadot const versioned: OverrideVersionedType[] = [ { - minmax: [0, 259], + minmax: [0, 260], types: { AccountInfo: 'AccountInfoWithRefCount', Address: 'LookupSource', LookupSource: 'IndicesLookupSource' } }, - { - minmax: [260, 260], - types: { - AccountInfo: 'AccountInfoWithRefCount', - Address: 'MultiAddress', - LookupSource: 'MultiAddress' - } - }, { minmax: [261, undefined], types: { diff --git a/packages/types/src/codec/Enum.spec.ts b/packages/types/src/codec/Enum.spec.ts index 8cb563a473..5ff211abd8 100644 --- a/packages/types/src/codec/Enum.spec.ts +++ b/packages/types/src/codec/Enum.spec.ts @@ -389,7 +389,7 @@ describe('Enum', (): void => { expect(test.toHex()).toEqual( '0x' + '00' + // index - 'ff' + // Address indicating an embedded AccountId + '00' + // MultiAddress indicating an embedded AccountId '0001020304050607080910111213141516171819202122232425262728293031' // AccountId ); }); diff --git a/packages/types/src/extrinsic/Extrinsic.spec.ts b/packages/types/src/extrinsic/Extrinsic.spec.ts index a5cd746214..eb477eec02 100644 --- a/packages/types/src/extrinsic/Extrinsic.spec.ts +++ b/packages/types/src/extrinsic/Extrinsic.spec.ts @@ -20,7 +20,7 @@ describe('Extrinsic', (): void => { '0x' + '5d02' + // length '84' + // V4, signing bit set - 'ff' + // lookup, AccountId of sender follows + '00' + // MultiAddress, AccountId of sender follows 'fcc4910cb536b4333db4bccb40e2cf6427b4766518e754b91e70c97e4a87dbb3' + // sender '00' + // multisig, type ed25519 'd99ffe3e610ad234e1414bda5831395a6df9098bf80b01561ce89a5065ae89d5' + // sig first 32 @@ -29,7 +29,7 @@ describe('Extrinsic', (): void => { '1101' + // nonce, compact 68 '0700ac23fc06' + // tip, 0.03 KSM '0600' + // balances.transfer (on Kusama this was 0400, changed here to match metadata) - 'ff' + // lookup, AccountId of recipient follows + '00' + // MultiAddress, AccountId of recipient follows '495e1e506f266418af07fa0c5c108dd436f2faa59fe7d9e54403779f5bbd7718' + // recipient '0bc01eb1fc185f' // value, 104.560 KSM ); @@ -38,7 +38,7 @@ describe('Extrinsic', (): void => { expect(extrinsic.nonce.toNumber()).toEqual(68); expect(extrinsic.tip.toHuman()).toEqual('30.0000 mUnit'); expect(extrinsic.callIndex).toEqual(new Uint8Array([6, 0])); - expect(extrinsic.args[0].toHex()).toEqual('0xff495e1e506f266418af07fa0c5c108dd436f2faa59fe7d9e54403779f5bbd7718'); + expect(extrinsic.args[0].toHex()).toEqual('0x00495e1e506f266418af07fa0c5c108dd436f2faa59fe7d9e54403779f5bbd7718'); expect(extrinsic.args[1].toHuman()).toEqual('104.5609 Unit'); }); }); diff --git a/packages/types/src/extrinsic/SignerPayload.spec.ts b/packages/types/src/extrinsic/SignerPayload.spec.ts index 0d478a57d9..ffb37362a5 100644 --- a/packages/types/src/extrinsic/SignerPayload.spec.ts +++ b/packages/types/src/extrinsic/SignerPayload.spec.ts @@ -19,7 +19,7 @@ describe('SignerPayload', (): void => { blockNumber: '0x00231d30', era: '0x0703', genesisHash: '0xdcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025b', - method: '0x0600ffd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c', + method: '0x060000d7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c', nonce: '0x00001234', signedExtensions: ['CheckNonce', 'CheckWeight'], specVersion: '0x00000006', @@ -36,7 +36,7 @@ describe('SignerPayload', (): void => { blockNumber: '0x231d30', era: registry.createType('ExtrinsicEra', { current: 2301232, period: 200 }), genesisHash: '0xdcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025b', - method: registry.createType('Call', '0x0600ffd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c'), + method: registry.createType('Call', '0x060000d7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c'), nonce: 0x1234, signedExtensions: ['CheckNonce'], tip: 0x5678, @@ -48,7 +48,7 @@ describe('SignerPayload', (): void => { blockNumber: '0x00231d30', era: '0x0703', genesisHash: '0xdcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025b', - method: '0x0600ffd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c', + method: '0x060000d7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c', nonce: '0x00001234', signedExtensions: ['CheckNonce'], specVersion: '0x00000000', diff --git a/packages/types/src/extrinsic/v4/ExtrinsicSignature.spec.ts b/packages/types/src/extrinsic/v4/ExtrinsicSignature.spec.ts index 768079f24c..361c1e93f2 100644 --- a/packages/types/src/extrinsic/v4/ExtrinsicSignature.spec.ts +++ b/packages/types/src/extrinsic/v4/ExtrinsicSignature.spec.ts @@ -32,7 +32,7 @@ describe('ExtrinsicSignatureV4', (): void => { const u8a = new Uint8Array([ // signer as an AccountIndex - 0x09, + 0x01, 0x08, // 4 << 2 // signature type 0x01, // signature @@ -65,7 +65,7 @@ describe('ExtrinsicSignatureV4', (): void => { ).toHex() ).toEqual( '0x' + - 'ff' + + '00' + // MultiAddress 'd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d' + '01' + '4242424242424242424242424242424242424242424242424242424242424242' + @@ -93,7 +93,7 @@ describe('ExtrinsicSignatureV4', (): void => { ).toEqual( '0x' + // Address = AccountId - // 'ff' + + // '00' + 'd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d' + // This is a prefix-less signature, anySignture as opposed to Multi above // '01' + diff --git a/packages/types/src/generic/Call.spec.ts b/packages/types/src/generic/Call.spec.ts index 95cd55acfd..97795f875a 100644 --- a/packages/types/src/generic/Call.spec.ts +++ b/packages/types/src/generic/Call.spec.ts @@ -19,12 +19,16 @@ describe('Call', (): void => { args: [], callIndex: [6, 1] // balances.setBalance }).toU8a() - ).toEqual(new Uint8Array([6, 1, 0, 0, 0])); + ).toEqual( + new Uint8Array([6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) + ); }); it('handles creation from a hex value properly', (): void => { expect( new Call(registry, '0x0601').toU8a() - ).toEqual(new Uint8Array([6, 1, 0, 0, 0])); // balances.setBalance + ).toEqual( + new Uint8Array([6, 1, 1, 110, 7, 17, 0, 0, 0]) + ); // balances.setBalance }); }); diff --git a/packages/types/src/generic/LookupSource.spec.ts b/packages/types/src/generic/LookupSource.spec.ts index 5bd7b65f01..1cb344bb55 100644 --- a/packages/types/src/generic/LookupSource.spec.ts +++ b/packages/types/src/generic/LookupSource.spec.ts @@ -9,7 +9,7 @@ describe('LookupSource', (): void => { const testDecode = (type: string, input: LookupSource | AccountId | AccountIndex | number[] | Uint8Array, expected: string): void => it(`can decode from ${type}`, (): void => { - const a = registry.createType('Address', input); + const a = registry.createType('IndicesLookupSource', input); expect(a.toString()).toBe(expected); }); @@ -18,19 +18,19 @@ describe('LookupSource', (): void => { it('equals on AccountId', (): void => { const addr = '5DkQbYAExs3M2sZgT1Ec3mKfZnAQCL4Dt9beTCknkCUn5jzo'; - expect(registry.createType('LookupSource', addr).eq(addr)).toBe(true); + expect(registry.createType('IndicesLookupSource', addr).eq(addr)).toBe(true); }); it('equals on AccountIndex', (): void => { // see the test below - these are equivalent (with different prefix encoding) - expect(registry.createType('LookupSource', '2jpAFn').eq('25GUyv')).toBe(true); + expect(registry.createType('IndicesLookupSource', '2jpAFn').eq('25GUyv')).toBe(true); }); }); describe('decoding', (): void => { testDecode( 'Address', - registry.createType('LookupSource', '5C62W7ELLAAfix9LYrcx5smtcffbhvThkM5x7xfMeYXCtGwF'), + registry.createType('IndicesLookupSource', '5C62W7ELLAAfix9LYrcx5smtcffbhvThkM5x7xfMeYXCtGwF'), '5C62W7ELLAAfix9LYrcx5smtcffbhvThkM5x7xfMeYXCtGwF' ); testDecode( @@ -40,7 +40,7 @@ describe('LookupSource', (): void => { ); testDecode( 'AccountIndex (mixed prefixes)', - registry.createType('LookupSource', '2jpAFn'), + registry.createType('IndicesLookupSource', '2jpAFn'), // NOTE Expected adress here is encoded with prefix 42, input above with 68 '25GUyv' ); @@ -95,7 +95,7 @@ describe('LookupSource', (): void => { describe('encoding', (): void => { const testEncode = (to: 'toHex' | 'toString' | 'toU8a', expected: string | Uint8Array): void => it(`can encode ${to}`, (): void => { - const a = registry.createType('Address', '5C62W7ELLAAfix9LYrcx5smtcffbhvThkM5x7xfMeYXCtGwF'); + const a = registry.createType('IndicesLookupSource', '5C62W7ELLAAfix9LYrcx5smtcffbhvThkM5x7xfMeYXCtGwF'); expect(a[to]()).toEqual(expected); }); diff --git a/packages/types/src/interfaces/runtime/definitions.ts b/packages/types/src/interfaces/runtime/definitions.ts index 5bf265d8be..e7ed934c05 100644 --- a/packages/types/src/interfaces/runtime/definitions.ts +++ b/packages/types/src/interfaces/runtime/definitions.ts @@ -29,7 +29,7 @@ export default { AccountId: 'GenericAccountId', AccountIdOf: 'AccountId', AccountIndex: 'GenericAccountIndex', - Address: 'LookupSource', + Address: 'MultiAddress', AssetId: 'u32', Balance: 'UInt<128, Balance>', BalanceOf: 'Balance', @@ -82,7 +82,7 @@ export default { KeyValue: '(StorageKey, StorageData)', KeyTypeId: 'u32', LockIdentifier: '[u8; 8]', - LookupSource: 'IndicesLookupSource', + LookupSource: 'MultiAddress', LookupTarget: 'AccountId', ModuleId: 'LockIdentifier', MultiAddress: 'GenericMultiAddress', diff --git a/packages/types/src/interfaces/runtime/types.ts b/packages/types/src/interfaces/runtime/types.ts index 23a643d7a8..4af72abed3 100644 --- a/packages/types/src/interfaces/runtime/types.ts +++ b/packages/types/src/interfaces/runtime/types.ts @@ -17,7 +17,7 @@ export interface AccountIdOf extends AccountId {} export interface AccountIndex extends GenericAccountIndex {} /** @name Address */ -export interface Address extends LookupSource {} +export interface Address extends MultiAddress {} /** @name AssetId */ export interface AssetId extends u32 {} @@ -157,7 +157,7 @@ export interface KeyValue extends ITuple<[StorageKey, StorageData]> {} export interface LockIdentifier extends U8aFixed {} /** @name LookupSource */ -export interface LookupSource extends IndicesLookupSource {} +export interface LookupSource extends MultiAddress {} /** @name LookupTarget */ export interface LookupTarget extends AccountId {}