Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ⏫ upgrade to Polkadot SDK v1.14.0 #218

Merged
merged 42 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
2eff08b
refactor: :art: moved runtime apis into their own file
TDemeco Sep 27, 2024
303feb3
fix: :arrow_up: fix upgrade to polkadot-sdk v1.10.0
TDemeco Sep 27, 2024
e5ba5bd
Merge branch 'main' into update/polkadot-sdk-1.10.0
TDemeco Sep 27, 2024
3e4328d
fix: :bug: add removed runtime api `get_worst_case_scenario_slashable…
TDemeco Sep 27, 2024
3605611
fix: :bug: add missing generic in storage providers runtime api
TDemeco Sep 27, 2024
3659377
chore: :label: run typegen
TDemeco Sep 27, 2024
c1219f1
style: :rotating_light: run cargo fmt
TDemeco Sep 27, 2024
5ac0258
fix: :art: fix cargo clippy
TDemeco Sep 28, 2024
e82a113
Merge branch 'main' into update/polkadot-sdk-1.10.0
TDemeco Sep 28, 2024
91ae601
fix: :ambulance: fix mocked relay chain randomness
TDemeco Sep 28, 2024
97c0b64
style: :rotating_light: run cargo fmt
TDemeco Sep 28, 2024
787d1df
chore: :rotating_light: temporary remove unused import (until v1.13.0)
TDemeco Sep 28, 2024
9653a4e
Merge branch 'main' into update/polkadot-sdk-1.10.0
TDemeco Sep 28, 2024
6fb8bd4
fix: :adhesive_bandage: update `query_earliest_file_volunteer_tick` r…
TDemeco Sep 28, 2024
cde6b90
fix: :ambulance: fix issues with merge from main
TDemeco Sep 28, 2024
570e548
style: :rotating_light: run cargo fmt
TDemeco Sep 28, 2024
9bb33cc
feat: :package: initial update to polkadot sdk v1.11.0
TDemeco Sep 30, 2024
e28f09b
feat: :arrow_up: finish upgrade to polkadot sdk v1.11.0
TDemeco Sep 30, 2024
2947b01
Merge branch 'main' into update/polkadot-sdk-1.10.0
TDemeco Sep 30, 2024
5c07140
chore: :label: run typegen
TDemeco Sep 30, 2024
f86f2c1
Merge branch 'update/polkadot-sdk-1.10.0' into update/polkadot-sdk-1.…
TDemeco Sep 30, 2024
f4964fc
chore: :label: run typegen
TDemeco Sep 30, 2024
f85735d
fix: :white_check_mark: fix node tests after rebenchmark of balances …
TDemeco Oct 1, 2024
b7090b5
feat: :arrow_up: update to Polkadot SDK v1.12.0
TDemeco Oct 3, 2024
889fa3c
feat: :arrow_up: update to Polkadot SDK v1.13.0
TDemeco Oct 4, 2024
9587713
fix: :arrow_up: finish upgrading to Polkadot SDK v1.13.0
TDemeco Oct 4, 2024
5142fdd
Merge branch 'main' into update/polkadot-sdk-v1.13.0
TDemeco Oct 4, 2024
4eb7f24
fix: :bug: add missing imports (and run typegen)
TDemeco Oct 4, 2024
73a343f
fix: :arrow_down: rollback polkadotjs api dependencies
TDemeco Oct 4, 2024
090bfa6
chore: :label: rerun pnpm typegen
TDemeco Oct 4, 2024
ff67efb
feat: :construction: start upgrade to Polkadot SDK 1.14.0
TDemeco Oct 7, 2024
b857c6d
fix: :rotating_light: format and lint
TDemeco Oct 7, 2024
c6157a0
fix: :rotating_light: remove trailing whitespace
TDemeco Oct 7, 2024
91d7b73
Merge branch 'update/polkadot-sdk-v1.13.0' into update/polkadot-sdk-v…
TDemeco Oct 7, 2024
550ccd0
feat: :arrow_up: upgrade to Polkadot SDK v1.14.0
TDemeco Oct 7, 2024
d2b13b2
Merge branch 'main' into update/polkadot-sdk-v1.14.0
TDemeco Oct 7, 2024
830357a
Merge branch 'main' into update/polkadot-sdk-v1.14.0
TDemeco Oct 7, 2024
3ff32ca
chore: :label: run typegen
TDemeco Oct 7, 2024
79435a7
fix: :rotating_light: run cargo fmt
TDemeco Oct 7, 2024
9c320c8
docs: :fire: remove wrong license docs
TDemeco Oct 7, 2024
32a8c13
Merge branch 'main' into update/polkadot-sdk-v1.14.0
TDemeco Oct 7, 2024
13b9f3e
chore: :label: run typegen
TDemeco Oct 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,381 changes: 1,287 additions & 1,094 deletions Cargo.lock

Large diffs are not rendered by default.

206 changes: 103 additions & 103 deletions Cargo.toml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions api-augment/dist/interfaces/lookup.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions api-augment/dist/types/interfaces/augment-api-query.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ import type {
CumulusPalletXcmpQueueQueueConfigData,
CumulusPrimitivesCoreAggregateMessageOrigin,
FrameSupportDispatchPerDispatchClassWeight,
FrameSupportTokensMiscIdAmount,
FrameSystemAccountInfo,
FrameSystemCodeUpgradeAuthorization,
FrameSystemEventRecord,
FrameSystemLastRuntimeUpgradeInfo,
FrameSystemPhase,
PalletBalancesAccountData,
PalletBalancesBalanceLock,
PalletBalancesIdAmount,
PalletBalancesReserveData,
PalletCollatorSelectionCandidateInfo,
PalletFileSystemMoveBucketRequestMetadata,
Expand Down Expand Up @@ -181,7 +181,7 @@ declare module "@polkadot/api-base/types/storage" {
**/
freezes: AugmentedQuery<
ApiType,
(arg: AccountId32 | string | Uint8Array) => Observable<Vec<PalletBalancesIdAmount>>,
(arg: AccountId32 | string | Uint8Array) => Observable<Vec<FrameSupportTokensMiscIdAmount>>,
[AccountId32]
> &
QueryableStorageEntry<ApiType, [AccountId32]>;
Expand Down
35 changes: 34 additions & 1 deletion api-augment/dist/types/interfaces/augment-api-runtime.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ import type { RuntimeVersion } from "@polkadot/types/interfaces/state";
import type { ApplyExtrinsicResult, Key } from "@polkadot/types/interfaces/system";
import type { TransactionSource, TransactionValidity } from "@polkadot/types/interfaces/txqueue";
import type { XcmPaymentApiError } from "@polkadot/types/interfaces/xcmPaymentApi";
import type { XcmVersionedAssetId, XcmVersionedXcm } from "@polkadot/types/lookup";
import type { Error } from "@polkadot/types/interfaces/xcmRuntimeApi";
import type {
XcmVersionedAssetId,
XcmVersionedLocation,
XcmVersionedXcm
} from "@polkadot/types/lookup";
import type { IExtrinsic, Observable } from "@polkadot/types/types";
import type {
BackupStorageProvider,
Expand Down Expand Up @@ -294,6 +299,34 @@ declare module "@polkadot/api-base/types/calls" {
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x9ffb505aa738d69c/1 */
locationToAccountApi: {
/**
* Converts `Location` to `AccountId`
**/
convertLocation: AugmentedCall<
ApiType,
(
location:
| XcmVersionedLocation
| {
V2: any;
}
| {
V3: any;
}
| {
V4: any;
}
| string
| Uint8Array
) => Observable<Result<AccountId, Error>>
>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x37e397fc7c91f5e4/2 */
metadata: {
/**
Expand Down
2 changes: 1 addition & 1 deletion api-augment/dist/types/interfaces/augment-api-tx.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3157,7 +3157,7 @@ declare module "@polkadot/api-base/types/submittable" {
* - `assets`: The assets to be withdrawn. This should include the assets used to pay the
* fee on the `dest` (and possibly reserve) chains.
* - `assets_transfer_type`: The XCM `TransferType` used to transfer the `assets`.
* - `remote_fees_id`: One of the included `assets` to be be used to pay fees.
* - `remote_fees_id`: One of the included `assets` to be used to pay fees.
* - `fees_transfer_type`: The XCM `TransferType` used to transfer the `fees` assets.
* - `custom_xcm_on_dest`: The XCM to be executed on `dest` chain as the last step of the
* transfer, which also determines what happens to the assets on the destination chain.
Expand Down
4 changes: 2 additions & 2 deletions api-augment/dist/types/interfaces/lookup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2448,9 +2448,9 @@ declare const _default: {
_enum: string[];
};
/**
* Lookup270: pallet_balances::types::IdAmount<Id, Balance>
* Lookup270: frame_support::traits::tokens::misc::IdAmount<Id, Balance>
**/
PalletBalancesIdAmount: {
FrameSupportTokensMiscIdAmount: {
id: string;
amount: string;
};
Expand Down
4 changes: 2 additions & 2 deletions api-augment/dist/types/interfaces/registry.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import type {
FrameSupportDispatchPerDispatchClassWeightsPerClass,
FrameSupportMessagesProcessMessageError,
FrameSupportTokensMiscBalanceStatus,
FrameSupportTokensMiscIdAmount,
FrameSystemAccountInfo,
FrameSystemCall,
FrameSystemCodeUpgradeAuthorization,
Expand All @@ -53,7 +54,6 @@ import type {
PalletBalancesCall,
PalletBalancesError,
PalletBalancesEvent,
PalletBalancesIdAmount,
PalletBalancesReasons,
PalletBalancesReserveData,
PalletBucketNftsCall,
Expand Down Expand Up @@ -299,6 +299,7 @@ declare module "@polkadot/types/types/registry" {
FrameSupportDispatchPerDispatchClassWeightsPerClass: FrameSupportDispatchPerDispatchClassWeightsPerClass;
FrameSupportMessagesProcessMessageError: FrameSupportMessagesProcessMessageError;
FrameSupportTokensMiscBalanceStatus: FrameSupportTokensMiscBalanceStatus;
FrameSupportTokensMiscIdAmount: FrameSupportTokensMiscIdAmount;
FrameSystemAccountInfo: FrameSystemAccountInfo;
FrameSystemCall: FrameSystemCall;
FrameSystemCodeUpgradeAuthorization: FrameSystemCodeUpgradeAuthorization;
Expand All @@ -322,7 +323,6 @@ declare module "@polkadot/types/types/registry" {
PalletBalancesCall: PalletBalancesCall;
PalletBalancesError: PalletBalancesError;
PalletBalancesEvent: PalletBalancesEvent;
PalletBalancesIdAmount: PalletBalancesIdAmount;
PalletBalancesReasons: PalletBalancesReasons;
PalletBalancesReserveData: PalletBalancesReserveData;
PalletBucketNftsCall: PalletBucketNftsCall;
Expand Down
4 changes: 2 additions & 2 deletions api-augment/dist/types/interfaces/types-lookup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2917,8 +2917,8 @@ declare module "@polkadot/types/lookup" {
readonly isPaymentStreamDeposit: boolean;
readonly type: "PaymentStreamDeposit";
}
/** @name PalletBalancesIdAmount (270) */
interface PalletBalancesIdAmount extends Struct {
/** @name FrameSupportTokensMiscIdAmount (270) */
interface FrameSupportTokensMiscIdAmount extends Struct {
readonly id: Null;
readonly amount: u128;
}
Expand Down
4 changes: 2 additions & 2 deletions api-augment/src/interfaces/augment-api-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ import type {
CumulusPalletXcmpQueueQueueConfigData,
CumulusPrimitivesCoreAggregateMessageOrigin,
FrameSupportDispatchPerDispatchClassWeight,
FrameSupportTokensMiscIdAmount,
FrameSystemAccountInfo,
FrameSystemCodeUpgradeAuthorization,
FrameSystemEventRecord,
FrameSystemLastRuntimeUpgradeInfo,
FrameSystemPhase,
PalletBalancesAccountData,
PalletBalancesBalanceLock,
PalletBalancesIdAmount,
PalletBalancesReserveData,
PalletCollatorSelectionCandidateInfo,
PalletFileSystemMoveBucketRequestMetadata,
Expand Down Expand Up @@ -190,7 +190,7 @@ declare module "@polkadot/api-base/types/storage" {
**/
freezes: AugmentedQuery<
ApiType,
(arg: AccountId32 | string | Uint8Array) => Observable<Vec<PalletBalancesIdAmount>>,
(arg: AccountId32 | string | Uint8Array) => Observable<Vec<FrameSupportTokensMiscIdAmount>>,
[AccountId32]
> &
QueryableStorageEntry<ApiType, [AccountId32]>;
Expand Down
29 changes: 28 additions & 1 deletion api-augment/src/interfaces/augment-api-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ import type { RuntimeVersion } from "@polkadot/types/interfaces/state";
import type { ApplyExtrinsicResult, Key } from "@polkadot/types/interfaces/system";
import type { TransactionSource, TransactionValidity } from "@polkadot/types/interfaces/txqueue";
import type { XcmPaymentApiError } from "@polkadot/types/interfaces/xcmPaymentApi";
import type { XcmVersionedAssetId, XcmVersionedXcm } from "@polkadot/types/lookup";
import type { Error } from "@polkadot/types/interfaces/xcmRuntimeApi";
import type {
XcmVersionedAssetId,
XcmVersionedLocation,
XcmVersionedXcm
} from "@polkadot/types/lookup";
import type { IExtrinsic, Observable } from "@polkadot/types/types";
import type {
BackupStorageProvider,
Expand Down Expand Up @@ -276,6 +281,28 @@ declare module "@polkadot/api-base/types/calls" {
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x9ffb505aa738d69c/1 */
locationToAccountApi: {
/**
* Converts `Location` to `AccountId`
**/
convertLocation: AugmentedCall<
ApiType,
(
location:
| XcmVersionedLocation
| { V2: any }
| { V3: any }
| { V4: any }
| string
| Uint8Array
) => Observable<Result<AccountId, Error>>
>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x37e397fc7c91f5e4/2 */
metadata: {
/**
Expand Down
2 changes: 1 addition & 1 deletion api-augment/src/interfaces/augment-api-tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2650,7 +2650,7 @@ declare module "@polkadot/api-base/types/submittable" {
* - `assets`: The assets to be withdrawn. This should include the assets used to pay the
* fee on the `dest` (and possibly reserve) chains.
* - `assets_transfer_type`: The XCM `TransferType` used to transfer the `assets`.
* - `remote_fees_id`: One of the included `assets` to be be used to pay fees.
* - `remote_fees_id`: One of the included `assets` to be used to pay fees.
* - `fees_transfer_type`: The XCM `TransferType` used to transfer the `fees` assets.
* - `custom_xcm_on_dest`: The XCM to be executed on `dest` chain as the last step of the
* transfer, which also determines what happens to the assets on the destination chain.
Expand Down
4 changes: 2 additions & 2 deletions api-augment/src/interfaces/lookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2490,9 +2490,9 @@ export default {
_enum: ["PaymentStreamDeposit"]
},
/**
* Lookup270: pallet_balances::types::IdAmount<Id, Balance>
* Lookup270: frame_support::traits::tokens::misc::IdAmount<Id, Balance>
**/
PalletBalancesIdAmount: {
FrameSupportTokensMiscIdAmount: {
id: "Null",
amount: "u128"
},
Expand Down
4 changes: 2 additions & 2 deletions api-augment/src/interfaces/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import type {
FrameSupportDispatchPerDispatchClassWeightsPerClass,
FrameSupportMessagesProcessMessageError,
FrameSupportTokensMiscBalanceStatus,
FrameSupportTokensMiscIdAmount,
FrameSystemAccountInfo,
FrameSystemCall,
FrameSystemCodeUpgradeAuthorization,
Expand All @@ -59,7 +60,6 @@ import type {
PalletBalancesCall,
PalletBalancesError,
PalletBalancesEvent,
PalletBalancesIdAmount,
PalletBalancesReasons,
PalletBalancesReserveData,
PalletBucketNftsCall,
Expand Down Expand Up @@ -306,6 +306,7 @@ declare module "@polkadot/types/types/registry" {
FrameSupportDispatchPerDispatchClassWeightsPerClass: FrameSupportDispatchPerDispatchClassWeightsPerClass;
FrameSupportMessagesProcessMessageError: FrameSupportMessagesProcessMessageError;
FrameSupportTokensMiscBalanceStatus: FrameSupportTokensMiscBalanceStatus;
FrameSupportTokensMiscIdAmount: FrameSupportTokensMiscIdAmount;
FrameSystemAccountInfo: FrameSystemAccountInfo;
FrameSystemCall: FrameSystemCall;
FrameSystemCodeUpgradeAuthorization: FrameSystemCodeUpgradeAuthorization;
Expand All @@ -329,7 +330,6 @@ declare module "@polkadot/types/types/registry" {
PalletBalancesCall: PalletBalancesCall;
PalletBalancesError: PalletBalancesError;
PalletBalancesEvent: PalletBalancesEvent;
PalletBalancesIdAmount: PalletBalancesIdAmount;
PalletBalancesReasons: PalletBalancesReasons;
PalletBalancesReserveData: PalletBalancesReserveData;
PalletBucketNftsCall: PalletBucketNftsCall;
Expand Down
4 changes: 2 additions & 2 deletions api-augment/src/interfaces/types-lookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3075,8 +3075,8 @@ declare module "@polkadot/types/lookup" {
readonly type: "PaymentStreamDeposit";
}

/** @name PalletBalancesIdAmount (270) */
interface PalletBalancesIdAmount extends Struct {
/** @name FrameSupportTokensMiscIdAmount (270) */
interface FrameSupportTokensMiscIdAmount extends Struct {
readonly id: Null;
readonly amount: u128;
}
Expand Down
2 changes: 1 addition & 1 deletion api-augment/storagehub.json

Large diffs are not rendered by default.

52 changes: 35 additions & 17 deletions pallets/bucket-nfts/src/mock.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use core::marker::PhantomData;
use frame_support::{
construct_runtime, derive_impl, parameter_types,
derive_impl, parameter_types,
traits::{AsEnsureOriginWithArg, Everything, Randomness},
weights::constants::RocksDbWeight,
BoundedBTreeSet,
};
use frame_system as system;
use frame_system::pallet_prelude::BlockNumberFor;
use num_bigint::BigUint;
use pallet_nfts::PalletFeatures;
use shp_file_metadata::{ChunkId, FileMetadata};
Expand All @@ -21,7 +21,6 @@ use sp_runtime::{
};
use sp_std::collections::btree_set::BTreeSet;
use sp_trie::{LayoutV1, TrieConfiguration, TrieLayout};
use system::pallet_prelude::BlockNumberFor;

type Block = frame_system::mocking::MockBlock<Test>;
pub(crate) type BlockNumber = u64;
Expand Down Expand Up @@ -57,18 +56,37 @@ impl Randomness<H256, BlockNumber> for MockRandomness {
}

// Configure a mock runtime to test the pallet.
construct_runtime!(
pub enum Test
{
System: frame_system::{Pallet, Call, Config<T>, Storage, Event<T>},
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
Providers: pallet_storage_providers::{Pallet, Call, Storage, Event<T>, HoldReason},
BucketNfts: crate::{Pallet, Call, Storage, Event<T>},
Nfts: pallet_nfts::{Pallet, Call, Storage, Event<T>},
FileSystem: pallet_file_system::{Pallet, Call, Storage, Event<T>},
PaymentStreams: pallet_payment_streams::{Pallet, Call, Storage, Event<T>, HoldReason},
}
);
#[frame_support::runtime]
mod test_runtime {
#[runtime::runtime]
#[runtime::derive(
RuntimeCall,
RuntimeEvent,
RuntimeError,
RuntimeOrigin,
RuntimeFreezeReason,
RuntimeHoldReason,
RuntimeSlashReason,
RuntimeLockId,
RuntimeTask
)]
pub struct Test;

#[runtime::pallet_index(0)]
pub type System = frame_system;
#[runtime::pallet_index(1)]
pub type Balances = pallet_balances;
#[runtime::pallet_index(2)]
pub type Providers = pallet_storage_providers;
#[runtime::pallet_index(3)]
pub type BucketNfts = crate;
#[runtime::pallet_index(4)]
pub type Nfts = pallet_nfts;
#[runtime::pallet_index(5)]
pub type FileSystem = pallet_file_system;
#[runtime::pallet_index(6)]
pub type PaymentStreams = pallet_payment_streams;
}

parameter_types! {
pub const BlockHashCount: u64 = 250;
Expand All @@ -77,7 +95,7 @@ parameter_types! {
}

#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl system::Config for Test {
impl frame_system::Config for Test {
type BaseCallFilter = Everything;
type BlockWeights = ();
type BlockLength = ();
Expand Down Expand Up @@ -388,7 +406,7 @@ impl crate::Config for Test {

// Build genesis storage according to the mock runtime.
pub fn new_test_ext() -> sp_io::TestExternalities {
let mut t = system::GenesisConfig::<Test>::default()
let mut t = frame_system::GenesisConfig::<Test>::default()
.build_storage()
.unwrap();

Expand Down
Loading
Loading