Skip to content

Commit fed0d5b

Browse files
authored
Update substrate to latest (#5872)
1 parent 53e9305 commit fed0d5b

File tree

11 files changed

+2340
-1805
lines changed

11 files changed

+2340
-1805
lines changed

packages/api-augment/src/substrate/errors.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,28 @@ declare module '@polkadot/api-base/types/errors' {
265265
**/
266266
[key: string]: AugmentedError<ApiType>;
267267
};
268+
assetConversionMigration: {
269+
/**
270+
* Provided asset pair is not supported for pool.
271+
**/
272+
InvalidAssetPair: AugmentedError<ApiType>;
273+
/**
274+
* Indicates a partial transfer of balance to the new account during a migration.
275+
**/
276+
PartialTransfer: AugmentedError<ApiType>;
277+
/**
278+
* The pool doesn't exist.
279+
**/
280+
PoolNotFound: AugmentedError<ApiType>;
281+
/**
282+
* Pool's balance cannot be zero.
283+
**/
284+
ZeroBalance: AugmentedError<ApiType>;
285+
/**
286+
* Generic error
287+
**/
288+
[key: string]: AugmentedError<ApiType>;
289+
};
268290
assetRate: {
269291
/**
270292
* The given asset ID already has an assigned conversion rate and cannot be re-created.
@@ -547,6 +569,10 @@ declare module '@polkadot/api-base/types/errors' {
547569
* The configuration could not be applied because it is invalid.
548570
**/
549571
InvalidConfig: AugmentedError<ApiType>;
572+
/**
573+
* The revenue must be claimed for 1 or more timeslices.
574+
**/
575+
NoClaimTimeslices: AugmentedError<ApiType>;
550576
/**
551577
* The history item does not exist.
552578
**/
@@ -2813,6 +2839,10 @@ declare module '@polkadot/api-base/types/errors' {
28132839
* Not a controller account.
28142840
**/
28152841
NotController: AugmentedError<ApiType>;
2842+
/**
2843+
* Not enough funds available to withdraw.
2844+
**/
2845+
NotEnoughFunds: AugmentedError<ApiType>;
28162846
/**
28172847
* Items are not sorted and unique.
28182848
**/
@@ -2825,6 +2855,10 @@ declare module '@polkadot/api-base/types/errors' {
28252855
* Can not rebond without unlocking chunks.
28262856
**/
28272857
NoUnlockChunk: AugmentedError<ApiType>;
2858+
/**
2859+
* Provided reward destination is not allowed.
2860+
**/
2861+
RewardDestinationRestricted: AugmentedError<ApiType>;
28282862
/**
28292863
* There are too many nominators in the system. Governance needs to adjust the staking
28302864
* settings to keep things safe for the runtime.

packages/api-augment/src/substrate/events.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,20 @@ declare module '@polkadot/api-base/types/events' {
131131
* and `SwapTokenForExactToken` will generate this event.
132132
**/
133133
SwapExecuted: AugmentedEvent<ApiType, [who: AccountId32, sendTo: AccountId32, amountIn: u128, amountOut: u128, path: Vec<ITuple<[FrameSupportTokensFungibleUnionOfNativeOrWithId, u128]>>], { who: AccountId32, sendTo: AccountId32, amountIn: u128, amountOut: u128, path: Vec<ITuple<[FrameSupportTokensFungibleUnionOfNativeOrWithId, u128]>> }>;
134+
/**
135+
* Pool has been touched in order to fulfill operational requirements.
136+
**/
137+
Touched: AugmentedEvent<ApiType, [poolId: ITuple<[FrameSupportTokensFungibleUnionOfNativeOrWithId, FrameSupportTokensFungibleUnionOfNativeOrWithId]>, who: AccountId32], { poolId: ITuple<[FrameSupportTokensFungibleUnionOfNativeOrWithId, FrameSupportTokensFungibleUnionOfNativeOrWithId]>, who: AccountId32 }>;
138+
/**
139+
* Generic event
140+
**/
141+
[key: string]: AugmentedEvent<ApiType>;
142+
};
143+
assetConversionMigration: {
144+
/**
145+
* Indicates that a pool has been migrated to the new account ID.
146+
**/
147+
MigratedToNewAccount: AugmentedEvent<ApiType, [poolId: ITuple<[FrameSupportTokensFungibleUnionOfNativeOrWithId, FrameSupportTokensFungibleUnionOfNativeOrWithId]>, priorAccount: AccountId32, newAccount: AccountId32], { poolId: ITuple<[FrameSupportTokensFungibleUnionOfNativeOrWithId, FrameSupportTokensFungibleUnionOfNativeOrWithId]>, priorAccount: AccountId32, newAccount: AccountId32 }>;
134148
/**
135149
* Generic event
136150
**/
@@ -533,7 +547,7 @@ declare module '@polkadot/api-base/types/events' {
533547
/**
534548
* Ownership of a Region has been transferred.
535549
**/
536-
Transferred: AugmentedEvent<ApiType, [regionId: PalletBrokerRegionId, duration: u32, oldOwner: AccountId32, owner: AccountId32], { regionId: PalletBrokerRegionId, duration: u32, oldOwner: AccountId32, owner: AccountId32 }>;
550+
Transferred: AugmentedEvent<ApiType, [regionId: PalletBrokerRegionId, duration: u32, oldOwner: Option<AccountId32>, owner: Option<AccountId32>], { regionId: PalletBrokerRegionId, duration: u32, oldOwner: Option<AccountId32>, owner: Option<AccountId32> }>;
537551
/**
538552
* Generic event
539553
**/

packages/api-augment/src/substrate/query.ts

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ declare module '@polkadot/api-base/types/storage' {
425425
**/
426426
leases: AugmentedQuery<ApiType, () => Observable<Vec<PalletBrokerLeaseRecordItem>>, []> & QueryableStorageEntry<ApiType, []>;
427427
/**
428-
* The current (unassigned) Regions.
428+
* The current (unassigned or provisionally assigend) Regions.
429429
**/
430430
regions: AugmentedQuery<ApiType, (arg: PalletBrokerRegionId | { begin?: any; core?: any; mask?: any } | string | Uint8Array) => Observable<Option<PalletBrokerRegionRecord>>, [PalletBrokerRegionId]> & QueryableStorageEntry<ApiType, [PalletBrokerRegionId]>;
431431
/**
@@ -1399,11 +1399,21 @@ declare module '@polkadot/api-base/types/storage' {
13991399
**/
14001400
[key: string]: QueryableStorageEntry<ApiType>;
14011401
};
1402+
palletExampleMbms: {
1403+
/**
1404+
* Define a storage item to illustrate multi-block migrations.
1405+
**/
1406+
myMap: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<u64>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
1407+
/**
1408+
* Generic query
1409+
**/
1410+
[key: string]: QueryableStorageEntry<ApiType>;
1411+
};
14021412
parameters: {
14031413
/**
14041414
* Stored parameters.
14051415
**/
1406-
parameters: AugmentedQuery<ApiType, (arg: KitchensinkRuntimeRuntimeParametersKey | { Storage: any } | { Contract: any } | string | Uint8Array) => Observable<Option<KitchensinkRuntimeRuntimeParametersValue>>, [KitchensinkRuntimeRuntimeParametersKey]> & QueryableStorageEntry<ApiType, [KitchensinkRuntimeRuntimeParametersKey]>;
1416+
parameters: AugmentedQuery<ApiType, (arg: KitchensinkRuntimeRuntimeParametersKey | { Storage: any } | { Contracts: any } | string | Uint8Array) => Observable<Option<KitchensinkRuntimeRuntimeParametersValue>>, [KitchensinkRuntimeRuntimeParametersKey]> & QueryableStorageEntry<ApiType, [KitchensinkRuntimeRuntimeParametersKey]>;
14071417
/**
14081418
* Generic query
14091419
**/
@@ -1861,6 +1871,10 @@ declare module '@polkadot/api-base/types/storage' {
18611871
* Counter for the related counted storage map
18621872
**/
18631873
counterForValidators: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
1874+
/**
1875+
* Counter for the related counted storage map
1876+
**/
1877+
counterForVirtualStakers: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
18641878
/**
18651879
* The current era index.
18661880
*
@@ -2094,6 +2108,15 @@ declare module '@polkadot/api-base/types/storage' {
20942108
* and slash value of the era.
20952109
**/
20962110
validatorSlashInEra: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: AccountId32 | string | Uint8Array) => Observable<Option<ITuple<[Perbill, u128]>>>, [u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, AccountId32]>;
2111+
/**
2112+
* Stakers whose funds are managed by other pallets.
2113+
*
2114+
* This pallet does not apply any locks on them, therefore they are only virtually bonded. They
2115+
* are expected to be keyless accounts and hence should not be allowed to mutate their ledger
2116+
* directly via this pallet. Instead, these accounts are managed by other pallets and accessed
2117+
* via low level apis. We keep track of them to do minimal integrity checks.
2118+
**/
2119+
virtualStakers: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<Null>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
20972120
/**
20982121
* Generic query
20992122
**/

packages/api-augment/src/substrate/tx.ts

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,33 @@ declare module '@polkadot/api-base/types/submittable' {
274274
* for a quote.
275275
**/
276276
swapTokensForExactTokens: AugmentedSubmittable<(path: Vec<FrameSupportTokensFungibleUnionOfNativeOrWithId> | (FrameSupportTokensFungibleUnionOfNativeOrWithId | { Native: any } | { WithId: any } | string | Uint8Array)[], amountOut: u128 | AnyNumber | Uint8Array, amountInMax: u128 | AnyNumber | Uint8Array, sendTo: AccountId32 | string | Uint8Array, keepAlive: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<FrameSupportTokensFungibleUnionOfNativeOrWithId>, u128, u128, AccountId32, bool]>;
277+
/**
278+
* Touch an existing pool to fulfill prerequisites before providing liquidity, such as
279+
* ensuring that the pool's accounts are in place. It is typically useful when a pool
280+
* creator removes the pool's accounts and does not provide a liquidity. This action may
281+
* involve holding assets from the caller as a deposit for creating the pool's accounts.
282+
*
283+
* The origin must be Signed.
284+
*
285+
* - `asset1`: The asset ID of an existing pool with a pair (asset1, asset2).
286+
* - `asset2`: The asset ID of an existing pool with a pair (asset1, asset2).
287+
*
288+
* Emits `Touched` event when successful.
289+
**/
290+
touch: AugmentedSubmittable<(asset1: FrameSupportTokensFungibleUnionOfNativeOrWithId | { Native: any } | { WithId: any } | string | Uint8Array, asset2: FrameSupportTokensFungibleUnionOfNativeOrWithId | { Native: any } | { WithId: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [FrameSupportTokensFungibleUnionOfNativeOrWithId, FrameSupportTokensFungibleUnionOfNativeOrWithId]>;
291+
/**
292+
* Generic tx
293+
**/
294+
[key: string]: SubmittableExtrinsicFunction<ApiType>;
295+
};
296+
assetConversionMigration: {
297+
/**
298+
* Migrates an existing pool to a new account ID derivation method for a given asset pair.
299+
* If the migration is successful, transaction fees are refunded to the caller.
300+
*
301+
* Must be signed.
302+
**/
303+
migrateToNewAccount: AugmentedSubmittable<(asset1: FrameSupportTokensFungibleUnionOfNativeOrWithId | { Native: any } | { WithId: any } | string | Uint8Array, asset2: FrameSupportTokensFungibleUnionOfNativeOrWithId | { Native: any } | { WithId: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [FrameSupportTokensFungibleUnionOfNativeOrWithId, FrameSupportTokensFungibleUnionOfNativeOrWithId]>;
277304
/**
278305
* Generic tx
279306
**/
@@ -1109,13 +1136,12 @@ declare module '@polkadot/api-base/types/submittable' {
11091136
/**
11101137
* Claim the revenue owed from inclusion in the Instantaneous Coretime Pool.
11111138
*
1112-
* - `origin`: Must be a Signed origin of the account which owns the Region `region_id`.
1139+
* - `origin`: Must be a Signed origin.
11131140
* - `region_id`: The Region which was assigned to the Pool.
1114-
* - `max_timeslices`: The maximum number of timeslices which should be processed. This may
1115-
* effect the weight of the call but should be ideally made equivalent to the length of
1116-
* the Region `region_id`. If it is less than this, then further dispatches will be
1117-
* required with the `region_id` which makes up any remainders of the region to be
1118-
* collected.
1141+
* - `max_timeslices`: The maximum number of timeslices which should be processed. This
1142+
* must be greater than 0. This may affect the weight of the call but should be ideally
1143+
* made equivalent to the length of the Region `region_id`. If less, further dispatches
1144+
* will be required with the same `region_id` to claim revenue for the remainder.
11191145
**/
11201146
claimRevenue: AugmentedSubmittable<(regionId: PalletBrokerRegionId | { begin?: any; core?: any; mask?: any } | string | Uint8Array, maxTimeslices: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletBrokerRegionId, u32]>;
11211147
/**
@@ -1240,9 +1266,13 @@ declare module '@polkadot/api-base/types/submittable' {
12401266
*
12411267
* - `origin`: Must be Root or pass `AdminOrigin`.
12421268
* - `initial_price`: The price of Bulk Coretime in the first sale.
1243-
* - `core_count`: The number of cores which can be allocated.
1269+
* - `extra_cores`: Number of extra cores that should be requested on top of the cores
1270+
* required for `Reservations` and `Leases`.
1271+
*
1272+
* This will call [`Self::request_core_count`] internally to set the correct core count on
1273+
* the relay chain.
12441274
**/
1245-
startSales: AugmentedSubmittable<(initialPrice: u128 | AnyNumber | Uint8Array, coreCount: u16 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u128, u16]>;
1275+
startSales: AugmentedSubmittable<(initialPrice: u128 | AnyNumber | Uint8Array, extraCores: u16 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u128, u16]>;
12461276
swapLeases: AugmentedSubmittable<(id: u32 | AnyNumber | Uint8Array, other: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
12471277
/**
12481278
* Transfer a Bulk Coretime Region to a new owner.
@@ -3965,7 +3995,7 @@ declare module '@polkadot/api-base/types/submittable' {
39653995
setCommissionMax: AugmentedSubmittable<(poolId: u32 | AnyNumber | Uint8Array, maxCommission: Perbill | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Perbill]>;
39663996
/**
39673997
* Update configurations for the nomination pools. The origin for this call must be
3968-
* Root.
3998+
* [`Config::AdminOrigin`].
39693999
*
39704000
* # Arguments
39714001
*
@@ -4075,7 +4105,7 @@ declare module '@polkadot/api-base/types/submittable' {
40754105
* The dispatch origin of this call must be `AdminOrigin` for the given `key`. Values be
40764106
* deleted by setting them to `None`.
40774107
**/
4078-
setParameter: AugmentedSubmittable<(keyValue: KitchensinkRuntimeRuntimeParameters | { Storage: any } | { Contract: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [KitchensinkRuntimeRuntimeParameters]>;
4108+
setParameter: AugmentedSubmittable<(keyValue: KitchensinkRuntimeRuntimeParameters | { Storage: any } | { Contracts: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [KitchensinkRuntimeRuntimeParameters]>;
40794109
/**
40804110
* Generic tx
40814111
**/

0 commit comments

Comments
 (0)