Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into add-existence-requi…
Browse files Browse the repository at this point in the history
…rement
  • Loading branch information
zjb0807 committed Jan 8, 2025
2 parents 6f59368 + 286c731 commit ce76f2e
Show file tree
Hide file tree
Showing 32 changed files with 126 additions and 102 deletions.
1 change: 0 additions & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ jobs:
tar -zxvf cargo-tarpaulin-x86_64-unknown-linux-musl.tar.gz -C $HOME/.cargo/bin
make Cargo.toml
cargo update
cargo update -p frame-support-procedural --precise 30.0.2
cargo tarpaulin --verbose --no-fail-fast --workspace --timeout 300 --out Xml
- name: Upload to codecov.io
uses: codecov/codecov-action@v3
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ jobs:
- name: Install clippy
run: rustup component add clippy
- name: Update
run: |
cargo update
cargo update -p frame-support-procedural --precise 30.0.2
run: cargo update
- name: Run clippy
run: cargo clippy -- -D warnings
- name: Check for Wasm
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/zepter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ jobs:
- name: Install Zepter
run: cargo install zepter --version 0.15.0 --locked -q -f --no-default-features && zepter --version
- run: make Cargo.toml
- run: |
cargo update
cargo update -p frame-support-procedural --precise 30.0.2
- run: cargo update
- name: Check Rust features
run: make dev-features-check
44 changes: 22 additions & 22 deletions Cargo.dev.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,35 +37,35 @@ scale-info = { version = "2.10.0", default-features = false, features = ["derive
serde = { version = "1.0.189" }
parity-scale-codec = { version = "3.6.5", default-features = false, features = ["max-encoded-len"] }

cumulus-pallet-xcm = { version = "0.16.0", default-features = false }
cumulus-primitives-core = { version = "0.15.0", default-features = false }
frame-benchmarking = { version = "37.0.0", default-features = false }
frame-support = { version = "37.0.0", default-features = false }
frame-system = { version = "37.0.0", default-features = false }
pallet-balances = { version = "38.0.0", default-features = false }
pallet-elections-phragmen = { version = "38.0.0", default-features = false }
pallet-message-queue = { version = "40.0.0", default-features = false }
pallet-preimage = { version = "37.0.0", default-features = false }
pallet-root-testing = { version = "13.0.0", default-features = false }
pallet-scheduler = { version = "38.0.0", default-features = false }
pallet-timestamp = { version = "36.0.0", default-features = false }
pallet-treasury = { version = "36.0.0", default-features = false }
pallet-xcm = { version = "16.0.0", default-features = false }
cumulus-pallet-xcm = { version = "0.17.0", default-features = false }
cumulus-primitives-core = { version = "0.16.0", default-features = false }
frame-benchmarking = { version = "38.0.0", default-features = false }
frame-support = { version = "38.0.0", default-features = false }
frame-system = { version = "38.0.0", default-features = false }
pallet-balances = { version = "39.0.0", default-features = false }
pallet-elections-phragmen = { version = "39.0.0", default-features = false }
pallet-message-queue = { version = "41.0.1", default-features = false }
pallet-preimage = { version = "38.0.0", default-features = false }
pallet-root-testing = { version = "14.0.0", default-features = false }
pallet-scheduler = { version = "39.0.0", default-features = false }
pallet-timestamp = { version = "37.0.0", default-features = false }
pallet-treasury = { version = "37.0.0", default-features = false }
pallet-xcm = { version = "17.0.0", default-features = false }
polkadot-parachain-primitives = { version = "14.0.0", default-features = false }
polkadot-runtime-common = { version = "16.0.0", default-features = false }
polkadot-runtime-parachains = { version = "16.0.0", default-features = false }
polkadot-runtime-common = { version = "17.0.0", default-features = false }
polkadot-runtime-parachains = { version = "17.0.1", default-features = false }
sp-api = { version = "34.0.0", default-features = false }
sp-application-crypto = { version = "38.0.0", default-features = false }
sp-arithmetic = { version = "26.0.0", default-features = false }
sp-core = { version = "34.0.0", default-features = false }
sp-io = { version = "38.0.0", default-features = false }
sp-runtime = { version = "39.0.0", default-features = false }
sp-runtime = { version = "39.0.1", default-features = false }
sp-runtime-interface = { version = "28.0.0", default-features = false }
sp-staking = { version = "34.0.0", default-features = false }
sp-staking = { version = "36.0.0", default-features = false }
sp-std = { version = "14.0.0", default-features = false }
sp-storage = { version = "21.0.0", default-features = false }
xcm = { version = "14.1.0", package = "staging-xcm", default-features = false }
xcm-builder = { version = "16.0.0", package = "staging-xcm-builder", default-features = false }
xcm-executor = { version = "16.0.0", package = "staging-xcm-executor", default-features = false }
xcm = { version = "14.2.0", package = "staging-xcm", default-features = false }
xcm-builder = { version = "17.0.1", package = "staging-xcm-builder", default-features = false }
xcm-executor = { version = "17.0.0", package = "staging-xcm-executor", default-features = false }

xcm-simulator = { version = "16.0.0" }
xcm-simulator = { version = "17.0.0" }
4 changes: 2 additions & 2 deletions asset-registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "orml-asset-registry"
description = "Registry for (foreign) assets"
repository = "https://github.com/open-web3-stack/open-runtime-module-library/tree/master/asset-registry"
license = "Apache-2.0"
version = "1.0.0"
version = "1.1.0"
authors = ["Interlay Ltd, etc"]
edition = "2021"

Expand All @@ -27,7 +27,7 @@ xcm-builder = { workspace = true }
xcm-executor = { workspace = true }

# orml
orml-traits = { path = "../traits", version = "1.0.0", default-features = false }
orml-traits = { path = "../traits", version = "1.1.0", default-features = false }

# for runtime-benchmarks
polkadot-runtime-common = { workspace = true, optional = true }
Expand Down
4 changes: 2 additions & 2 deletions auction/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "orml-auction"
description = "Auction module that implements `Auction` trait."
repository = "https://github.com/open-web3-stack/open-runtime-module-library/tree/master/auction"
license = "Apache-2.0"
version = "1.0.0"
version = "1.1.0"
authors = ["Acala Developers"]
edition = "2021"

Expand All @@ -17,7 +17,7 @@ frame-system = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }

orml-traits = { path = "../traits", version = "1.0.0", default-features = false }
orml-traits = { path = "../traits", version = "1.1.0", default-features = false }

[dev-dependencies]
sp-core = { workspace = true, features = ["std"] }
Expand Down
2 changes: 1 addition & 1 deletion authority/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "orml-authority"
description = "Utility pallet to perform ROOT calls in a PoA network"
repository = "https://github.com/open-web3-stack/open-runtime-module-library/tree/master/auction"
license = "Apache-2.0"
version = "1.0.0"
version = "1.1.0"
authors = ["Acala Developers"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion benchmarking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "orml-benchmarking"
description = "Provide macro to benchmark Substrate runtime."
repository = "https://github.com/open-web3-stack/open-runtime-module-library/tree/master/benchmarking"
license = "Apache-2.0"
version = "1.0.0"
version = "1.1.0"
authors = ["Laminar Developers <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion build-script-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "orml-build-script-utils"
description = "Crate with utility functions for `build.rs` scripts."
repository = "https://github.com/open-web3-stack/open-runtime-module-library/tree/master/build-script-utils"
license = "Apache-2.0"
version = "1.0.0"
version = "1.1.0"
authors = ["Parity Technologies <[email protected]>", "Laminar Developers <[email protected]>"]
edition = "2021"

Expand Down
6 changes: 3 additions & 3 deletions currencies/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "orml-currencies"
description = "Provide `MultiCurrency` implementation using `pallet-balances` and `orml-tokens` module."
repository = "https://github.com/open-web3-stack/open-runtime-module-library/tree/master/currencies"
license = "Apache-2.0"
version = "1.0.0"
version = "1.1.0"
authors = ["Laminar Developers <[email protected]>"]
edition = "2021"

Expand All @@ -18,8 +18,8 @@ sp-io = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }

orml-traits = { path = "../traits", version = "1.0.0", default-features = false }
orml-utilities = { path = "../utilities", version = "1.0.0", default-features = false }
orml-traits = { path = "../traits", version = "1.1.0", default-features = false }
orml-utilities = { path = "../utilities", version = "1.1.0", default-features = false }

[dev-dependencies]
pallet-balances = { workspace = true, features = ["std"] }
Expand Down
2 changes: 1 addition & 1 deletion gradually-update/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "orml-gradually-update"
description = "Provides way to adjust numeric parameter gradually over a period of time."
repository = "https://github.com/open-web3-stack/open-runtime-module-library/tree/master/gradually-update"
license = "Apache-2.0"
version = "1.0.0"
version = "1.1.0"
authors = ["Laminar Developers <[email protected]>"]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion nft/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "orml-nft"
description = "Non-fungible token pallet provides basic functions to create and manager NFT"
repository = "https://github.com/open-web3-stack/open-runtime-module-library/tree/master/nft"
license = "Apache-2.0"
version = "1.0.0"
version = "1.1.0"
authors = ["Acala Developers"]
edition = "2021"

Expand Down
6 changes: 3 additions & 3 deletions oracle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "orml-oracle"
description = "Oracle module that makes off-chain data available on-chain."
repository = "https://github.com/open-web3-stack/open-runtime-module-library/tree/master/oracle"
license = "Apache-2.0"
version = "1.0.0"
version = "1.1.0"
authors = ["Laminar Developers <[email protected]>"]
edition = "2021"

Expand All @@ -20,8 +20,8 @@ sp-runtime = { workspace = true }
sp-std = { workspace = true }
frame-benchmarking = { workspace = true, optional = true }

orml-traits = { path = "../traits", version = "1.0.0", default-features = false }
orml-utilities = { path = "../utilities", version = "1.0.0", default-features = false }
orml-traits = { path = "../traits", version = "1.1.0", default-features = false }
orml-utilities = { path = "../utilities", version = "1.1.0", default-features = false }

[dev-dependencies]
sp-core = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion oracle/runtime-api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "orml-oracle-runtime-api"
version = "1.0.0"
version = "1.1.0"
authors = ["Laminar Developers <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions parameters/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "orml-parameters"
description = "Offer a centra place to store and configure parameters."
repository = "https://github.com/open-web3-stack/open-runtime-module-library/tree/master/parameters"
license = "Apache-2.0"
version = "1.0.0"
version = "1.1.0"
authors = ["Acala Developers"]
edition = "2021"

Expand All @@ -18,7 +18,7 @@ sp-runtime = { workspace = true }
sp-core = { workspace = true }
sp-std = { workspace = true }

orml-traits = { path = "../traits", version = "1.0.0", default-features = false }
orml-traits = { path = "../traits", version = "1.1.0", default-features = false }

[dev-dependencies]
sp-core = { workspace = true, features = ["std"] }
Expand Down
4 changes: 2 additions & 2 deletions payments/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
authors = ["Virto Network <[email protected]>"]
edition = '2021'
name = "orml-payments"
version = "1.0.0"
version = "1.1.0"
license = "Apache-2.0"
homepage = "https://github.com/virto-network/virto-node"
repository = "https://github.com/virto-network/virto-node"
Expand All @@ -20,7 +20,7 @@ frame-system = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }

orml-traits = {path = "../traits", version = "1.0.0", default-features = false }
orml-traits = {path = "../traits", version = "1.1.0", default-features = false }

[dev-dependencies]
sp-core = { workspace = true }
Expand Down
6 changes: 3 additions & 3 deletions rate-limit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "orml-rate-limit"
description = "Provides way to config rate limiter for limit some operation."
repository = "https://github.com/open-web3-stack/open-runtime-module-library/tree/master/rate-limit"
license = "Apache-2.0"
version = "1.0.0"
version = "1.1.0"
authors = ["Laminar Developers <[email protected]>"]
edition = "2021"

Expand All @@ -19,8 +19,8 @@ sp-io = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }

orml-traits = { path = "../traits", version = "1.0.0", default-features = false }
orml-utilities = { path = "../utilities", version = "1.0.0", default-features = false }
orml-traits = { path = "../traits", version = "1.1.0", default-features = false }
orml-utilities = { path = "../utilities", version = "1.1.0", default-features = false }

[dev-dependencies]
pallet-timestamp = { workspace = true, features = ["std"] }
Expand Down
4 changes: 2 additions & 2 deletions rewards/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "orml-rewards"
description = "Store and manage shares and rewards"
repository = "https://github.com/open-web3-stack/open-runtime-module-library/tree/master/rewards"
license = "Apache-2.0"
version = "1.0.0"
version = "1.1.0"
authors = ["Acala Developers"]
edition = "2021"

Expand All @@ -19,7 +19,7 @@ sp-io = { workspace = true }
sp-runtime = { workspace = true, features = ["serde"] }
sp-std = { workspace = true }

orml-traits = { path = "../traits", version = "1.0.0", default-features = false }
orml-traits = { path = "../traits", version = "1.1.0", default-features = false }

[dev-dependencies]
sp-core = { workspace = true, features = ["std"] }
Expand Down
4 changes: 2 additions & 2 deletions tokens/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "orml-tokens"
description = "Fungible tokens module that implements `MultiCurrency` trait."
repository = "https://github.com/open-web3-stack/open-runtime-module-library/tree/master/tokens"
license = "Apache-2.0"
version = "1.0.0"
version = "1.1.0"
authors = ["Laminar Developers <[email protected]>"]
edition = "2021"

Expand All @@ -19,7 +19,7 @@ sp-arithmetic = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }

orml-traits = { path = "../traits", version = "1.0.0", default-features = false }
orml-traits = { path = "../traits", version = "1.1.0", default-features = false }

[dev-dependencies]
pallet-elections-phragmen = { workspace = true, features = ["std"] }
Expand Down
2 changes: 1 addition & 1 deletion tokens/runtime-api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "orml-tokens-runtime-api"
version = "1.0.0"
version = "1.1.0"
authors = ["Laminar Developers <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand Down
13 changes: 12 additions & 1 deletion tokens/src/imbalances.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// wrapping these imbalances in a private module is necessary to ensure absolute
// privacy of the inner member.
use crate::{Config, TotalIssuance};
use frame_support::traits::{Get, Imbalance, SameOrOther, TryDrop};
use frame_support::traits::{tokens::imbalance::TryMerge, Get, Imbalance, SameOrOther, TryDrop};
use sp_runtime::traits::{Saturating, Zero};
use sp_std::{marker, mem, result};

Expand Down Expand Up @@ -184,3 +184,14 @@ impl<T: Config, GetCurrencyId: Get<T::CurrencyId>> Drop for NegativeImbalance<T,
TotalIssuance::<T>::mutate(GetCurrencyId::get(), |v| *v = v.saturating_sub(self.0));
}
}

impl<T: Config, GetCurrencyId: Get<T::CurrencyId>> TryMerge for PositiveImbalance<T, GetCurrencyId> {
fn try_merge(self, other: Self) -> Result<Self, (Self, Self)> {
Ok(self.merge(other))
}
}
impl<T: Config, GetCurrencyId: Get<T::CurrencyId>> TryMerge for NegativeImbalance<T, GetCurrencyId> {
fn try_merge(self, other: Self) -> Result<Self, (Self, Self)> {
Ok(self.merge(other))
}
}
24 changes: 0 additions & 24 deletions tokens/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,30 +56,6 @@ thread_local! {
]);
}

pub struct TenToFourteen;
impl SortedMembers<AccountId> for TenToFourteen {
fn sorted_members() -> Vec<AccountId> {
TEN_TO_FOURTEEN.with(|v| v.borrow().clone())
}
#[cfg(feature = "runtime-benchmarks")]
fn add(new: &AccountId) {
TEN_TO_FOURTEEN.with(|v| {
let mut members = v.borrow_mut();
members.push(new.clone());
members.sort();
})
}
}

impl ContainsLengthBound for TenToFourteen {
fn max_len() -> usize {
TEN_TO_FOURTEEN.with(|v| v.borrow().len())
}
fn min_len() -> usize {
0
}
}

parameter_types! {
pub const ProposalBond: Permill = Permill::from_percent(5);
pub const Burn: Permill = Permill::from_percent(50);
Expand Down
4 changes: 2 additions & 2 deletions traits/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "orml-traits"
description = "Shared traits including `BasicCurrency`, `MultiCurrency`, `Auction` and more."
repository = "https://github.com/open-web3-stack/open-runtime-module-library/tree/master/traits"
license = "Apache-2.0"
version = "1.0.0"
version = "1.1.0"
authors = ["Laminar Developers <[email protected]>"]
edition = "2021"

Expand All @@ -23,7 +23,7 @@ frame-support = { workspace = true }

xcm = { workspace = true }

orml-utilities = { path = "../utilities", version = "1.0.0", default-features = false }
orml-utilities = { path = "../utilities", version = "1.1.0", default-features = false }

[features]
default = [ "std" ]
Expand Down
Loading

0 comments on commit ce76f2e

Please sign in to comment.