From 24c8375882782d7126e1414a208469c0817d6532 Mon Sep 17 00:00:00 2001 From: wangjj9219 <183318287@qq.com> Date: Thu, 12 Oct 2023 21:46:11 +0800 Subject: [PATCH 1/2] update polkadot v1.1.0 --- lib/stable-asset/Cargo.toml | 32 ++++++++++++++++---------------- lib/stable-asset/src/lib.rs | 9 +++++---- lib/stable-asset/src/mock.rs | 4 ++-- lib/stable-asset/src/tests.rs | 5 ++--- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/lib/stable-asset/Cargo.toml b/lib/stable-asset/Cargo.toml index 2ead4d2..9bf0a2e 100644 --- a/lib/stable-asset/Cargo.toml +++ b/lib/stable-asset/Cargo.toml @@ -17,45 +17,45 @@ scale-info = { version = "2.9.0", default-features = false, features = ["derive" [dependencies.frame-support] default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v1.0.0" +git = "https://github.com/paritytech/polkadot-sdk" +branch = "release-polkadot-v1.1.0" [dependencies.frame-system] default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v1.0.0" +git = "https://github.com/paritytech/polkadot-sdk" +branch = "release-polkadot-v1.1.0" [dependencies.sp-core] default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v1.0.0" +git = "https://github.com/paritytech/polkadot-sdk" +branch = "release-polkadot-v1.1.0" [dev-dependencies] serde = { version = "1.0.101" } [dev-dependencies.sp-core] default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v1.0.0" +git = "https://github.com/paritytech/polkadot-sdk" +branch = "release-polkadot-v1.1.0" [dev-dependencies.sp-io] default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v1.0.0" +git = "https://github.com/paritytech/polkadot-sdk" +branch = "release-polkadot-v1.1.0" [dependencies.sp-std] default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v1.0.0" +git = "https://github.com/paritytech/polkadot-sdk" +branch = "release-polkadot-v1.1.0" [dependencies.sp-runtime] default-features = false -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v1.0.0" +git = "https://github.com/paritytech/polkadot-sdk" +branch = "release-polkadot-v1.1.0" [dev-dependencies.pallet-balances] -git = "https://github.com/paritytech/substrate" -branch = "polkadot-v1.0.0" +git = "https://github.com/paritytech/polkadot-sdk" +branch = "release-polkadot-v1.1.0" [features] default = ["std"] diff --git a/lib/stable-asset/src/lib.rs b/lib/stable-asset/src/lib.rs index 68ae54e..56e7c27 100644 --- a/lib/stable-asset/src/lib.rs +++ b/lib/stable-asset/src/lib.rs @@ -32,9 +32,9 @@ mod tests; pub mod weights; use crate::traits::StableAsset; +use codec::{Decode, Encode}; use frame_support::{ - codec::{Decode, Encode}, - dispatch::{DispatchError, DispatchResult}, + dispatch::DispatchResult, ensure, traits::{ fungibles::{Inspect, Mutate}, @@ -48,7 +48,7 @@ use scale_info::TypeInfo; use sp_core::U512; use sp_runtime::{ traits::{AccountIdConversion, CheckedAdd, CheckedDiv, CheckedMul, CheckedSub, One, Zero}, - SaturatedConversion, + DispatchError, SaturatedConversion, }; use sp_std::prelude::*; @@ -301,9 +301,10 @@ pub mod pallet { use super::{PoolTokenIndex, StableAssetPoolId, StableAssetPoolInfo}; use crate::traits::{StableAsset, ValidateAssetId}; use crate::WeightInfo; + use codec::Codec; use frame_support::traits::tokens::fungibles; use frame_support::{ - dispatch::{Codec, DispatchResult}, + dispatch::DispatchResult, pallet_prelude::*, traits::EnsureOrigin, PalletId, diff --git a/lib/stable-asset/src/mock.rs b/lib/stable-asset/src/mock.rs index 02beb24..acab66c 100644 --- a/lib/stable-asset/src/mock.rs +++ b/lib/stable-asset/src/mock.rs @@ -17,7 +17,7 @@ use crate as stable_asset; use frame_support::{ - dispatch::{DispatchError, DispatchResult}, + dispatch::DispatchResult, parameter_types, traits::{ fungibles::{Dust, Inspect, Mutate, Unbalanced}, @@ -30,7 +30,7 @@ use frame_system::RawOrigin; use sp_core::H256; use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, - BuildStorage, + BuildStorage, DispatchError, }; type Block = frame_system::mocking::MockBlock; diff --git a/lib/stable-asset/src/tests.rs b/lib/stable-asset/src/tests.rs index 9409cac..813db2e 100644 --- a/lib/stable-asset/src/tests.rs +++ b/lib/stable-asset/src/tests.rs @@ -19,9 +19,8 @@ use crate::{ mock::*, Error, MintResult, RedeemMultiResult, RedeemProportionResult, RedeemSingleResult, StableAssetPoolInfo, SwapResult, }; -use frame_support::assert_noop; -use frame_support::assert_ok; -use frame_support::dispatch::DispatchError; +use frame_support::{assert_noop, assert_ok}; +use sp_runtime::DispatchError; use frame_support::traits::fungibles::{Inspect, Mutate}; pub const BALANCE_OFF: u128 = 1; From d6f16cd03da9d2321636d15f09a879ae8d241401 Mon Sep 17 00:00:00 2001 From: wangjj9219 <183318287@qq.com> Date: Thu, 12 Oct 2023 22:10:53 +0800 Subject: [PATCH 2/2] format --- lib/stable-asset/src/lib.rs | 7 +------ lib/stable-asset/src/tests.rs | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/stable-asset/src/lib.rs b/lib/stable-asset/src/lib.rs index 56e7c27..84d1c2b 100644 --- a/lib/stable-asset/src/lib.rs +++ b/lib/stable-asset/src/lib.rs @@ -303,12 +303,7 @@ pub mod pallet { use crate::WeightInfo; use codec::Codec; use frame_support::traits::tokens::fungibles; - use frame_support::{ - dispatch::DispatchResult, - pallet_prelude::*, - traits::EnsureOrigin, - PalletId, - }; + use frame_support::{dispatch::DispatchResult, pallet_prelude::*, traits::EnsureOrigin, PalletId}; use frame_system::pallet_prelude::*; use sp_runtime::{ traits::{CheckedAdd, CheckedDiv, CheckedMul, CheckedSub, One, Zero}, diff --git a/lib/stable-asset/src/tests.rs b/lib/stable-asset/src/tests.rs index 813db2e..96095b5 100644 --- a/lib/stable-asset/src/tests.rs +++ b/lib/stable-asset/src/tests.rs @@ -19,9 +19,9 @@ use crate::{ mock::*, Error, MintResult, RedeemMultiResult, RedeemProportionResult, RedeemSingleResult, StableAssetPoolInfo, SwapResult, }; +use frame_support::traits::fungibles::{Inspect, Mutate}; use frame_support::{assert_noop, assert_ok}; use sp_runtime::DispatchError; -use frame_support::traits::fungibles::{Inspect, Mutate}; pub const BALANCE_OFF: u128 = 1;