diff --git a/Cargo.lock b/Cargo.lock index 7da1980773..d381131636 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2334,8 +2334,10 @@ version = "0.8.0" dependencies = [ "bifrost-bancor", "bifrost-bancor-runtime-api", + "bifrost-call-switchgear", "bifrost-flexible-fee", "bifrost-flexible-fee-rpc-runtime-api", + "bifrost-lightening-redeem", "bifrost-liquidity-mining", "bifrost-minter-reward", "bifrost-runtime-common", @@ -2343,6 +2345,7 @@ dependencies = [ "bifrost-salp-lite", "bifrost-salp-lite-rpc-runtime-api", "bifrost-salp-rpc-runtime-api", + "bifrost-token-issuer", "bifrost-vesting", "bifrost-vsbond-auction", "bifrost-vtoken-mint", diff --git a/Makefile b/Makefile index df1aad7bac..235ecb3510 100644 --- a/Makefile +++ b/Makefile @@ -125,12 +125,8 @@ deploy-bifrost-live: pm2 deploy scripts/bifrost-ecosystem.config.js production # Run dev chain -.PHONY: run-dev -run-dev: - RUST_LOG=debug cargo run -p node-cli --locked --features "with-dev-runtime" -- --tmp --dev - .PHONY: run-dev-manual-seal -run-dev-manual-seal: +run-dev: RUST_LOG=debug cargo run -p node-cli --locked --features "with-dev-runtime" -- --tmp --dev --sealing instant --rpc-cors all --unsafe-ws-external # Build docker image diff --git a/README.md b/README.md index 8a4bfcb555..09c2ef3819 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ make try-bifrost-runtime-upgrade ## Run development chain ```bash -RUST_LOG=debug cargo run -p node-cli --locked --features "with-dev-runtime" -- --tmp --dev +make run-dev ``` ## Run local testnet with polkadot-launch diff --git a/integration-tests/src/integration_tests.rs b/integration-tests/src/integration_tests.rs index e591b42f21..4263a46288 100644 --- a/integration-tests/src/integration_tests.rs +++ b/integration-tests/src/integration_tests.rs @@ -144,6 +144,12 @@ impl ExtBuilder { ) .unwrap(); + >::assimilate_storage( + &pallet_xcm::GenesisConfig { safe_xcm_version: Some(2) }, + &mut t, + ) + .unwrap(); + let mut ext = sp_io::TestExternalities::new(t); ext.execute_with(|| System::set_block_number(1)); ext diff --git a/integration-tests/src/kusama_cross_chain_transact.rs b/integration-tests/src/kusama_cross_chain_transact.rs new file mode 100644 index 0000000000..5d39e186cf --- /dev/null +++ b/integration-tests/src/kusama_cross_chain_transact.rs @@ -0,0 +1,56 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2021 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use frame_support::assert_ok; +use xcm::latest::prelude::*; +use xcm_emulator::TestExt; + +use crate::{integration_tests::*, kusama_test_net::*}; + +#[test] +fn relaychain_transact_works() { + let remark = kusama_runtime::Call::System( + frame_system::Call::::remark_with_event { + remark: "Hello from Bifrost!".as_bytes().to_vec(), + }, + ); + + let asset: MultiAsset = + MultiAsset { id: Concrete(MultiLocation::here()), fun: Fungible(8000000000) }; + + let msg = Xcm(vec![ + WithdrawAsset(asset.clone().into()), + BuyExecution { fees: asset, weight_limit: WeightLimit::Limited(6000000000) }, + Transact { + origin_type: OriginKind::SovereignAccount, + require_weight_at_most: 2000000000 as u64, + call: remark.encode().into(), + }, + ]); + + Bifrost::execute_with(|| { + assert_ok!(pallet_xcm::Pallet::::send_xcm(Here, Parent, msg)); + }); + + KusamaNet::execute_with(|| { + use kusama_runtime::{Event, System}; + assert!(System::events() + .iter() + .any(|r| matches!(r.event, Event::System(frame_system::Event::Remarked(_, _))))); + }); +} diff --git a/integration-tests/src/lib.rs b/integration-tests/src/lib.rs index 8bb8327c5a..2bc50930f1 100644 --- a/integration-tests/src/lib.rs +++ b/integration-tests/src/lib.rs @@ -20,6 +20,8 @@ #[cfg(feature = "with-asgard-runtime")] mod integration_tests; #[cfg(feature = "with-asgard-runtime")] +mod kusama_cross_chain_transact; +#[cfg(feature = "with-asgard-runtime")] mod kusama_cross_chain_transfer; #[cfg(feature = "with-asgard-runtime")] mod kusama_test_net; diff --git a/runtime/dev/Cargo.toml b/runtime/dev/Cargo.toml index e1413002a0..5b505780e5 100644 --- a/runtime/dev/Cargo.toml +++ b/runtime/dev/Cargo.toml @@ -97,6 +97,9 @@ bifrost-vtoken-mint = { path = "../../pallets/vtoken-mint", default-features = f pallet-vesting = { package = "bifrost-vesting", path = "../../pallets/vesting", default-features = false } xcm-support = { path = "../../xcm-support", default-features = false } bifrost-liquidity-mining = { path = "../../pallets/liquidity-mining", default-features = false } +bifrost-token-issuer = { path = "../../pallets/token-issuer", default-features = false } +bifrost-lightening-redeem= { path = "../../pallets/lightening-redeem", default-features = false } +bifrost-call-switchgear= { path = "../../pallets/call-switchgear", default-features = false } # orml orml-currencies = { version = "0.4.1-dev", default-features = false } orml-tokens = { version = "0.4.1-dev", default-features = false } @@ -172,6 +175,14 @@ std = [ "xcm-builder/std", "xcm-executor/std", "polkadot-runtime-parachains/std", + "orml-currencies/std", + "orml-traits/std", + "orml-tokens/std", + "orml-xtokens/std", + "orml-xcm/std", + "orml-xcm-support/std", + "zenlink-protocol/std", + "zenlink-protocol-runtime-api/std", "bifrost-bancor/std", "bifrost-bancor-runtime-api/std", "bifrost-flexible-fee/std", @@ -184,16 +195,11 @@ std = [ "bifrost-salp-lite-rpc-runtime-api/std", "bifrost-vsbond-auction/std", "bifrost-vtoken-mint/std", + "bifrost-token-issuer/std", + "bifrost-lightening-redeem/std", "xcm-support/std", - "orml-currencies/std", - "orml-traits/std", - "orml-tokens/std", - "orml-xtokens/std", - "orml-xcm/std", - "orml-xcm-support/std", - "zenlink-protocol/std", - "zenlink-protocol-runtime-api/std", "bifrost-liquidity-mining/std", + "bifrost-call-switchgear/std", ] runtime-benchmarks = [ diff --git a/runtime/dev/src/lib.rs b/runtime/dev/src/lib.rs index 614c01f545..903aef5f50 100644 --- a/runtime/dev/src/lib.rs +++ b/runtime/dev/src/lib.rs @@ -140,8 +140,8 @@ impl_opaque_keys! { /// This runtime version. #[sp_version::runtime_version] pub const VERSION: RuntimeVersion = RuntimeVersion { - spec_name: create_runtime_str!("asgard-dev"), - impl_name: create_runtime_str!("asgard-dev"), + spec_name: create_runtime_str!("bifrost-dev"), + impl_name: create_runtime_str!("bifrost-dev"), authoring_version: 1, spec_version: 1001, impl_version: 0, @@ -191,12 +191,19 @@ parameter_types! { } parameter_types! { - pub const NativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::ASG); + pub const NativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::BNC); pub const RelayCurrencyId: CurrencyId = CurrencyId::Token(TokenSymbol::KSM); pub const StableCurrencyId: CurrencyId = CurrencyId::Stable(TokenSymbol::KUSD); pub const PolkadotCurrencyId: CurrencyId = CurrencyId::Token(TokenSymbol::DOT); } +parameter_types! { + pub const TreasuryPalletId: PalletId = PalletId(*b"bf/trsry"); + pub const BifrostCrowdloanId: PalletId = PalletId(*b"bf/salp#"); + pub const LiquidityMiningPalletId: PalletId = PalletId(*b"bf/lm###"); + pub const LighteningRedeemPalletId: PalletId = PalletId(*b"bf/ltnrd"); +} + impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; /// The identifier used to distinguish between accounts. @@ -596,7 +603,6 @@ parameter_types! { pub const ProposalBondMinimum: Balance = 50 * DOLLARS; pub const SpendPeriod: BlockNumber = 6 * DAYS; pub const Burn: Permill = Permill::from_perthousand(2); - pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry"); pub const TipCountdown: BlockNumber = 1 * DAYS; pub const TipFindersFee: Percent = Percent::from_percent(20); @@ -1094,7 +1100,6 @@ pub fn create_x2_multilocation(index: u16) -> MultiLocation { parameter_types! { pub const MinContribution: Balance = 1 * DOLLARS; - pub const BifrostCrowdloanId: PalletId = PalletId(*b"bf/salp#"); pub const RemoveKeysLimit: u32 = 500; pub const VSBondValidPeriod: BlockNumber = 30 * DAYS; pub const ReleaseCycle: BlockNumber = 1 * DAYS; @@ -1198,7 +1203,6 @@ parameter_types! { pub const MinimumDuration: BlockNumber = DAYS; pub const MaximumApproved: u32 = 8; pub const MaximumOptionRewards: u32 = 7; - pub const LiquidityMiningPalletId: PalletId = PalletId(*b"mining##"); } impl bifrost_liquidity_mining::Config for Runtime { @@ -1217,6 +1221,30 @@ impl bifrost_liquidity_mining::Config for Runtime { type WeightInfo = (); } +impl bifrost_token_issuer::Config for Runtime { + type Event = Event; + type MultiCurrency = Currencies; + type ControlOrigin = + EnsureOneOf; + type WeightInfo = weights::bifrost_token_issuer::WeightInfo; +} + +impl bifrost_lightening_redeem::Config for Runtime { + type Event = Event; + type MultiCurrency = Tokens; + type ControlOrigin = + EnsureOneOf; + type PalletId = LighteningRedeemPalletId; + type WeightInfo = weights::bifrost_lightening_redeem::WeightInfo; +} + +impl bifrost_call_switchgear::Config for Runtime { + type Event = Event; + type UpdateOrigin = + EnsureOneOf; + type WeightInfo = weights::bifrost_call_switchgear::WeightInfo; +} + // bifrost runtime end // zenlink runtime start @@ -1426,12 +1454,12 @@ construct_runtime! { Vesting: pallet_vesting::{Pallet, Call, Storage, Event, Config} = 60, // Third party modules - ZenlinkProtocol: zenlink_protocol::{Pallet, Call, Storage, Event} = 61, XTokens: orml_xtokens::{Pallet, Call, Event} = 70, Tokens: orml_tokens::{Pallet, Call, Storage, Event, Config} = 71, Currencies: orml_currencies::{Pallet, Call, Event} = 72, UnknownTokens: orml_unknown_tokens::{Pallet, Storage, Event} = 73, OrmlXcm: orml_xcm::{Pallet, Call, Event} = 74, + ZenlinkProtocol: zenlink_protocol::{Pallet, Call, Storage, Event} = 80, // Bifrost modules VtokenMint: bifrost_vtoken_mint::{Pallet, Call, Storage, Event, Config} = 101, @@ -1441,7 +1469,10 @@ construct_runtime! { Bancor: bifrost_bancor::{Pallet, Call, Storage, Event, Config} = 106, VSBondAuction: bifrost_vsbond_auction::{Pallet, Call, Storage, Event} = 107, LiquidityMining: bifrost_liquidity_mining::{Pallet, Call, Storage, Event} = 108, + TokenIssuer: bifrost_token_issuer::{Pallet, Call, Storage, Event} = 109, + LighteningRedeem: bifrost_lightening_redeem::{Pallet, Call, Storage, Event} = 110, SalpLite: bifrost_salp_lite::{Pallet, Call, Storage, Event} = 111, + CallSwitchgear: bifrost_call_switchgear::{Pallet, Storage, Call, Event} = 112, } } diff --git a/runtime/dev/src/weights/bifrost_call_switchgear.rs b/runtime/dev/src/weights/bifrost_call_switchgear.rs new file mode 100644 index 0000000000..5e7ae2f84e --- /dev/null +++ b/runtime/dev/src/weights/bifrost_call_switchgear.rs @@ -0,0 +1,74 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2021 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! Autogenerated weights for `bifrost_call_switchgear` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2021-11-01, STEPS: `50`, REPEAT: 1, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asgard-local"), DB CACHE: 128 + +// Executed Command: +// target/release/bifrost +// benchmark +// --chain=asgard-local +// --steps=50 +// --repeat=1 +// --pallet=bifrost_call_switchgear +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --header=./HEADER-GPL3 +// --output=./runtime/asgard/src/weights/bifrost_call_switchgear.rs + + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weight functions for `bifrost_call_switchgear`. +pub struct WeightInfo(PhantomData); +impl bifrost_call_switchgear::WeightInfo for WeightInfo { + // Storage: CallSwitchgear SwitchedOffTransactions (r:1 w:1) + fn switchoff_transaction() -> Weight { + (26_520_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: CallSwitchgear SwitchedOffTransactions (r:1 w:1) + fn switchon_transaction() -> Weight { + (25_178_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: CallSwitchgear DisabledTransfers (r:1 w:1) + fn disable_transfers() -> Weight { + (25_318_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: CallSwitchgear DisabledTransfers (r:1 w:1) + fn enable_transfers() -> Weight { + (23_484_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } +} diff --git a/runtime/dev/src/weights/bifrost_lightening_redeem.rs b/runtime/dev/src/weights/bifrost_lightening_redeem.rs new file mode 100644 index 0000000000..4f6da45348 --- /dev/null +++ b/runtime/dev/src/weights/bifrost_lightening_redeem.rs @@ -0,0 +1,109 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2021 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! Autogenerated weights for `bifrost_lightening_redeem` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2021-10-28, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-local"), DB CACHE: 128 + +// Executed Command: +// target/release/bifrost +// benchmark +// --chain=bifrost-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_lightening_redeem +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --header=./HEADER-GPL3 +// --output=./runtime/bifrost/src/weights/bifrost_lightening_redeem.rs + + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weight functions for `bifrost_lightening_redeem`. +pub struct WeightInfo(PhantomData); +impl bifrost_lightening_redeem::WeightInfo for WeightInfo { + // Storage: Tokens Accounts (r:2 w:2) + // Storage: System Account (r:1 w:1) + // Storage: System Number (r:1 w:0) + // Storage: System ExecutionPhase (r:1 w:0) + // Storage: System EventCount (r:1 w:1) + // Storage: System Events (r:1 w:1) + fn add_ksm_to_pool() -> Weight { + (150_126_000 as Weight) + .saturating_add(T::DbWeight::get().reads(7 as Weight)) + .saturating_add(T::DbWeight::get().writes(5 as Weight)) + } + // Storage: LighteningRedeem PoolAmount (r:1 w:1) + // Storage: LighteningRedeem ExchangePriceDiscount (r:1 w:0) + // Storage: Tokens Accounts (r:6 w:6) + // Storage: System Account (r:1 w:1) + // Storage: System Number (r:1 w:0) + // Storage: System ExecutionPhase (r:1 w:0) + // Storage: System EventCount (r:1 w:1) + // Storage: System Events (r:1 w:1) + fn exchange_for_ksm() -> Weight { + (300_822_000 as Weight) + .saturating_add(T::DbWeight::get().reads(13 as Weight)) + .saturating_add(T::DbWeight::get().writes(10 as Weight)) + } + // Storage: LighteningRedeem ExchangePriceDiscount (r:1 w:1) + // Storage: System Number (r:1 w:0) + // Storage: System ExecutionPhase (r:1 w:0) + // Storage: System EventCount (r:1 w:1) + // Storage: System Events (r:1 w:1) + fn edit_exchange_price() -> Weight { + (53_236_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) + } + // Storage: LighteningRedeem TokenReleasePerDay (r:1 w:1) + // Storage: System Number (r:1 w:0) + // Storage: System ExecutionPhase (r:1 w:0) + // Storage: System EventCount (r:1 w:1) + // Storage: System Events (r:1 w:1) + fn edit_release_per_day() -> Weight { + (53_527_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) + } + // Storage: System Number (r:1 w:0) + // Storage: LighteningRedeem StartEndReleaseBlock (r:1 w:1) + // Storage: System ExecutionPhase (r:1 w:0) + // Storage: System EventCount (r:1 w:1) + // Storage: System Events (r:1 w:1) + fn edit_release_start_and_end_block() -> Weight { + (54_056_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) + } + // Storage: LighteningRedeem StartEndReleaseBlock (r:1 w:0) + fn on_initialize() -> Weight { + (11_999_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + } +} diff --git a/runtime/dev/src/weights/bifrost_token_issuer.rs b/runtime/dev/src/weights/bifrost_token_issuer.rs new file mode 100644 index 0000000000..0f104ee62a --- /dev/null +++ b/runtime/dev/src/weights/bifrost_token_issuer.rs @@ -0,0 +1,113 @@ +// This file is part of Bifrost. + +// Copyright (C) 2019-2021 Liebi Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! Autogenerated weights for `bifrost_token_issuer` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2021-10-28, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-local"), DB CACHE: 128 + +// Executed Command: +// target/release/bifrost +// benchmark +// --chain=bifrost-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_token_issuer +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --header=./HEADER-GPL3 +// --output=./runtime/bifrost/src/weights/bifrost_token_issuer.rs + + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weight functions for `bifrost_token_issuer`. +pub struct WeightInfo(PhantomData); +impl bifrost_token_issuer::WeightInfo for WeightInfo { + // Storage: TokenIssuer IssueWhiteList (r:1 w:1) + // Storage: System Number (r:1 w:0) + // Storage: System ExecutionPhase (r:1 w:0) + // Storage: System EventCount (r:1 w:1) + // Storage: System Events (r:1 w:1) + fn add_to_issue_whitelist() -> Weight { + (61_469_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) + } + // Storage: TokenIssuer IssueWhiteList (r:1 w:1) + // Storage: System Number (r:1 w:0) + // Storage: System ExecutionPhase (r:1 w:0) + // Storage: System EventCount (r:1 w:1) + // Storage: System Events (r:1 w:1) + fn remove_from_issue_whitelist() -> Weight { + (57_200_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) + } + // Storage: TokenIssuer TransferWhiteList (r:1 w:1) + // Storage: System Number (r:1 w:0) + // Storage: System ExecutionPhase (r:1 w:0) + // Storage: System EventCount (r:1 w:1) + // Storage: System Events (r:1 w:1) + fn add_to_transfer_whitelist() -> Weight { + (62_091_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) + } + // Storage: TokenIssuer TransferWhiteList (r:1 w:1) + // Storage: System Number (r:1 w:0) + // Storage: System ExecutionPhase (r:1 w:0) + // Storage: System EventCount (r:1 w:1) + // Storage: System Events (r:1 w:1) + fn remove_from_transfer_whitelist() -> Weight { + (61_857_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(3 as Weight)) + } + // Storage: TokenIssuer IssueWhiteList (r:1 w:0) + // Storage: Tokens Accounts (r:1 w:1) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Storage: System Number (r:1 w:0) + // Storage: System ExecutionPhase (r:1 w:0) + // Storage: System EventCount (r:1 w:1) + // Storage: System Events (r:1 w:1) + fn issue() -> Weight { + (105_189_000 as Weight) + .saturating_add(T::DbWeight::get().reads(7 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + // Storage: TokenIssuer TransferWhiteList (r:1 w:0) + // Storage: Tokens Accounts (r:2 w:2) + // Storage: System Number (r:1 w:0) + // Storage: System ExecutionPhase (r:1 w:0) + // Storage: System EventCount (r:1 w:1) + // Storage: System Events (r:1 w:1) + fn transfer() -> Weight { + (138_244_000 as Weight) + .saturating_add(T::DbWeight::get().reads(7 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } +} diff --git a/runtime/dev/src/weights/mod.rs b/runtime/dev/src/weights/mod.rs index e47f78514b..e9e8219bd7 100644 --- a/runtime/dev/src/weights/mod.rs +++ b/runtime/dev/src/weights/mod.rs @@ -21,10 +21,13 @@ //! A list of the different weight modules for our runtime. pub mod bifrost_bancor; +pub mod bifrost_call_switchgear; pub mod bifrost_flexible_fee; +pub mod bifrost_lightening_redeem; pub mod bifrost_minter_reward; pub mod bifrost_salp; pub mod bifrost_salp_lite; +pub mod bifrost_token_issuer; pub mod bifrost_vsbond_auction; pub mod bifrost_vtoken_mint; pub mod pallet_vesting;