Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions bridges/chains/chain-asset-hub-rococo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ scale-info = { features = ["derive"], workspace = true }

# Substrate Dependencies
frame-support = { workspace = true }
sp-api = { workspace = true }
sp-core = { workspace = true }

# Bridge Dependencies
Expand All @@ -41,6 +42,7 @@ std = [
"codec/std",
"frame-support/std",
"scale-info/std",
"sp-api/std",
"sp-core/std",
"testnet-parachains-constants/std",
"xcm/std",
Expand Down
35 changes: 33 additions & 2 deletions bridges/chains/chain-asset-hub-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ use scale_info::TypeInfo;

pub use bp_bridge_hub_cumulus::*;
use bp_messages::*;
use bp_runtime::{Chain, ChainId, Parachain};
use bp_runtime::{decl_bridge_finality_runtime_apis, decl_bridge_messages_runtime_apis, Chain, ChainId, Parachain};
pub use bp_xcm_bridge_hub_router::XcmBridgeHubRouterCall;
use frame_support::{
dispatch::DispatchClass,
sp_runtime::{RuntimeDebug, StateVersion},
sp_runtime::{MultiAddress, MultiSigner, RuntimeDebug, StateVersion},
};
use testnet_parachains_constants::rococo::currency::UNITS;
use xcm::latest::prelude::*;
Expand Down Expand Up @@ -118,3 +118,34 @@ impl Parachain for AssetHubRococo {
const PARACHAIN_ID: u32 = ASSET_HUB_ROCOCO_PARACHAIN_ID;
const MAX_HEADER_SIZE: u32 = MAX_ASSET_HUB_HEADER_SIZE;
}

/// Describing permissionless lanes instance
impl ChainWithMessages for AssetHubRococo {
const WITH_CHAIN_MESSAGES_PALLET_NAME: &'static str =
WITH_ASSET_HUB_ROCOCO_MESSAGES_PALLET_NAME;

const MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX: MessageNonce =
MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX;
const MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX: MessageNonce =
MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX;
}

/// Public key of the chain account that may be used to verify signatures.
pub type AccountSigner = MultiSigner;

/// The address format for describing accounts.
pub type Address = MultiAddress<AccountId, ()>;

/// Name of the With-AssetHubRococo messages pallet instance that is deployed at bridged chains.
pub const WITH_ASSET_HUB_ROCOCO_MESSAGES_PALLET_NAME: &str = "BridgeRococoMessages";

/// Name of the With-AssetHubRococo bridge-relayers pallet instance that is deployed at bridged
/// chains.
pub const WITH_ASSET_HUB_ROCOCO_RELAYERS_PALLET_NAME: &str = "BridgeRelayers";

/// Pallet index of `BridgeWestendMessages: pallet_bridge_messages::<Instance1>`.
pub const WITH_BRIDGE_ROCOCO_TO_WESTEND_MESSAGES_PALLET_INDEX: u8 = 62;

decl_bridge_finality_runtime_apis!(asset_hub_rococo);
decl_bridge_messages_runtime_apis!(asset_hub_rococo, HashedLaneId);

2 changes: 2 additions & 0 deletions bridges/chains/chain-asset-hub-westend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ scale-info = { features = ["derive"], workspace = true }

# Substrate Dependencies
frame-support = { workspace = true }
sp-api = { workspace = true }
sp-core = { workspace = true }

# Bridge Dependencies
Expand All @@ -41,6 +42,7 @@ std = [
"codec/std",
"frame-support/std",
"scale-info/std",
"sp-api/std",
"sp-core/std",
"testnet-parachains-constants/std",
"xcm/std",
Expand Down
35 changes: 33 additions & 2 deletions bridges/chains/chain-asset-hub-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ extern crate alloc;

pub use bp_bridge_hub_cumulus::*;
use bp_messages::*;
use bp_runtime::{Chain, ChainId, Parachain};
use bp_runtime::{decl_bridge_finality_runtime_apis, decl_bridge_messages_runtime_apis, Chain, ChainId, Parachain};
pub use bp_xcm_bridge_hub_router::XcmBridgeHubRouterCall;
use codec::{Decode, Encode};
use frame_support::{
dispatch::DispatchClass,
sp_runtime::{RuntimeDebug, StateVersion},
sp_runtime::{MultiAddress, MultiSigner, RuntimeDebug, StateVersion},
};
use scale_info::TypeInfo;
use testnet_parachains_constants::westend::currency::UNITS;
Expand Down Expand Up @@ -117,3 +117,34 @@ impl Parachain for AssetHubWestend {
const PARACHAIN_ID: u32 = ASSET_HUB_WESTEND_PARACHAIN_ID;
const MAX_HEADER_SIZE: u32 = MAX_ASSET_HUB_HEADER_SIZE;
}

/// Describing permissionless lanes instance
impl ChainWithMessages for AssetHubWestend {
const WITH_CHAIN_MESSAGES_PALLET_NAME: &'static str =
WITH_ASSET_HUB_WESTEND_MESSAGES_PALLET_NAME;

const MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX: MessageNonce =
MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX;
const MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX: MessageNonce =
MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX;
}

/// Public key of the chain account that may be used to verify signatures.
pub type AccountSigner = MultiSigner;

/// The address format for describing accounts.
pub type Address = MultiAddress<AccountId, ()>;

/// Name of the With-AssetHubWestend messages pallet instance that is deployed at bridged chains.
pub const WITH_ASSET_HUB_WESTEND_MESSAGES_PALLET_NAME: &str = "BridgeWestendMessages";

/// Name of the With-AssetHubWestend bridge-relayers pallet instance that is deployed at bridged
/// chains.
pub const WITH_ASSET_HUB_WESTEND_RELAYERS_PALLET_NAME: &str = "BridgeRelayers";

/// Pallet index of `BridgeRococoMessages: pallet_bridge_messages::<Instance1>`.
pub const WITH_BRIDGE_WESTEND_TO_ROCOCO_MESSAGES_PALLET_INDEX: u8 = 60; // TODO: FAIL-CI - correct index when AssetHubWestend

decl_bridge_finality_runtime_apis!(asset_hub_westend);
decl_bridge_messages_runtime_apis!(asset_hub_westend, HashedLaneId);

Loading