Skip to content

Commit

Permalink
feat: ⏫ upgrade to Polkadot SDK v1.10.0 (#210)
Browse files Browse the repository at this point in the history
* refactor: 🎨 moved runtime apis into their own file

* fix: ⬆️ fix upgrade to polkadot-sdk v1.10.0

* fix: 🐛 add removed runtime api `get_worst_case_scenario_slashable_amount`

* fix: 🐛 add missing generic in storage providers runtime api

* chore: 🏷️ run typegen

* style: 🚨 run cargo fmt

* fix: 🎨 fix cargo clippy

* fix: 🚑 fix mocked relay chain randomness

* style: 🚨 run cargo fmt

* chore: 🚨 temporary remove unused import (until v1.13.0)

* fix: 🩹 update `query_earliest_file_volunteer_tick` runtime api

* fix: 🚑 fix issues with merge from main

* style: 🚨 run cargo fmt

* chore: 🏷️ run typegen

* fix: 🩹 fix merge from main
  • Loading branch information
TDemeco authored Oct 3, 2024
1 parent 7736ab0 commit f347a67
Show file tree
Hide file tree
Showing 41 changed files with 3,107 additions and 2,746 deletions.
2,423 changes: 1,211 additions & 1,212 deletions Cargo.lock

Large diffs are not rendered by default.

198 changes: 99 additions & 99 deletions Cargo.toml

Large diffs are not rendered by default.

226 changes: 110 additions & 116 deletions api-augment/dist/interfaces/lookup.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion api-augment/dist/interfaces/lookup.js.map

Large diffs are not rendered by default.

30 changes: 28 additions & 2 deletions api-augment/dist/types/interfaces/augment-api-consts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ import type {
export type __AugmentedConst<ApiType extends ApiTypes> = AugmentedConst<ApiType>;
declare module "@polkadot/api-base/types/consts" {
interface AugmentedConsts<ApiType extends ApiTypes> {
aura: {
/**
* The slot duration Aura should run with, expressed in milliseconds.
* The effective value of this type should not change while the chain is running.
*
* For backwards compatibility either use [`MinimumPeriodTimesTwo`] or a const.
**/
slotDuration: u64 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
balances: {
/**
* The minimum amount required to keep an account open. MUST BE GREATER THAN ZERO!
Expand All @@ -32,10 +45,14 @@ declare module "@polkadot/api-base/types/consts" {
/**
* The maximum number of locks that should exist on an account.
* Not strictly enforced, but used for weight estimation.
*
* Use of locks is deprecated in favour of freezes. See `https://github.com/paritytech/substrate/pull/12951/`
**/
maxLocks: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of named reserves that can exist on an account.
*
* Use of reserves is deprecated in favour of holds. See `https://github.com/paritytech/substrate/pull/12951/`
**/
maxReserves: u32 & AugmentedConst<ApiType>;
/**
Expand Down Expand Up @@ -117,6 +134,14 @@ declare module "@polkadot/api-base/types/consts" {
* size is slightly lower than this as defined by [`MaxMessageLenOf`].
**/
heapSize: u32 & AugmentedConst<ApiType>;
/**
* The maximum amount of weight (if any) to be used from remaining weight `on_idle` which
* should be provided to the message queue for servicing enqueued items `on_idle`.
* Useful for parachains to process messages at the same block they are received.
*
* If `None`, it will not call `ServiceQueues::service_queues` in `on_idle`.
**/
idleMaxServiceWeight: Option<SpWeightsWeightV2Weight> & AugmentedConst<ApiType>;
/**
* The maximum number of stale pages (i.e. of overweight messages) allowed before culling
* can happen. Once there are more stale pages than this, then historical pages may be
Expand All @@ -125,10 +150,11 @@ declare module "@polkadot/api-base/types/consts" {
maxStale: u32 & AugmentedConst<ApiType>;
/**
* The amount of weight (if any) which should be provided to the message queue for
* servicing enqueued items.
* servicing enqueued items `on_initialize`.
*
* This may be legitimately `None` in the case that you will call
* `ServiceQueues::service_queues` manually.
* `ServiceQueues::service_queues` manually or set [`Self::IdleMaxServiceWeight`] to have
* it run in `on_idle`.
**/
serviceWeight: Option<SpWeightsWeightV2Weight> & AugmentedConst<ApiType>;
/**
Expand Down
9 changes: 9 additions & 0 deletions api-augment/dist/types/interfaces/augment-api-errors.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,10 @@ declare module "@polkadot/api-base/types/errors" {
* Too many assets with different reserve locations have been attempted for transfer.
**/
TooManyReserves: AugmentedError<ApiType>;
/**
* Could not decode XCM.
**/
UnableToDecode: AugmentedError<ApiType>;
/**
* The desired destination was unreachable, generally because there is a no way of routing
* to it.
Expand All @@ -851,6 +855,11 @@ declare module "@polkadot/api-base/types/errors" {
* The message's weight could not be determined.
**/
UnweighableMessage: AugmentedError<ApiType>;
/**
* XCM encoded length is too large.
* Returned when an XCM encoded length is larger than `MaxXcmEncodedSize`.
**/
XcmTooLarge: AugmentedError<ApiType>;
/**
* Generic error
**/
Expand Down
20 changes: 12 additions & 8 deletions api-augment/dist/types/interfaces/augment-api-query.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ import type {
PalletXcmRemoteLockedFungibleRecord,
PalletXcmVersionMigrationStage,
PolkadotCorePrimitivesOutboundHrmpMessage,
PolkadotPrimitivesV6AbridgedHostConfiguration,
PolkadotPrimitivesV6PersistedValidationData,
PolkadotPrimitivesV6UpgradeGoAhead,
PolkadotPrimitivesV6UpgradeRestriction,
PolkadotPrimitivesV7AbridgedHostConfiguration,
PolkadotPrimitivesV7PersistedValidationData,
PolkadotPrimitivesV7UpgradeGoAhead,
PolkadotPrimitivesV7UpgradeRestriction,
ShpTraitsTrieRemoveMutation,
SpConsensusAuraSr25519AppSr25519Public,
SpCoreCryptoKeyTypeId,
Expand Down Expand Up @@ -208,6 +208,8 @@ declare module "@polkadot/api-base/types/storage" {
/**
* Any liquidity locks on some account balances.
* NOTE: Should only be accessed when setting, changing and freeing a lock.
*
* Use of locks is deprecated in favour of freezes. See `https://github.com/paritytech/substrate/pull/12951/`
**/
locks: AugmentedQuery<
ApiType,
Expand All @@ -217,6 +219,8 @@ declare module "@polkadot/api-base/types/storage" {
QueryableStorageEntry<ApiType, [AccountId32]>;
/**
* Named reserves on some account balances.
*
* Use of reserves is deprecated in favour of holds. See `https://github.com/paritytech/substrate/pull/12951/`
**/
reserves: AugmentedQuery<
ApiType,
Expand Down Expand Up @@ -768,7 +772,7 @@ declare module "@polkadot/api-base/types/storage" {
**/
hostConfiguration: AugmentedQuery<
ApiType,
() => Observable<Option<PolkadotPrimitivesV6AbridgedHostConfiguration>>,
() => Observable<Option<PolkadotPrimitivesV7AbridgedHostConfiguration>>,
[]
> &
QueryableStorageEntry<ApiType, []>;
Expand Down Expand Up @@ -914,7 +918,7 @@ declare module "@polkadot/api-base/types/storage" {
**/
upgradeGoAhead: AugmentedQuery<
ApiType,
() => Observable<Option<PolkadotPrimitivesV6UpgradeGoAhead>>,
() => Observable<Option<PolkadotPrimitivesV7UpgradeGoAhead>>,
[]
> &
QueryableStorageEntry<ApiType, []>;
Expand All @@ -929,7 +933,7 @@ declare module "@polkadot/api-base/types/storage" {
**/
upgradeRestrictionSignal: AugmentedQuery<
ApiType,
() => Observable<Option<PolkadotPrimitivesV6UpgradeRestriction>>,
() => Observable<Option<PolkadotPrimitivesV7UpgradeRestriction>>,
[]
> &
QueryableStorageEntry<ApiType, []>;
Expand All @@ -952,7 +956,7 @@ declare module "@polkadot/api-base/types/storage" {
**/
validationData: AugmentedQuery<
ApiType,
() => Observable<Option<PolkadotPrimitivesV6PersistedValidationData>>,
() => Observable<Option<PolkadotPrimitivesV7PersistedValidationData>>,
[]
> &
QueryableStorageEntry<ApiType, []>;
Expand Down
67 changes: 63 additions & 4 deletions api-augment/dist/types/interfaces/augment-api-tx.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ declare module "@polkadot/api-base/types/submittable" {
*
* This will waive the transaction fee if at least all but 10% of the accounts needed to
* be upgraded. (We let some not have to be upgraded just in order to allow for the
* possibililty of churn).
* possibility of churn).
**/
upgradeAccounts: AugmentedSubmittable<
(
Expand Down Expand Up @@ -2548,6 +2548,9 @@ declare module "@polkadot/api-base/types/submittable" {
* No more than `max_weight` will be used in its attempted execution. If this is less than
* the maximum amount of weight that the message could take to be executed, then no
* execution attempt will be made.
*
* WARNING: DEPRECATED. `execute` will be removed after June 2024. Use `execute_blob`
* instead.
**/
execute: AugmentedSubmittable<
(
Expand Down Expand Up @@ -2575,6 +2578,32 @@ declare module "@polkadot/api-base/types/submittable" {
) => SubmittableExtrinsic<ApiType>,
[XcmVersionedXcm, SpWeightsWeightV2Weight]
>;
/**
* Execute an XCM from a local, signed, origin.
*
* An event is deposited indicating whether the message could be executed completely
* or only partially.
*
* No more than `max_weight` will be used in its attempted execution. If this is less than
* the maximum amount of weight that the message could take to be executed, then no
* execution attempt will be made.
*
* The message is passed in encoded. It needs to be decodable as a [`VersionedXcm`].
**/
executeBlob: AugmentedSubmittable<
(
encodedMessage: Bytes | string | Uint8Array,
maxWeight:
| SpWeightsWeightV2Weight
| {
refTime?: any;
proofSize?: any;
}
| string
| Uint8Array
) => SubmittableExtrinsic<ApiType>,
[Bytes, SpWeightsWeightV2Weight]
>;
/**
* Set a safe XCM version (the version that XCM should be encoded with if the most recent
* version a destination can accept is unknown).
Expand Down Expand Up @@ -2687,7 +2716,7 @@ declare module "@polkadot/api-base/types/submittable" {
*
* Fee payment on the destination side is made from the asset in the `assets` vector of
* index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight
* is needed than `weight_limit`, then the operation will fail and the assets send may be
* is needed than `weight_limit`, then the operation will fail and the sent assets may be
* at risk.
*
* - `origin`: Must be capable of withdrawing the `assets` and executing XCM.
Expand Down Expand Up @@ -2762,7 +2791,7 @@ declare module "@polkadot/api-base/types/submittable" {
*
* Fee payment on the destination side is made from the asset in the `assets` vector of
* index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight
* is needed than `weight_limit`, then the operation will fail and the assets send may be
* is needed than `weight_limit`, then the operation will fail and the sent assets may be
* at risk.
*
* - `origin`: Must be capable of withdrawing the `assets` and executing XCM.
Expand Down Expand Up @@ -2909,6 +2938,9 @@ declare module "@polkadot/api-base/types/submittable" {
) => SubmittableExtrinsic<ApiType>,
[XcmVersionedLocation, XcmVersionedLocation, XcmVersionedAssets, u32]
>;
/**
* WARNING: DEPRECATED. `send` will be removed after June 2024. Use `send_blob` instead.
**/
send: AugmentedSubmittable<
(
dest:
Expand Down Expand Up @@ -2940,6 +2972,33 @@ declare module "@polkadot/api-base/types/submittable" {
) => SubmittableExtrinsic<ApiType>,
[XcmVersionedLocation, XcmVersionedXcm]
>;
/**
* Send an XCM from a local, signed, origin.
*
* The destination, `dest`, will receive this message with a `DescendOrigin` instruction
* that makes the origin of the message be the origin on this system.
*
* The message is passed in encoded. It needs to be decodable as a [`VersionedXcm`].
**/
sendBlob: AugmentedSubmittable<
(
dest:
| XcmVersionedLocation
| {
V2: any;
}
| {
V3: any;
}
| {
V4: any;
}
| string
| Uint8Array,
encodedMessage: Bytes | string | Uint8Array
) => SubmittableExtrinsic<ApiType>,
[XcmVersionedLocation, Bytes]
>;
/**
* Teleport some assets from the local chain to some destination chain.
*
Expand Down Expand Up @@ -3012,7 +3071,7 @@ declare module "@polkadot/api-base/types/submittable" {
* Fee payment on the destination side is made from the asset in the `assets` vector of
* index `fee_asset_item` (hence referred to as `fees`), up to enough to pay for
* `weight_limit` of weight. If more weight is needed than `weight_limit`, then the
* operation will fail and the assets sent may be at risk.
* operation will fail and the sent assets may be at risk.
*
* `assets` (excluding `fees`) must have same reserve location or otherwise be teleportable
* to `dest`, no limitations imposed on `fees`.
Expand Down
Loading

0 comments on commit f347a67

Please sign in to comment.