Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
Merge branch 'snowbridge' into update-from-adrian
Browse files Browse the repository at this point in the history
# Conflicts:
#	Cargo.lock
#	cumulus/parachains/integration-tests/emulated/bridges/bridge-hub-rococo/Cargo.toml
#	cumulus/parachains/integration-tests/emulated/bridges/bridge-hub-rococo/src/tests/snowbridge.rs
#	cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs
#	cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs
  • Loading branch information
claravanstaden authored and claravanstaden committed Nov 13, 2023
2 parents 3714bb9 + 5fec1d3 commit 9067034
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,16 @@ pallet-bridge-relayers = { path = "../../../../../bridges/modules/relayers", def
bridge-runtime-common = { path = "../../../../../bridges/bin/runtime-common", default-features = false }

# Ethereum Bridge (Snowbridge)
snowbridge-core = { path = "../../../../../../parachain/primitives/core", default-features = false }
snowbridge-beacon-primitives = { path = "../../../../../../parachain/primitives/beacon", default-features = false }
snowbridge-router-primitives = { path = "../../../../../../parachain/primitives/router", default-features = false }
snowbridge-control = { path = "../../../../../../parachain/pallets/control", default-features = false }
snowbridge-control-runtime-api = { path = "../../../../../../parachain/pallets/control/runtime-api", default-features = false }
snowbridge-core = { path = "../../../../../../parachain/primitives/core", default-features = false }
snowbridge-ethereum-beacon-client = { path = "../../../../../../parachain/pallets/ethereum-beacon-client", default-features = false }
snowbridge-inbound-queue = { path = "../../../../../../parachain/pallets/inbound-queue", default-features = false }
snowbridge-outbound-queue = { path = "../../../../../../parachain/pallets/outbound-queue", default-features = false }
snowbridge-outbound-queue-runtime-api = { path = "../../../../../../parachain/pallets/outbound-queue/runtime-api", default-features = false }
snowbridge-control = { path = "../../../../../../parachain/pallets/control", default-features = false }
snowbridge-control-runtime-api = { path = "../../../../../../parachain/pallets/control/runtime-api", default-features = false }
snowbridge-router-primitives = { path = "../../../../../../parachain/primitives/router", default-features = false }
snowbridge-runtime-common = { path = "../../../../../../parachain/runtime/runtime-common", default-features = false }

bridge-hub-common = { path = "../common", default-features = false }

Expand Down Expand Up @@ -196,15 +197,16 @@ std = [
"xcm-builder/std",
"xcm-executor/std",
"xcm/std",
"snowbridge-core/std",
"snowbridge-router-primitives/std",
"snowbridge-beacon-primitives/std",
"snowbridge-control-runtime-api/std",
"snowbridge-control/std",
"snowbridge-core/std",
"snowbridge-ethereum-beacon-client/std",
"snowbridge-inbound-queue/std",
"snowbridge-outbound-queue/std",
"snowbridge-outbound-queue-runtime-api/std",
"snowbridge-control/std",
"snowbridge-control-runtime-api/std",
"snowbridge-outbound-queue/std",
"snowbridge-router-primitives/std",
"snowbridge-runtime-common/std",
"substrate-wasm-builder",
]

Expand Down Expand Up @@ -239,11 +241,12 @@ runtime-benchmarks = [
"sp-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
"snowbridge-core/runtime-benchmarks",
"snowbridge-control/runtime-benchmarks",
"snowbridge-core/runtime-benchmarks",
"snowbridge-ethereum-beacon-client/runtime-benchmarks",
"snowbridge-inbound-queue/runtime-benchmarks",
"snowbridge-outbound-queue/runtime-benchmarks",
"snowbridge-ethereum-beacon-client/runtime-benchmarks"
"snowbridge-runtime-common/runtime-benchmarks",
]

try-runtime = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ use sp_api::impl_runtime_apis;
use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H160};
use sp_runtime::{
create_runtime_str, generic, impl_opaque_keys,
traits::{AccountIdConversion, AccountIdLookup, BlakeTwo256, Block as BlockT, Keccak256},
traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, Keccak256},
transaction_validity::{TransactionSource, TransactionValidity},
ApplyExtrinsicResult,
};
Expand Down Expand Up @@ -80,7 +80,7 @@ use pallet_xcm::EnsureXcm;
pub use sp_consensus_aura::sr25519::AuthorityId as AuraId;
pub use sp_runtime::{MultiAddress, Perbill, Permill};
use xcm::VersionedMultiLocation;
use xcm_config::{XcmOriginToTransactDispatchOrigin, XcmRouter};
use xcm_config::{TreasuryAccount, XcmRouter, XcmOriginToTransactDispatchOrigin};

use bp_runtime::HeaderId;
use bridge_hub_common::{
Expand Down Expand Up @@ -529,7 +529,8 @@ parameter_types! {
pub const GatewayAddress: H160 = H160(hex_literal::hex!("EDa338E4dC46038493b885327842fD3E301CaB39"));
pub const CreateAssetCall: [u8;2] = [53, 0];
pub const CreateAssetExecutionFee: u128 = 2_000_000_000;
pub const SendTokenExecutionFee: u128 = 1_000_000_000;
pub const CreateAssetDeposit: u128 = (UNITS / 10) + EXISTENTIAL_DEPOSIT;
pub const SendTokenExecutionFee: u128 = 2_000_000_000;
}

#[cfg(feature = "runtime-benchmarks")]
Expand All @@ -552,8 +553,14 @@ impl snowbridge_inbound_queue::Config for Runtime {
type GatewayAddress = GatewayAddress;
#[cfg(feature = "runtime-benchmarks")]
type Helper = Runtime;
type MessageConverter =
MessageToXcm<CreateAssetCall, CreateAssetExecutionFee, SendTokenExecutionFee>;
type MessageConverter = MessageToXcm<
CreateAssetCall,
CreateAssetExecutionFee,
CreateAssetDeposit,
SendTokenExecutionFee,
AccountId,
Balance,
>;
type WeightToFee = WeightToFee;
}

Expand Down Expand Up @@ -630,10 +637,6 @@ parameter_types! {
pub const RelayNetwork: NetworkId = Rococo;
}

parameter_types! {
pub TreasuryAccount: AccountId = PalletId(*b"py/trsry").into_account_truncating();
}

#[cfg(feature = "runtime-benchmarks")]
impl snowbridge_control::BenchmarkHelper<RuntimeOrigin> for () {
fn make_xcm_origin(location: xcm::latest::MultiLocation) -> RuntimeOrigin {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ use parachains_common::{
use polkadot_parachain_primitives::primitives::Sibling;
use polkadot_runtime_common::xcm_sender::ExponentialPrice;
use rococo_runtime_constants::system_parachain::SystemParachains;
use snowbridge_runtime_common::XcmExportFeeToSibling;
use sp_core::{Get, H256};
use sp_runtime::traits::AccountIdConversion;
use sp_std::marker::PhantomData;
Expand Down Expand Up @@ -317,6 +318,14 @@ impl xcm_executor::Config for XcmConfig {
crate::bridge_to_rococo_config::BridgeHubRococoChainId,
crate::bridge_to_rococo_config::AssetHubWococoToAssetHubRococoMessagesLane,
>,
XcmExportFeeToSibling<
bp_rococo::Balance,
AccountId,
TokenLocation,
EthereumNetwork,
Self::AssetTransactor,
crate::EthereumOutboundQueue,
>,
XcmFeeToAccount<Self::AssetTransactor, AccountId, TreasuryAccount>,
),
>;
Expand Down

0 comments on commit 9067034

Please sign in to comment.