diff --git a/contracts/README.md b/contracts/README.md index 9174cb5b8..aebdcaffd 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -40,7 +40,7 @@ Agents are defined by the following contracts: * [Agent.sol](src/Agent.sol): Agent contract * [AgentExecutor.sol](src/AgentExecutor.sol): Code executed within an agent using `delegatecall` -The creation of new agents can be initiated by calling `EthereumControl::create_agent` extrinsic on the BridgeHub parachain. +The creation of new agents can be initiated by calling `EthereumSystem::create_agent` extrinsic on the BridgeHub parachain. ### BeefyClient diff --git a/docs/architecture/components.md b/docs/architecture/components.md index 88b1fbb38..699adb495 100644 --- a/docs/architecture/components.md +++ b/docs/architecture/components.md @@ -53,7 +53,7 @@ More concretely, they have a number of purposes in the bridge design: * Users wanting to send outbound messages to Polkadot need to pay fees into the agent contract corresponding to the destination parachain * Relayers submitting messages to the Gateway are rewarded from the agent contract corresponding to the origin parachain. -The creation of new agents can be initiated permissionlessly by calling `EthereumControl::create_agent` extrinsic on the BridgeHub parachain. +The creation of new agents can be initiated permissionlessly by calling `EthereumSystem::create_agent` extrinsic on the BridgeHub parachain. ### BeefyClient diff --git a/parachain/Cargo.lock b/parachain/Cargo.lock index 9066fd8a1..b028ad222 100644 --- a/parachain/Cargo.lock +++ b/parachain/Cargo.lock @@ -3722,46 +3722,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "snowbridge-control" -version = "4.0.0-dev" -dependencies = [ - "ethabi-decode", - "frame-benchmarking", - "frame-support", - "frame-system", - "hex", - "hex-literal", - "log", - "pallet-balances", - "pallet-message-queue", - "parity-scale-codec", - "polkadot-primitives", - "scale-info", - "snowbridge-core", - "snowbridge-outbound-queue", - "sp-core", - "sp-io", - "sp-keyring", - "sp-runtime", - "sp-std 8.0.0", - "staging-xcm", - "staging-xcm-builder", - "staging-xcm-executor", -] - -[[package]] -name = "snowbridge-control-runtime-api" -version = "0.1.0" -dependencies = [ - "parity-scale-codec", - "snowbridge-core", - "sp-api", - "sp-core", - "sp-std 8.0.0", - "staging-xcm", -] - [[package]] name = "snowbridge-core" version = "0.1.1" @@ -3961,6 +3921,46 @@ dependencies = [ "staging-xcm-executor", ] +[[package]] +name = "snowbridge-system" +version = "0.1.1" +dependencies = [ + "ethabi-decode", + "frame-benchmarking", + "frame-support", + "frame-system", + "hex", + "hex-literal", + "log", + "pallet-balances", + "pallet-message-queue", + "parity-scale-codec", + "polkadot-primitives", + "scale-info", + "snowbridge-core", + "snowbridge-outbound-queue", + "sp-core", + "sp-io", + "sp-keyring", + "sp-runtime", + "sp-std 8.0.0", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", +] + +[[package]] +name = "snowbridge-system-runtime-api" +version = "0.1.0" +dependencies = [ + "parity-scale-codec", + "snowbridge-core", + "sp-api", + "sp-core", + "sp-std 8.0.0", + "staging-xcm", +] + [[package]] name = "sp-api" version = "4.0.0-dev" diff --git a/parachain/Cargo.toml b/parachain/Cargo.toml index 4cef3fbeb..5398aff35 100644 --- a/parachain/Cargo.toml +++ b/parachain/Cargo.toml @@ -10,7 +10,19 @@ members = [ "pallets/outbound-queue/runtime-api", "pallets/outbound-queue/merkle-tree", "pallets/ethereum-beacon-client", - "pallets/control", - "pallets/control/runtime-api", + "pallets/system", + "pallets/system/runtime-api", "runtime/runtime-common", ] + +[patch.'https://github.com/snowfork/snowbridge'] +snowbridge-beacon-primitives = { path = "./primitives/beacon" } +snowbridge-system = { path = "./pallets/system" } +snowbridge-system-runtime-api = { path = "./pallets/system/runtime-api" } +snowbridge-core = { path = "./primitives/core" } +snowbridge-ethereum-beacon-client = { path = "./pallets/ethereum-beacon-client" } +snowbridge-inbound-queue = { path = "./pallets/inbound-queue" } +snowbridge-outbound-queue = { path = "./pallets/outbound-queue" } +snowbridge-outbound-queue-runtime-api = { path = "./pallets/outbound-queue/runtime-api" } +snowbridge-router-primitives = { path = "./primitives/router" } +snowbridge-runtime-common = { path = "./runtime/runtime-common" } diff --git a/parachain/pallets/outbound-queue/src/lib.rs b/parachain/pallets/outbound-queue/src/lib.rs index 407f688be..c50df962b 100644 --- a/parachain/pallets/outbound-queue/src/lib.rs +++ b/parachain/pallets/outbound-queue/src/lib.rs @@ -5,10 +5,10 @@ //! # Overview //! //! Messages come either from sibling parachains via XCM, or BridgeHub itself -//! via the `snowbridge-control` pallet: +//! via the `snowbridge-system` pallet: //! //! 1. `snowbridge_router_primitives::outbound::EthereumBlobExporter::deliver` -//! 2. `snowbridge_control::Pallet::send` +//! 2. `snowbridge_system::Pallet::send` //! //! The message submission pipeline works like this: //! 1. The message is first validated via the implementation for diff --git a/parachain/pallets/control/Cargo.toml b/parachain/pallets/system/Cargo.toml similarity index 88% rename from parachain/pallets/control/Cargo.toml rename to parachain/pallets/system/Cargo.toml index 8724a290a..6a190e5e3 100644 --- a/parachain/pallets/control/Cargo.toml +++ b/parachain/pallets/system/Cargo.toml @@ -1,13 +1,10 @@ [package] -name = "snowbridge-control" -version = "4.0.0-dev" -description = "FRAME pallet template for defining custom runtime logic." -authors = ["Substrate DevHub "] -homepage = "https://substrate.io" +name = "snowbridge-system" +version = "0.1.1" +description = "Snowbridge System" +authors = ["Snowfork "] edition = "2021" -license = "MIT-0" -publish = false -repository = "https://github.com/substrate-developer-hub/substrate-node-template/" +repository = "https://github.com/Snowfork/snowbridge" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/parachain/pallets/control/README.md b/parachain/pallets/system/README.md similarity index 100% rename from parachain/pallets/control/README.md rename to parachain/pallets/system/README.md diff --git a/parachain/pallets/control/runtime-api/Cargo.toml b/parachain/pallets/system/runtime-api/Cargo.toml similarity index 96% rename from parachain/pallets/control/runtime-api/Cargo.toml rename to parachain/pallets/system/runtime-api/Cargo.toml index d2e34e36c..9bd092209 100644 --- a/parachain/pallets/control/runtime-api/Cargo.toml +++ b/parachain/pallets/system/runtime-api/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "snowbridge-control-runtime-api" +name = "snowbridge-system-runtime-api" version = "0.1.0" edition = "2021" authors = ["Snowfork "] diff --git a/parachain/pallets/control/runtime-api/src/lib.rs b/parachain/pallets/system/runtime-api/src/lib.rs similarity index 100% rename from parachain/pallets/control/runtime-api/src/lib.rs rename to parachain/pallets/system/runtime-api/src/lib.rs diff --git a/parachain/pallets/control/src/api.rs b/parachain/pallets/system/src/api.rs similarity index 100% rename from parachain/pallets/control/src/api.rs rename to parachain/pallets/system/src/api.rs diff --git a/parachain/pallets/control/src/benchmarking.rs b/parachain/pallets/system/src/benchmarking.rs similarity index 100% rename from parachain/pallets/control/src/benchmarking.rs rename to parachain/pallets/system/src/benchmarking.rs diff --git a/parachain/pallets/control/src/lib.rs b/parachain/pallets/system/src/lib.rs similarity index 100% rename from parachain/pallets/control/src/lib.rs rename to parachain/pallets/system/src/lib.rs diff --git a/parachain/pallets/control/src/mock.rs b/parachain/pallets/system/src/mock.rs similarity index 97% rename from parachain/pallets/control/src/mock.rs rename to parachain/pallets/system/src/mock.rs index 99cc229b5..2dc5e05f2 100644 --- a/parachain/pallets/control/src/mock.rs +++ b/parachain/pallets/system/src/mock.rs @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: 2023 Snowfork -use crate as snowbridge_control; +use crate as snowbridge_system; use frame_support::{ parameter_types, traits::{tokens::fungible::Mutate, ConstU128, ConstU16, ConstU64, ConstU8}, @@ -91,7 +91,7 @@ frame_support::construct_runtime!( Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, XcmOrigin: pallet_xcm_origin::{Pallet, Origin}, OutboundQueue: snowbridge_outbound_queue::{Pallet, Call, Storage, Event}, - EthereumControl: snowbridge_control, + EthereumSystem: snowbridge_system, MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event} } ); @@ -176,7 +176,7 @@ impl snowbridge_outbound_queue::Config for Test { type MaxMessagesPerBlock = MaxMessagesPerBlock; type GasMeter = ConstantGasMeter; type Balance = u128; - type PricingParameters = EthereumControl; + type PricingParameters = EthereumSystem; type WeightToFee = IdentityFee; type WeightInfo = (); } @@ -263,6 +263,6 @@ pub fn make_xcm_origin(location: MultiLocation) -> RuntimeOrigin { } pub fn make_agent_id(location: MultiLocation) -> AgentId { - ::AgentIdOf::convert_location(&location) + ::AgentIdOf::convert_location(&location) .expect("convert location") } diff --git a/parachain/pallets/control/src/tests.rs b/parachain/pallets/system/src/tests.rs similarity index 79% rename from parachain/pallets/control/src/tests.rs rename to parachain/pallets/system/src/tests.rs index 598f1e3ca..18b536e9f 100644 --- a/parachain/pallets/control/src/tests.rs +++ b/parachain/pallets/system/src/tests.rs @@ -21,7 +21,7 @@ fn create_agent() { assert!(!Agents::::contains_key(agent_id)); let origin = make_xcm_origin(origin_location); - assert_ok!(EthereumControl::create_agent(origin)); + assert_ok!(EthereumSystem::create_agent(origin)); assert!(Agents::::contains_key(agent_id)); }); @@ -47,7 +47,7 @@ fn create_agent_fails_on_funds_unavailable() { // Reset balance of sovereign_account to zero so to trigger the FundsUnavailable error let sovereign_account = sibling_sovereign_account::(2000.into()); Balances::set_balance(&sovereign_account, 0); - assert_noop!(EthereumControl::create_agent(origin), TokenError::FundsUnavailable); + assert_noop!(EthereumSystem::create_agent(origin), TokenError::FundsUnavailable); }); } @@ -56,7 +56,7 @@ fn create_agent_bad_origin() { new_test_ext().execute_with(|| { // relay chain location not allowed assert_noop!( - EthereumControl::create_agent(make_xcm_origin(MultiLocation { + EthereumSystem::create_agent(make_xcm_origin(MultiLocation { parents: 1, interior: Here, })), @@ -65,7 +65,7 @@ fn create_agent_bad_origin() { // local account location not allowed assert_noop!( - EthereumControl::create_agent(make_xcm_origin(MultiLocation { + EthereumSystem::create_agent(make_xcm_origin(MultiLocation { parents: 0, interior: X1(Junction::AccountId32 { network: None, id: [67u8; 32] }), })), @@ -74,12 +74,12 @@ fn create_agent_bad_origin() { // Signed origin not allowed assert_noop!( - EthereumControl::create_agent(RuntimeOrigin::signed([14; 32].into())), + EthereumSystem::create_agent(RuntimeOrigin::signed([14; 32].into())), BadOrigin ); // None origin not allowed - assert_noop!(EthereumControl::create_agent(RuntimeOrigin::none()), BadOrigin); + assert_noop!(EthereumSystem::create_agent(RuntimeOrigin::none()), BadOrigin); }); } @@ -90,9 +90,9 @@ fn upgrade_as_root() { let address: H160 = Default::default(); let code_hash: H256 = Default::default(); - assert_ok!(EthereumControl::upgrade(origin, address, code_hash, None)); + assert_ok!(EthereumSystem::upgrade(origin, address, code_hash, None)); - System::assert_last_event(RuntimeEvent::EthereumControl(crate::Event::Upgrade { + System::assert_last_event(RuntimeEvent::EthereumSystem(crate::Event::Upgrade { impl_address: address, impl_code_hash: code_hash, initializer_params_hash: None, @@ -107,7 +107,7 @@ fn upgrade_as_signed_fails() { let address: H160 = Default::default(); let code_hash: H256 = Default::default(); - assert_noop!(EthereumControl::upgrade(origin, address, code_hash, None), BadOrigin); + assert_noop!(EthereumSystem::upgrade(origin, address, code_hash, None), BadOrigin); }); } @@ -119,7 +119,7 @@ fn upgrade_with_params() { let code_hash: H256 = Default::default(); let initializer: Option = Some(Initializer { params: [0; 256].into(), maximum_required_gas: 10000 }); - assert_ok!(EthereumControl::upgrade(origin, address, code_hash, initializer)); + assert_ok!(EthereumSystem::upgrade(origin, address, code_hash, initializer)); }); } @@ -129,9 +129,9 @@ fn set_operating_mode() { let origin = RuntimeOrigin::root(); let mode = OperatingMode::RejectingOutboundMessages; - assert_ok!(EthereumControl::set_operating_mode(origin, mode)); + assert_ok!(EthereumSystem::set_operating_mode(origin, mode)); - System::assert_last_event(RuntimeEvent::EthereumControl(crate::Event::SetOperatingMode { + System::assert_last_event(RuntimeEvent::EthereumSystem(crate::Event::SetOperatingMode { mode, })); }); @@ -143,7 +143,7 @@ fn set_operating_mode_as_signed_fails() { let origin = RuntimeOrigin::signed([14; 32].into()); let mode = OperatingMode::RejectingOutboundMessages; - assert_noop!(EthereumControl::set_operating_mode(origin, mode), BadOrigin); + assert_noop!(EthereumSystem::set_operating_mode(origin, mode), BadOrigin); }); } @@ -154,7 +154,7 @@ fn set_pricing_parameters() { let mut params = Parameters::get(); params.rewards.local = 7; - assert_ok!(EthereumControl::set_pricing_parameters(origin, params)); + assert_ok!(EthereumSystem::set_pricing_parameters(origin, params)); assert_eq!(PricingParameters::::get().rewards.local, 7); }); @@ -166,7 +166,7 @@ fn set_pricing_parameters_as_signed_fails() { let origin = RuntimeOrigin::signed([14; 32].into()); let params = Parameters::get(); - assert_noop!(EthereumControl::set_pricing_parameters(origin, params), BadOrigin); + assert_noop!(EthereumSystem::set_pricing_parameters(origin, params), BadOrigin); }); } @@ -178,7 +178,7 @@ fn set_pricing_parameters_invalid() { params.rewards.local = 0; assert_noop!( - EthereumControl::set_pricing_parameters(origin, params), + EthereumSystem::set_pricing_parameters(origin, params), Error::::InvalidPricingParameters ); }); @@ -189,7 +189,7 @@ fn set_token_transfer_fees() { new_test_ext().execute_with(|| { let origin = RuntimeOrigin::root(); - assert_ok!(EthereumControl::set_token_transfer_fees(origin, 1, 1, eth(1))); + assert_ok!(EthereumSystem::set_token_transfer_fees(origin, 1, 1, eth(1))); }); } @@ -198,7 +198,7 @@ fn set_token_transfer_fees_root_only() { new_test_ext().execute_with(|| { let origin = RuntimeOrigin::signed([14; 32].into()); - assert_noop!(EthereumControl::set_token_transfer_fees(origin, 1, 1, 1.into()), BadOrigin); + assert_noop!(EthereumSystem::set_token_transfer_fees(origin, 1, 1, 1.into()), BadOrigin); }); } @@ -208,7 +208,7 @@ fn set_token_transfer_fees_invalid() { let origin = RuntimeOrigin::root(); assert_noop!( - EthereumControl::set_token_transfer_fees(origin, 0, 0, 0.into()), + EthereumSystem::set_token_transfer_fees(origin, 0, 0, 0.into()), Error::::InvalidTokenTransferFees ); }); @@ -225,8 +225,8 @@ fn create_channel() { // fund sovereign account of origin let _ = Balances::mint_into(&sovereign_account, 10000); - assert_ok!(EthereumControl::create_agent(origin.clone())); - assert_ok!(EthereumControl::create_channel(origin, OperatingMode::Normal)); + assert_ok!(EthereumSystem::create_agent(origin.clone())); + assert_ok!(EthereumSystem::create_channel(origin, OperatingMode::Normal)); }); } @@ -241,11 +241,11 @@ fn create_channel_fail_already_exists() { // fund sovereign account of origin let _ = Balances::mint_into(&sovereign_account, 10000); - assert_ok!(EthereumControl::create_agent(origin.clone())); - assert_ok!(EthereumControl::create_channel(origin.clone(), OperatingMode::Normal)); + assert_ok!(EthereumSystem::create_agent(origin.clone())); + assert_ok!(EthereumSystem::create_channel(origin.clone(), OperatingMode::Normal)); assert_noop!( - EthereumControl::create_channel(origin, OperatingMode::Normal), + EthereumSystem::create_channel(origin, OperatingMode::Normal), Error::::ChannelAlreadyCreated ); }); @@ -256,7 +256,7 @@ fn create_channel_bad_origin() { new_test_ext().execute_with(|| { // relay chain location not allowed assert_noop!( - EthereumControl::create_channel( + EthereumSystem::create_channel( make_xcm_origin(MultiLocation { parents: 1, interior: Here }), OperatingMode::Normal, ), @@ -265,7 +265,7 @@ fn create_channel_bad_origin() { // child of sibling location not allowed assert_noop!( - EthereumControl::create_channel( + EthereumSystem::create_channel( make_xcm_origin(MultiLocation { parents: 1, interior: X2( @@ -280,7 +280,7 @@ fn create_channel_bad_origin() { // local account location not allowed assert_noop!( - EthereumControl::create_channel( + EthereumSystem::create_channel( make_xcm_origin(MultiLocation { parents: 0, interior: X1(Junction::AccountId32 { network: None, id: [67u8; 32] }), @@ -292,7 +292,7 @@ fn create_channel_bad_origin() { // Signed origin not allowed assert_noop!( - EthereumControl::create_channel( + EthereumSystem::create_channel( RuntimeOrigin::signed([14; 32].into()), OperatingMode::Normal, ), @@ -300,7 +300,7 @@ fn create_channel_bad_origin() { ); // None origin not allowed - assert_noop!(EthereumControl::create_agent(RuntimeOrigin::none()), BadOrigin); + assert_noop!(EthereumSystem::create_agent(RuntimeOrigin::none()), BadOrigin); }); } @@ -314,13 +314,13 @@ fn update_channel() { // First create the channel let _ = Balances::mint_into(&sovereign_account, 10000); - EthereumControl::create_agent(origin.clone()).unwrap(); - EthereumControl::create_channel(origin.clone(), OperatingMode::Normal).unwrap(); + EthereumSystem::create_agent(origin.clone()).unwrap(); + EthereumSystem::create_channel(origin.clone(), OperatingMode::Normal).unwrap(); // Now try to update it - assert_ok!(EthereumControl::update_channel(origin, OperatingMode::Normal, 2004)); + assert_ok!(EthereumSystem::update_channel(origin, OperatingMode::Normal, 2004)); - System::assert_last_event(RuntimeEvent::EthereumControl(crate::Event::UpdateChannel { + System::assert_last_event(RuntimeEvent::EthereumSystem(crate::Event::UpdateChannel { channel_id: ParaId::from(2000).into(), mode: OperatingMode::Normal, outbound_fee: 2004, @@ -336,7 +336,7 @@ fn update_channel_bad_origin() { // relay chain location not allowed assert_noop!( - EthereumControl::update_channel( + EthereumSystem::update_channel( make_xcm_origin(MultiLocation { parents: 1, interior: Here }), mode, fee, @@ -346,7 +346,7 @@ fn update_channel_bad_origin() { // child of sibling location not allowed assert_noop!( - EthereumControl::update_channel( + EthereumSystem::update_channel( make_xcm_origin(MultiLocation { parents: 1, interior: X2( @@ -362,7 +362,7 @@ fn update_channel_bad_origin() { // local account location not allowed assert_noop!( - EthereumControl::update_channel( + EthereumSystem::update_channel( make_xcm_origin(MultiLocation { parents: 0, interior: X1(Junction::AccountId32 { network: None, id: [67u8; 32] }), @@ -375,12 +375,12 @@ fn update_channel_bad_origin() { // Signed origin not allowed assert_noop!( - EthereumControl::update_channel(RuntimeOrigin::signed([14; 32].into()), mode, fee), + EthereumSystem::update_channel(RuntimeOrigin::signed([14; 32].into()), mode, fee), BadOrigin ); // None origin not allowed - assert_noop!(EthereumControl::update_channel(RuntimeOrigin::none(), mode, fee), BadOrigin); + assert_noop!(EthereumSystem::update_channel(RuntimeOrigin::none(), mode, fee), BadOrigin); }); } @@ -392,7 +392,7 @@ fn update_channel_fails_not_exist() { // Now try to update it assert_noop!( - EthereumControl::update_channel(origin, OperatingMode::Normal, 2004), + EthereumSystem::update_channel(origin, OperatingMode::Normal, 2004), Error::::NoChannel ); }); @@ -410,19 +410,19 @@ fn force_update_channel() { // First create the channel let _ = Balances::mint_into(&sovereign_account, 10000); - EthereumControl::create_agent(origin.clone()).unwrap(); - EthereumControl::create_channel(origin.clone(), OperatingMode::Normal).unwrap(); + EthereumSystem::create_agent(origin.clone()).unwrap(); + EthereumSystem::create_channel(origin.clone(), OperatingMode::Normal).unwrap(); // Now try to force update it let force_origin = RuntimeOrigin::root(); - assert_ok!(EthereumControl::force_update_channel( + assert_ok!(EthereumSystem::force_update_channel( force_origin, channel_id, OperatingMode::Normal, 2004 )); - System::assert_last_event(RuntimeEvent::EthereumControl(crate::Event::UpdateChannel { + System::assert_last_event(RuntimeEvent::EthereumSystem(crate::Event::UpdateChannel { channel_id: ParaId::from(2000).into(), mode: OperatingMode::Normal, outbound_fee: 2004, @@ -438,7 +438,7 @@ fn force_update_channel_bad_origin() { // signed origin not allowed assert_noop!( - EthereumControl::force_update_channel( + EthereumSystem::force_update_channel( RuntimeOrigin::signed([14; 32].into()), ParaId::from(1000).into(), mode, @@ -460,9 +460,9 @@ fn transfer_native_from_agent() { Agents::::insert(make_agent_id(origin_location), ()); let origin = make_xcm_origin(origin_location); - assert_ok!(EthereumControl::transfer_native_from_agent(origin, recipient, amount),); + assert_ok!(EthereumSystem::transfer_native_from_agent(origin, recipient, amount),); - System::assert_last_event(RuntimeEvent::EthereumControl( + System::assert_last_event(RuntimeEvent::EthereumSystem( crate::Event::TransferNativeFromAgent { agent_id: make_agent_id(origin_location), recipient, @@ -484,14 +484,14 @@ fn force_transfer_native_from_agent() { // First create the agent Agents::::insert(make_agent_id(location), ()); - assert_ok!(EthereumControl::force_transfer_native_from_agent( + assert_ok!(EthereumSystem::force_transfer_native_from_agent( origin, versioned_location, recipient, amount ),); - System::assert_last_event(RuntimeEvent::EthereumControl( + System::assert_last_event(RuntimeEvent::EthereumSystem( crate::Event::TransferNativeFromAgent { agent_id: make_agent_id(location), recipient, @@ -509,7 +509,7 @@ fn force_transfer_native_from_agent_bad_origin() { // signed origin not allowed assert_noop!( - EthereumControl::force_transfer_native_from_agent( + EthereumSystem::force_transfer_native_from_agent( RuntimeOrigin::signed([14; 32].into()), Box::new( MultiLocation { @@ -558,7 +558,7 @@ fn charge_fee_for_create_agent() { let sovereign_account = sibling_sovereign_account::(para_id.into()); let (_, agent_id) = ensure_sibling::(&origin_location).unwrap(); - assert_ok!(EthereumControl::create_agent(origin.clone())); + assert_ok!(EthereumSystem::create_agent(origin.clone())); // assert sovereign_balance decreased by (fee.base_fee + fee.delivery_fee) let message = Message { id: None, @@ -591,12 +591,12 @@ fn charge_fee_for_transfer_native_from_agent() { let sovereign_account = sibling_sovereign_account::(para_id.into()); // create_agent & create_channel first - assert_ok!(EthereumControl::create_agent(origin.clone())); - assert_ok!(EthereumControl::create_channel(origin.clone(), OperatingMode::Normal)); + assert_ok!(EthereumSystem::create_agent(origin.clone())); + assert_ok!(EthereumSystem::create_channel(origin.clone(), OperatingMode::Normal)); // assert sovereign_balance decreased by only the base_fee let sovereign_balance_before = Balances::balance(&sovereign_account); - assert_ok!(EthereumControl::transfer_native_from_agent(origin.clone(), recipient, amount)); + assert_ok!(EthereumSystem::transfer_native_from_agent(origin.clone(), recipient, amount)); let message = Message { id: None, channel_id: ParaId::from(para_id).into(), @@ -617,7 +617,7 @@ fn charge_fee_for_upgrade() { let code_hash: H256 = Default::default(); let initializer: Option = Some(Initializer { params: [0; 256].into(), maximum_required_gas: 10000 }); - assert_ok!(EthereumControl::upgrade(origin, address, code_hash, initializer.clone())); + assert_ok!(EthereumSystem::upgrade(origin, address, code_hash, initializer.clone())); // assert sovereign_balance does not change as we do not charge for sudo operations let sovereign_account = sibling_sovereign_account::(para_id.into()); diff --git a/parachain/pallets/control/src/weights.rs b/parachain/pallets/system/src/weights.rs similarity index 90% rename from parachain/pallets/control/src/weights.rs rename to parachain/pallets/system/src/weights.rs index 5cc70e51b..6e532a0d8 100644 --- a/parachain/pallets/control/src/weights.rs +++ b/parachain/pallets/system/src/weights.rs @@ -1,5 +1,5 @@ -//! Autogenerated weights for `snowbridge_control` +//! Autogenerated weights for `snowbridge_system` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev //! DATE: 2023-10-09, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` @@ -13,7 +13,7 @@ // pallet // --chain // bridge-hub-rococo-dev -// --pallet=snowbridge_control +// --pallet=snowbridge_system // --extrinsic=* // --execution=wasm // --wasm-execution=compiled @@ -30,7 +30,7 @@ use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use core::marker::PhantomData; -/// Weight functions needed for `snowbridge_control`. +/// Weight functions needed for `snowbridge_system`. pub trait WeightInfo { fn upgrade() -> Weight; fn create_agent() -> Weight; @@ -65,8 +65,8 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } - /// Storage: EthereumControl Agents (r:1 w:1) - /// Proof: EthereumControl Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) + /// Storage: EthereumSystem Agents (r:1 w:1) + /// Proof: EthereumSystem Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) /// Storage: System Account (r:2 w:2) /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) /// Storage: ParachainInfo ParachainId (r:1 w:0) @@ -90,10 +90,10 @@ impl WeightInfo for () { } /// Storage: System Account (r:2 w:2) /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: EthereumControl Agents (r:1 w:0) - /// Proof: EthereumControl Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) - /// Storage: EthereumControl Channels (r:1 w:1) - /// Proof: EthereumControl Channels (max_values: None, max_size: Some(12), added: 2487, mode: MaxEncodedLen) + /// Storage: EthereumSystem Agents (r:1 w:0) + /// Proof: EthereumSystem Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) + /// Storage: EthereumSystem Channels (r:1 w:1) + /// Proof: EthereumSystem Channels (max_values: None, max_size: Some(12), added: 2487, mode: MaxEncodedLen) /// Storage: ParachainInfo ParachainId (r:1 w:0) /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) @@ -111,8 +111,8 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } - /// Storage: EthereumControl Channels (r:1 w:0) - /// Proof: EthereumControl Channels (max_values: None, max_size: Some(12), added: 2487, mode: MaxEncodedLen) + /// Storage: EthereumSystem Channels (r:1 w:0) + /// Proof: EthereumSystem Channels (max_values: None, max_size: Some(12), added: 2487, mode: MaxEncodedLen) /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: MessageQueue BookStateFor (r:2 w:2) @@ -130,8 +130,8 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } - /// Storage: EthereumControl Channels (r:1 w:0) - /// Proof: EthereumControl Channels (max_values: None, max_size: Some(12), added: 2487, mode: MaxEncodedLen) + /// Storage: EthereumSystem Channels (r:1 w:0) + /// Proof: EthereumSystem Channels (max_values: None, max_size: Some(12), added: 2487, mode: MaxEncodedLen) /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: MessageQueue BookStateFor (r:2 w:2) @@ -168,8 +168,8 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } - /// Storage: EthereumControl Agents (r:1 w:0) - /// Proof: EthereumControl Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) + /// Storage: EthereumSystem Agents (r:1 w:0) + /// Proof: EthereumSystem Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: MessageQueue BookStateFor (r:2 w:2) @@ -187,8 +187,8 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } - /// Storage: EthereumControl Agents (r:1 w:0) - /// Proof: EthereumControl Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) + /// Storage: EthereumSystem Agents (r:1 w:0) + /// Proof: EthereumSystem Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: MessageQueue BookStateFor (r:2 w:2) diff --git a/parachain/runtime/tests/Cargo.lock b/parachain/runtime/tests/Cargo.lock index d30c34a41..30ccd93b3 100644 --- a/parachain/runtime/tests/Cargo.lock +++ b/parachain/runtime/tests/Cargo.lock @@ -1646,8 +1646,6 @@ dependencies = [ "serde", "smallvec", "snowbridge-beacon-primitives", - "snowbridge-control", - "snowbridge-control-runtime-api", "snowbridge-core", "snowbridge-ethereum-beacon-client", "snowbridge-inbound-queue", @@ -1655,6 +1653,8 @@ dependencies = [ "snowbridge-outbound-queue-runtime-api", "snowbridge-router-primitives", "snowbridge-runtime-common", + "snowbridge-system", + "snowbridge-system-runtime-api", "sp-api", "sp-block-builder", "sp-consensus-aura", @@ -9714,39 +9714,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "snowbridge-control" -version = "4.0.0-dev" -dependencies = [ - "ethabi-decode", - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "snowbridge-core", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 8.0.0", - "staging-xcm", - "staging-xcm-builder", - "staging-xcm-executor", -] - -[[package]] -name = "snowbridge-control-runtime-api" -version = "0.1.0" -dependencies = [ - "parity-scale-codec", - "snowbridge-core", - "sp-api", - "sp-core", - "sp-std 8.0.0", - "staging-xcm", -] - [[package]] name = "snowbridge-core" version = "0.1.1" @@ -9980,14 +9947,14 @@ dependencies = [ "serde", "smallvec", "snowbridge-beacon-primitives", - "snowbridge-control", - "snowbridge-control-runtime-api", "snowbridge-core", "snowbridge-ethereum-beacon-client", "snowbridge-inbound-queue", "snowbridge-outbound-queue", "snowbridge-outbound-queue-runtime-api", "snowbridge-router-primitives", + "snowbridge-system", + "snowbridge-system-runtime-api", "sp-api", "sp-block-builder", "sp-consensus-aura", @@ -10010,6 +9977,39 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "snowbridge-system" +version = "0.1.1" +dependencies = [ + "ethabi-decode", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "snowbridge-core", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std 8.0.0", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", +] + +[[package]] +name = "snowbridge-system-runtime-api" +version = "0.1.0" +dependencies = [ + "parity-scale-codec", + "snowbridge-core", + "sp-api", + "sp-core", + "sp-std 8.0.0", + "staging-xcm", +] + [[package]] name = "socket2" version = "0.4.10" diff --git a/parachain/runtime/tests/Cargo.toml b/parachain/runtime/tests/Cargo.toml index 1615cb30d..db8ec0c0d 100644 --- a/parachain/runtime/tests/Cargo.toml +++ b/parachain/runtime/tests/Cargo.toml @@ -83,8 +83,8 @@ snowbridge-ethereum-beacon-client = { path = "../../pallets/ethereum-beacon-clie snowbridge-inbound-queue = { path = "../../pallets/inbound-queue", default-features = false } snowbridge-outbound-queue = { path = "../../pallets/outbound-queue", default-features = false } snowbridge-outbound-queue-runtime-api = { path = "../../pallets/outbound-queue/runtime-api", default-features = false } -snowbridge-control = { path = "../../pallets/control", default-features = false } -snowbridge-control-runtime-api = { path = "../../pallets/control/runtime-api", default-features = false } +snowbridge-system = { path = "../../pallets/system", default-features = false } +snowbridge-system-runtime-api = { path = "../../pallets/system/runtime-api", default-features = false } [dev-dependencies] static_assertions = "1.1" @@ -161,8 +161,8 @@ std = [ "snowbridge-inbound-queue/std", "snowbridge-outbound-queue/std", "snowbridge-outbound-queue-runtime-api/std", - "snowbridge-control/std", - "snowbridge-control-runtime-api/std", + "snowbridge-system/std", + "snowbridge-system-runtime-api/std", ] runtime-benchmarks = [ @@ -191,7 +191,7 @@ runtime-benchmarks = [ "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks", "snowbridge-core/runtime-benchmarks", - "snowbridge-control/runtime-benchmarks", + "snowbridge-system/runtime-benchmarks", "snowbridge-inbound-queue/runtime-benchmarks", "snowbridge-outbound-queue/runtime-benchmarks", "snowbridge-ethereum-beacon-client/runtime-benchmarks", @@ -230,3 +230,15 @@ experimental = ["pallet-aura/experimental"] # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller like logging for example. on-chain-release-build = ["sp-api/disable-logging"] + +[patch.'https://github.com/snowfork/snowbridge'] +snowbridge-beacon-primitives = { path = "../../primitives/beacon" } +snowbridge-system = { path = "../../pallets/system" } +snowbridge-system-runtime-api = { path = "../../pallets/system/runtime-api" } +snowbridge-core = { path = "../../primitives/core" } +snowbridge-ethereum-beacon-client = { path = "../../pallets/ethereum-beacon-client" } +snowbridge-inbound-queue = { path = "../../pallets/inbound-queue" } +snowbridge-outbound-queue = { path = "../../pallets/outbound-queue" } +snowbridge-outbound-queue-runtime-api = { path = "../../pallets/outbound-queue/runtime-api" } +snowbridge-router-primitives = { path = "../../primitives/router" } +snowbridge-runtime-common = { path = "../../runtime/runtime-common" } diff --git a/polkadot-sdk b/polkadot-sdk index 27c82f9d8..545c5e854 160000 --- a/polkadot-sdk +++ b/polkadot-sdk @@ -1 +1 @@ -Subproject commit 27c82f9d860e608e256d2bd68e91a8e658cb5734 +Subproject commit 545c5e8544170844d914c85232c05a32c309f548 diff --git a/smoketest/src/constants.rs b/smoketest/src/constants.rs index d695f6891..1030441d5 100644 --- a/smoketest/src/constants.rs +++ b/smoketest/src/constants.rs @@ -47,8 +47,8 @@ pub const FERDIE: [u8; 32] = hex!("1cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c"); lazy_static! { - pub static ref REGISTER_TOKEN_FEE: u128 = env::var("REGISTER_TOKEN_FEE") - .unwrap_or("100000000000000000".to_string()) + pub static ref REGISTER_TOKEN_FEE: u64 = env::var("REGISTER_TOKEN_FEE") + .unwrap_or("200000000000000000".to_string()) .parse() .unwrap(); pub static ref CREATE_ASSET_FEE: u128 = env::var("CREATE_ASSET_FEE") diff --git a/smoketest/src/helper.rs b/smoketest/src/helper.rs index b08a62b60..c29a78d2f 100644 --- a/smoketest/src/helper.rs +++ b/smoketest/src/helper.rs @@ -257,7 +257,7 @@ pub async fn fund_account( pub async fn construct_create_agent_call( bridge_hub_client: &Box>, ) -> Result, Box> { - let call = bridgehub::api::ethereum_control::calls::TransactionApi + let call = bridgehub::api::ethereum_system::calls::TransactionApi .create_agent() .encode_call_data(&bridge_hub_client.metadata())?; @@ -267,7 +267,7 @@ pub async fn construct_create_agent_call( pub async fn construct_create_channel_call( bridge_hub_client: &Box>, ) -> Result, Box> { - let call = bridgehub::api::ethereum_control::calls::TransactionApi + let call = bridgehub::api::ethereum_system::calls::TransactionApi .create_channel(OperatingMode::Normal) .encode_call_data(&bridge_hub_client.metadata())?; @@ -279,7 +279,7 @@ pub async fn construct_transfer_native_from_agent_call( recipient: H160, amount: u128, ) -> Result, Box> { - let call = bridgehub::api::ethereum_control::calls::TransactionApi + let call = bridgehub::api::ethereum_system::calls::TransactionApi .transfer_native_from_agent(recipient, amount) .encode_call_data(&bridge_hub_client.metadata())?; diff --git a/smoketest/tests/create_agent.rs b/smoketest/tests/create_agent.rs index ffefd28ff..5f15dd2a0 100644 --- a/smoketest/tests/create_agent.rs +++ b/smoketest/tests/create_agent.rs @@ -1,6 +1,6 @@ use snowbridge_smoketest::{ contracts::i_gateway::AgentCreatedFilter, helper::*, - parachains::bridgehub::api::ethereum_control::events::CreateAgent, + parachains::bridgehub::api::ethereum_system::events::CreateAgent, xcm::construct_xcm_message_with_fee, }; diff --git a/smoketest/tests/create_channel.rs b/smoketest/tests/create_channel.rs index 668995096..bf611f807 100644 --- a/smoketest/tests/create_channel.rs +++ b/smoketest/tests/create_channel.rs @@ -1,6 +1,6 @@ use snowbridge_smoketest::{ contracts::i_gateway::ChannelCreatedFilter, helper::*, - parachains::bridgehub::api::ethereum_control::events::CreateChannel, + parachains::bridgehub::api::ethereum_system::events::CreateChannel, xcm::construct_xcm_message_with_fee, }; diff --git a/smoketest/tests/set_pricing_params.rs b/smoketest/tests/set_pricing_params.rs index fde7509a2..152d867fa 100644 --- a/smoketest/tests/set_pricing_params.rs +++ b/smoketest/tests/set_pricing_params.rs @@ -4,7 +4,7 @@ use snowbridge_smoketest::{ contracts::{i_gateway, i_gateway::PricingParametersChangedFilter}, helper::*, parachains::bridgehub::api::{ - ethereum_control::events::PricingParametersChanged, + ethereum_system::events::PricingParametersChanged, runtime_types::{ self, bridge_hub_rococo_runtime::RuntimeCall as BHRuntimeCall, @@ -22,11 +22,11 @@ async fn set_pricing_params() { let gateway_addr: Address = GATEWAY_PROXY_CONTRACT.into(); let ethereum_client = *(test_clients.ethereum_client.clone()); let gateway = i_gateway::IGateway::new(gateway_addr, ethereum_client.clone()); - let params = gateway.get_pricing_parameters().await.expect("get fees"); + let params = gateway.pricing_parameters().await.expect("get fees"); println!("pricing params {:?}", params); - let set_pricing_params_call = BHRuntimeCall::EthereumControl( - runtime_types::snowbridge_control::pallet::Call::set_pricing_parameters { + let set_pricing_params_call = BHRuntimeCall::EthereumSystem( + runtime_types::snowbridge_system::pallet::Call::set_pricing_parameters { params: PricingParameters { exchange_rate: FixedU128(*EXCHANGE_RATE), rewards: Rewards { local: *LOCAL_REWARD, remote: U256([*REMOTE_REWARD, 0, 0, 0]) }, @@ -43,6 +43,6 @@ async fn set_pricing_params() { wait_for_ethereum_event::(&test_clients.ethereum_client).await; - let params = gateway.get_pricing_parameters().await.expect("get fees"); + let params = gateway.pricing_parameters().await.expect("get fees"); println!("pricing params {:?}", params); } diff --git a/smoketest/tests/set_token_transfer_fees.rs b/smoketest/tests/set_token_transfer_fees.rs index 3465dff3e..e73cac6e6 100644 --- a/smoketest/tests/set_token_transfer_fees.rs +++ b/smoketest/tests/set_token_transfer_fees.rs @@ -4,8 +4,10 @@ use snowbridge_smoketest::{ contracts::{i_gateway, i_gateway::TokenTransferFeesChangedFilter}, helper::*, parachains::bridgehub::api::{ - ethereum_control::events::SetTokenTransferFees, - runtime_types::{self, bridge_hub_rococo_runtime::RuntimeCall as BHRuntimeCall}, + ethereum_system::events::SetTokenTransferFees, + runtime_types::{ + self, bridge_hub_rococo_runtime::RuntimeCall as BHRuntimeCall, primitive_types::U256, + }, }, }; @@ -16,14 +18,14 @@ async fn set_token_transfer_fees() { let gateway_addr: Address = GATEWAY_PROXY_CONTRACT.into(); let ethereum_client = *(test_clients.ethereum_client.clone()); let gateway = i_gateway::IGateway::new(gateway_addr, ethereum_client.clone()); - let fees = gateway.register_token_fee().await.expect("get fees"); + let fees = gateway.quote_register_token_fee().await.expect("get fees"); println!("register fees {:?}", fees); - let set_token_fees_call = BHRuntimeCall::EthereumControl( - runtime_types::snowbridge_control::pallet::Call::set_token_transfer_fees { - create: *CREATE_ASSET_FEE, - transfer: *RESERVE_TRANSFER_FEE, - register: *REGISTER_TOKEN_FEE, + let set_token_fees_call = BHRuntimeCall::EthereumSystem( + runtime_types::snowbridge_system::pallet::Call::set_token_transfer_fees { + create_asset_xcm: *CREATE_ASSET_FEE, + transfer_asset_xcm: *RESERVE_TRANSFER_FEE, + register_token: U256([*REGISTER_TOKEN_FEE, 0, 0, 0]), }, ); @@ -35,6 +37,6 @@ async fn set_token_transfer_fees() { wait_for_ethereum_event::(&test_clients.ethereum_client).await; - let fees = gateway.register_token_fee().await.expect("get fees"); + let fees = gateway.quote_register_token_fee().await.expect("get fees"); println!("asset fees {:?}", fees); } diff --git a/smoketest/tests/transfer_native_from_agent.rs b/smoketest/tests/transfer_native_from_agent.rs index 8c78cc4c3..82aff0913 100644 --- a/smoketest/tests/transfer_native_from_agent.rs +++ b/smoketest/tests/transfer_native_from_agent.rs @@ -3,7 +3,7 @@ use snowbridge_smoketest::{ constants::*, contracts::{i_gateway, i_gateway::InboundMessageDispatchedFilter}, helper::*, - parachains::bridgehub::api::ethereum_control::events::TransferNativeFromAgent, + parachains::bridgehub::api::ethereum_system::events::TransferNativeFromAgent, xcm::construct_xcm_message_with_fee, }; diff --git a/smoketest/tests/upgrade_gateway.rs b/smoketest/tests/upgrade_gateway.rs index 2eeceee72..726785a16 100644 --- a/smoketest/tests/upgrade_gateway.rs +++ b/smoketest/tests/upgrade_gateway.rs @@ -17,7 +17,7 @@ use snowbridge_smoketest::{ parachains::{ bridgehub::{ self, - api::{ethereum_control, runtime_types::snowbridge_core::outbound::v1::Initializer}, + api::{ethereum_system, runtime_types::snowbridge_core::outbound::v1::Initializer}, }, relaychain, relaychain::api::runtime_types::{ @@ -67,7 +67,7 @@ async fn upgrade_gateway() { let signer: PairSigner = PairSigner::new(sudo); - let ethereum_control_api = bridgehub::api::ethereum_control::calls::TransactionApi; + let ethereum_system_api = bridgehub::api::ethereum_system::calls::TransactionApi; let d_0 = 99; let d_1 = 66; @@ -81,7 +81,7 @@ async fn upgrade_gateway() { let gateway_upgrade_mock_code_hash = keccak256(code); // The upgrade call - let upgrade_call = ethereum_control_api + let upgrade_call = ethereum_system_api .upgrade( GATETWAY_UPGRADE_MOCK_CONTRACT.into(), gateway_upgrade_mock_code_hash.into(), @@ -132,7 +132,7 @@ async fn upgrade_gateway() { while let Some(Ok(block)) = blocks.next().await { println!("Polling bridgehub block {} for upgrade event.", block.number()); let upgrades = block.events().await.expect("read block events"); - for upgrade in upgrades.find::() { + for upgrade in upgrades.find::() { let _upgrade = upgrade.expect("expect upgrade"); println!("Event found at bridgehub block {}.", block.number()); upgrade_event_found = true; diff --git a/web/packages/test/scripts/set-env.sh b/web/packages/test/scripts/set-env.sh index f3a7c95ff..3adeeef3d 100755 --- a/web/packages/test/scripts/set-env.sh +++ b/web/packages/test/scripts/set-env.sh @@ -85,7 +85,7 @@ export MINIMUM_REQUIRED_SIGNATURES="${MINIMUM_REQUIRED_SIGNATURES:-16}" export REJECT_OUTBOUND_MESSAGES=false ## Fee -export REGISTER_TOKEN_FEE="${REGISTER_TOKEN_FEE:-100000000000000000}" +export REGISTER_TOKEN_FEE="${REGISTER_TOKEN_FEE:-200000000000000000}" export DELIVERY_COST="${DELIVERY_COST:-10000000000}" export CREATE_ASSET_FEE="${CREATE_ASSET_FEE:-10000000000}" export RESERVE_TRANSFER_FEE="${RESERVE_TRANSFER_FEE:-10000000000}"