diff --git a/packages/types-known/src/spec/kusama.ts b/packages/types-known/src/spec/kusama.ts index 9ec60e88a4d9..093cdf8ab892 100644 --- a/packages/types-known/src/spec/kusama.ts +++ b/packages/types-known/src/spec/kusama.ts @@ -4,6 +4,12 @@ import { OverrideVersionedType } from '@polkadot/types/types'; +const sharedTypes = { + Address: 'AccountId', + Keys: 'SessionKeys5', + LookupSource: 'AccountId' +}; + const versioned: OverrideVersionedType[] = [ { // 1020 is first CC3 @@ -16,6 +22,7 @@ const versioned: OverrideVersionedType[] = [ Keys: 'SessionKeys5', LookupSource: 'Address', Multiplier: 'Fixed64', + OpenTip: 'OpenTipTo225', ReferendumInfo: 'ReferendumInfoTo239', SlashingSpans: 'SlashingSpansTo204', StakingLedger: 'StakingLedgerTo223', @@ -32,6 +39,7 @@ const versioned: OverrideVersionedType[] = [ Keys: 'SessionKeys5', LookupSource: 'Address', Multiplier: 'Fixed64', + OpenTip: 'OpenTipTo225', ReferendumInfo: 'ReferendumInfoTo239', SlashingSpans: 'SlashingSpansTo204', StakingLedger: 'StakingLedgerTo223', @@ -49,6 +57,7 @@ const versioned: OverrideVersionedType[] = [ Keys: 'SessionKeys5', LookupSource: 'Address', Multiplier: 'Fixed64', + OpenTip: 'OpenTipTo225', ReferendumInfo: 'ReferendumInfoTo239', StakingLedger: 'StakingLedgerTo223', Votes: 'VotesTo230', @@ -59,11 +68,10 @@ const versioned: OverrideVersionedType[] = [ minmax: [1046, 1054], types: { // Indices optional, not in transaction - Address: 'AccountId', + ...sharedTypes, DispatchInfo: 'DispatchInfoTo244', - Keys: 'SessionKeys5', - LookupSource: 'AccountId', Multiplier: 'Fixed64', + OpenTip: 'OpenTipTo225', ReferendumInfo: 'ReferendumInfoTo239', StakingLedger: 'StakingLedgerTo240', Weight: 'u32' @@ -72,11 +80,10 @@ const versioned: OverrideVersionedType[] = [ { minmax: [1055, 1056], types: { - Address: 'AccountId', + ...sharedTypes, DispatchInfo: 'DispatchInfoTo244', - Keys: 'SessionKeys5', - LookupSource: 'AccountId', Multiplier: 'Fixed64', + OpenTip: 'OpenTipTo225', StakingLedger: 'StakingLedgerTo240', Weight: 'u32' } @@ -84,18 +91,22 @@ const versioned: OverrideVersionedType[] = [ { minmax: [1057, 1061], types: { - Address: 'AccountId', + ...sharedTypes, DispatchInfo: 'DispatchInfoTo244', - Keys: 'SessionKeys5', - LookupSource: 'AccountId' + OpenTip: 'OpenTipTo225' } }, { - minmax: [1062, undefined], + minmax: [1062, 2012], types: { - Address: 'AccountId', - Keys: 'SessionKeys5', - LookupSource: 'AccountId' + ...sharedTypes, + OpenTip: 'OpenTipTo225' + } + }, + { + minmax: [2013, undefined], + types: { + ...sharedTypes } } ]; diff --git a/packages/types-known/src/spec/polkadot.ts b/packages/types-known/src/spec/polkadot.ts index efab433fee6e..d3bf751814a7 100644 --- a/packages/types-known/src/spec/polkadot.ts +++ b/packages/types-known/src/spec/polkadot.ts @@ -4,25 +4,28 @@ import { OverrideVersionedType } from '@polkadot/types/types'; +const sharedTypes = { + Address: 'AccountId', + Keys: 'SessionKeys5', + LookupSource: 'AccountId', + ProxyType: { + _enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'SudoBalances'] + } +}; + // these are override types for Polkadot const versioned: OverrideVersionedType[] = [ { - minmax: [0, 3], + minmax: [0, 12], types: { - Address: 'AccountId', - Keys: 'SessionKeys5', - LookupSource: 'AccountId' + ...sharedTypes, + OpenTip: 'OpenTipTo225' } }, { - minmax: [4, undefined], + minmax: [13, undefined], types: { - Address: 'AccountId', - Keys: 'SessionKeys5', - LookupSource: 'AccountId', - ProxyType: { - _enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'SudoBalances'] - } + ...sharedTypes } } ]; diff --git a/packages/types-known/src/spec/westend.ts b/packages/types-known/src/spec/westend.ts index ed20d55d6110..608420bfd393 100644 --- a/packages/types-known/src/spec/westend.ts +++ b/packages/types-known/src/spec/westend.ts @@ -4,34 +4,36 @@ import { OverrideVersionedType } from '@polkadot/types/types'; +const sharedTypes = { + Address: 'AccountId', + Keys: 'SessionKeys5', + LookupSource: 'AccountId', + ProxyType: { + _enum: ['Any', 'NonTransfer', 'Staking', 'SudoBalances'] + } +}; + const versioned: OverrideVersionedType[] = [ { minmax: [1, 2], types: { - Address: 'AccountId', - Keys: 'SessionKeys5', - LookupSource: 'AccountId', + ...sharedTypes, Multiplier: 'Fixed64', + OpenTip: 'OpenTipTo225', Weight: 'u32' } }, { - minmax: [3, 19], + minmax: [3, 22], types: { - Address: 'AccountId', - Keys: 'SessionKeys5', - LookupSource: 'AccountId' + ...sharedTypes, + OpenTip: 'OpenTipTo225' } }, { - minmax: [20, undefined], + minmax: [23, undefined], types: { - Address: 'AccountId', - Keys: 'SessionKeys5', - LookupSource: 'AccountId', - ProxyType: { - _enum: ['Any', 'NonTransfer', 'Staking', 'SudoBalances'] - } + ...sharedTypes } } ]; diff --git a/packages/types/src/augment/registry.ts b/packages/types/src/augment/registry.ts index 168de962ab44..435a23a7be57 100644 --- a/packages/types/src/augment/registry.ts +++ b/packages/types/src/augment/registry.ts @@ -39,7 +39,7 @@ import { ActiveEraInfo, CompactAssignments, CompactScore, ElectionCompute, Elect import { ApiId, KeyValueOption, ReadProof, RuntimeVersion, RuntimeVersionApi, StorageChangeSet } from '@polkadot/types/interfaces/state'; import { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support'; import { AccountInfo, ApplyExtrinsicResult, ChainProperties, ChainType, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, EventRecordTo76, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, Phase, RefCount, TransactionValidityError, UnknownTransaction } from '@polkadot/types/interfaces/system'; -import { OpenTip, OpenTipFinder, OpenTipTip, TreasuryProposal } from '@polkadot/types/interfaces/treasury'; +import { OpenTip, OpenTipFinderTo225, OpenTipTip, OpenTipTo225, TreasuryProposal } from '@polkadot/types/interfaces/treasury'; import { Multiplier } from '@polkadot/types/interfaces/txpayment'; import { CallHash, Multisig, Timepoint } from '@polkadot/types/interfaces/utility'; import { VestingInfo } from '@polkadot/types/interfaces/vesting'; @@ -1112,9 +1112,12 @@ declare module '@polkadot/types/types/registry' { OpenTip: OpenTip; 'Option': Option; 'Vec': Vec; - OpenTipFinder: OpenTipFinder; - 'Option': Option; - 'Vec': Vec; + OpenTipTo225: OpenTipTo225; + 'Option': Option; + 'Vec': Vec; + OpenTipFinderTo225: OpenTipFinderTo225; + 'Option': Option; + 'Vec': Vec; OpenTipTip: OpenTipTip; 'Option': Option; 'Vec': Vec; diff --git a/packages/types/src/interfaces/treasury/definitions.ts b/packages/types/src/interfaces/treasury/definitions.ts index 4f2bf171fca9..fef3f6dae53e 100644 --- a/packages/types/src/interfaces/treasury/definitions.ts +++ b/packages/types/src/interfaces/treasury/definitions.ts @@ -13,11 +13,20 @@ export default { OpenTip: { reason: 'Hash', who: 'AccountId', - finder: 'Option', + finder: 'AccountId', + deposit: 'Balance', + closes: 'Option', + tips: 'Vec', + findersFee: 'bool' + }, + OpenTipTo225: { + reason: 'Hash', + who: 'AccountId', + finder: 'Option', closes: 'Option', tips: 'Vec' }, - OpenTipFinder: '(AccountId, Balance)', + OpenTipFinderTo225: '(AccountId, Balance)', OpenTipTip: '(AccountId, Balance)', TreasuryProposal: { proposer: 'AccountId', diff --git a/packages/types/src/interfaces/treasury/types.ts b/packages/types/src/interfaces/treasury/types.ts index bee7ba1be3b9..cfd875827cf1 100644 --- a/packages/types/src/interfaces/treasury/types.ts +++ b/packages/types/src/interfaces/treasury/types.ts @@ -3,23 +3,35 @@ import { ITuple } from '@polkadot/types/types'; import { Option, Struct, Vec } from '@polkadot/types/codec'; +import { bool } from '@polkadot/types/primitive'; import { AccountId, Balance, BlockNumber, Hash } from '@polkadot/types/interfaces/runtime'; /** @name OpenTip */ export interface OpenTip extends Struct { readonly reason: Hash; readonly who: AccountId; - readonly finder: Option; + readonly finder: AccountId; + readonly deposit: Balance; readonly closes: Option; readonly tips: Vec; + readonly findersFee: bool; } -/** @name OpenTipFinder */ -export interface OpenTipFinder extends ITuple<[AccountId, Balance]> {} +/** @name OpenTipFinderTo225 */ +export interface OpenTipFinderTo225 extends ITuple<[AccountId, Balance]> {} /** @name OpenTipTip */ export interface OpenTipTip extends ITuple<[AccountId, Balance]> {} +/** @name OpenTipTo225 */ +export interface OpenTipTo225 extends Struct { + readonly reason: Hash; + readonly who: AccountId; + readonly finder: Option; + readonly closes: Option; + readonly tips: Vec; +} + /** @name TreasuryProposal */ export interface TreasuryProposal extends Struct { readonly proposer: AccountId;