Skip to content

Commit

Permalink
update polkadot-v0.9.23 (#2183)
Browse files Browse the repository at this point in the history
* update polkadot-v0.9.23

* introduce weight_to_fee

* update deps

* companior orml#754

* fix tests

* fix testf

* fix benchmark

* fix constants test

* revert LengthToFee

* fix ts-tests

* update deps

* bring test back

* Update modules/transaction-payment/src/mock.rs

Co-authored-by: Shaun Wang <[email protected]>
  • Loading branch information
zqhxuyuan and shaunxw authored Jun 16, 2022
1 parent 483d6b8 commit fb31aac
Show file tree
Hide file tree
Showing 133 changed files with 1,828 additions and 1,770 deletions.
1,108 changes: 514 additions & 594 deletions Cargo.lock

Large diffs are not rendered by default.

388 changes: 194 additions & 194 deletions Cargo.toml

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions ecosystem-modules/compound-cash/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ edition = "2021"
serde = { version = "1.0.136", optional = true }
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
scale-info = { version = "2.1", default-features = false, features = ["derive"] }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
module-support = { path = "../../modules/support", default-features = false }
primitives = { package = "acala-primitives", path = "../../primitives", default-features = false }

[dev-dependencies]
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23" }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23" }

[features]
default = ["std"]
Expand Down
14 changes: 7 additions & 7 deletions ecosystem-modules/ren/renvm-bridge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ edition = "2021"
serde = { version = "1.0.136", optional = true }
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
scale-info = { version = "2.1", default-features = false, features = ["derive"] }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
support = { package = "module-support", path = "../../../modules/support", default-features = false }
orml-traits = { path = "../../../orml/traits", default-features = false }
primitives = { package = "acala-primitives", path = "../../../primitives", default-features = false }
Expand All @@ -22,7 +22,7 @@ primitives = { package = "acala-primitives", path = "../../../primitives", defau
hex-literal = "0.3.1"
orml-currencies = { path = "../../../orml/currencies" }
orml-tokens = { path = "../../../orml/tokens" }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23" }

[features]
default = ["std"]
Expand Down
2 changes: 2 additions & 0 deletions ecosystem-modules/ren/renvm-bridge/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ impl orml_tokens::Config for Runtime {
type MaxReserves = ();
type ReserveIdentifier = [u8; 8];
type DustRemovalWhitelist = Nothing;
type OnNewTokenAccount = ();
type OnKilledTokenAccount = ();
}

parameter_types! {
Expand Down
2 changes: 1 addition & 1 deletion ecosystem-modules/stable-asset
14 changes: 7 additions & 7 deletions ecosystem-modules/starport/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ edition = "2021"
[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
scale-info = { version = "2.1", default-features = false, features = ["derive"] }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
primitives = { package = "acala-primitives", path = "../../primitives", default-features = false }
orml-traits = { path = "../../orml/traits", default-features = false }
module-support = { path = "../../modules/support", default-features = false }

[dev-dependencies]
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23" }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23" }
module-currencies = { path = "../../modules/currencies" }
orml-tokens = { path = "../../orml/tokens"}

Expand Down
22 changes: 18 additions & 4 deletions ecosystem-modules/starport/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,12 @@ impl<T: Config> Pallet<T> {
// All other tokens are transferred to the admin's account.
match currency_id {
CurrencyId::Token(TokenSymbol::CASH) => T::Currency::withdraw(currency_id, &from, locked_amount),
_ => T::Currency::transfer(currency_id, &from, &T::PalletId::get().into_account(), locked_amount),
_ => T::Currency::transfer(
currency_id,
&from,
&T::PalletId::get().into_account_truncating(),
locked_amount,
),
}?;

// Fund locked. Now reduce the supply caps
Expand All @@ -399,11 +404,20 @@ impl<T: Config> Pallet<T> {
_ => {
// Ensure the admin has sufficient balance for the transfer
ensure!(
T::Currency::ensure_can_withdraw(currency_id, &T::PalletId::get().into_account(), unlock_amount)
.is_ok(),
T::Currency::ensure_can_withdraw(
currency_id,
&T::PalletId::get().into_account_truncating(),
unlock_amount
)
.is_ok(),
Error::<T>::InsufficientAssetToUnlock
);
T::Currency::transfer(currency_id, &T::PalletId::get().into_account(), &to, unlock_amount)
T::Currency::transfer(
currency_id,
&T::PalletId::get().into_account_truncating(),
&to,
unlock_amount,
)
}
}?;

Expand Down
2 changes: 2 additions & 0 deletions ecosystem-modules/starport/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ impl orml_tokens::Config for Runtime {
type MaxReserves = ();
type ReserveIdentifier = [u8; 8];
type DustRemovalWhitelist = Nothing;
type OnNewTokenAccount = ();
type OnKilledTokenAccount = ();
}

parameter_types! {
Expand Down
6 changes: 3 additions & 3 deletions ecosystem-modules/starport/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fn lock_works() {
// Locked ACALA are transferred from the user's account into Admin's account.
assert_eq!(Currencies::free_balance(ACALA, &ALICE), 0);
assert_eq!(
Currencies::free_balance(ACALA, &StarportPalletId::get().into_account()),
Currencies::free_balance(ACALA, &StarportPalletId::get().into_account_truncating()),
INITIAL_BALANCE
);

Expand All @@ -73,7 +73,7 @@ fn lock_works() {
// Locked ACALA are transferred from the user's account into Admin's account.
assert_eq!(Currencies::free_balance(CASH, &ALICE), 0);
assert_eq!(
Currencies::free_balance(CASH, &StarportPalletId::get().into_account()),
Currencies::free_balance(CASH, &StarportPalletId::get().into_account_truncating()),
0
);

Expand Down Expand Up @@ -104,7 +104,7 @@ fn lock_to_works() {
// Locked ACALA are transferred from the user's account into Admin's account.
assert_eq!(Currencies::free_balance(ACALA, &ALICE), 0);
assert_eq!(
Currencies::free_balance(ACALA, &StarportPalletId::get().into_account()),
Currencies::free_balance(ACALA, &StarportPalletId::get().into_account_truncating()),
INITIAL_BALANCE
);
// Supply caps are reduced accordingly.
Expand Down
2 changes: 1 addition & 1 deletion evm-tests
12 changes: 6 additions & 6 deletions inspect/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ codec = { package = "parity-scale-codec", version = "3.0.0" }
clap = { version = "3.1.6", features = ["derive"] }
derive_more = "0.99"
log = "0.4.17"
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23" }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23" }
17 changes: 9 additions & 8 deletions modules/aggregated-dex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ edition = "2021"
serde = { version = "1.0.136", optional = true }
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["max-encoded-len"] }
scale-info = { version = "2.1", default-features = false, features = ["derive"] }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
orml-traits = { path = "../../orml/traits", default-features = false }
support = { package = "module-support", path = "../support", default-features = false }
primitives = { package = "acala-primitives", path = "../../primitives", default-features = false }
Expand All @@ -21,9 +21,10 @@ module-dex = { package = "module-dex", path = "../dex", default-features = false
orml-tokens = { path = "../../orml/tokens", default-features = false }

[dev-dependencies]
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
orml-tokens = { path = "../../orml/tokens" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23" }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23" }

[features]
default = ["std"]
Expand Down
2 changes: 2 additions & 0 deletions modules/aggregated-dex/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ impl orml_tokens::Config for Runtime {
type MaxReserves = ();
type ReserveIdentifier = [u8; 8];
type DustRemovalWhitelist = Nothing;
type OnNewTokenAccount = ();
type OnKilledTokenAccount = ();
}

ord_parameter_types! {
Expand Down
18 changes: 9 additions & 9 deletions modules/asset-registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ log = { version = "0.4.17", default-features = false }
serde = { version = "1.0.136", optional = true }
scale-info = { version = "2.1", default-features = false, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
primitives = { package = "acala-primitives", path = "../../primitives", default-features = false }

xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.22", default-features = false }
xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.23", default-features = false }

module-support = { path = "../support", default-features = false }

[dev-dependencies]
serde_json = "1.0.68"
hex = "0.4"
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23" }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23" }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23" }

module-evm = { path = "../evm" }
module-evm-bridge = { path = "../evm-bridge" }
Expand Down
14 changes: 7 additions & 7 deletions modules/auction-manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ edition = "2021"
serde = { version = "1.0.136", optional = true }
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
scale-info = { version = "2.1", default-features = false, features = ["derive"] }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
orml-traits = { path = "../../orml/traits", default-features = false }
orml-utilities = { path = "../../orml/utilities", default-features = false }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22", default-features = false }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
support = { package = "module-support", path = "../support", default-features = false }
primitives = { package = "acala-primitives", path = "../../primitives", default-features = false }

[dev-dependencies]
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23" }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23" }
orml-auction = { path = "../../orml/auction" }
cdp-treasury = { package = "module-cdp-treasury", path = "../cdp-treasury" }
module-dex = { path = "../dex" }
Expand Down
4 changes: 3 additions & 1 deletion modules/auction-manager/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ impl orml_tokens::Config for Runtime {
type MaxReserves = ();
type ReserveIdentifier = [u8; 8];
type DustRemovalWhitelist = Nothing;
type OnNewTokenAccount = ();
type OnKilledTokenAccount = ();
}

impl orml_auction::Config for Runtime {
Expand All @@ -117,7 +119,7 @@ parameter_types! {
pub const GetStableCurrencyId: CurrencyId = AUSD;
pub const MaxAuctionsCount: u32 = 10_000;
pub const CDPTreasuryPalletId: PalletId = PalletId(*b"aca/cdpt");
pub TreasuryAccount: AccountId = PalletId(*b"aca/hztr").into_account();
pub TreasuryAccount: AccountId = PalletId(*b"aca/hztr").into_account_truncating();
pub AlternativeSwapPathJointList: Vec<Vec<CurrencyId>> = vec![
vec![DOT],
];
Expand Down
Loading

0 comments on commit fb31aac

Please sign in to comment.