mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 22:01:04 +00:00
BridgeHub fixes
This commit is contained in:
@@ -73,7 +73,6 @@ parachains-common = { path = "../../../../parachains/common", default-features =
|
||||
bp-bridge-hub-rococo = { path = "../../../../bridges/primitives/chain-bridge-hub-rococo", default-features = false }
|
||||
bp-bridge-hub-wococo = { path = "../../../../bridges/primitives/chain-bridge-hub-wococo", default-features = false }
|
||||
bp-messages = { path = "../../../../bridges/primitives/messages", default-features = false }
|
||||
bp-polkadot-core = { path = "../../../../bridges/primitives/polkadot-core", default-features = false }
|
||||
bp-runtime = { path = "../../../../bridges/primitives/runtime", default-features = false }
|
||||
bp-rococo = { path = "../../../../bridges/primitives/chain-rococo", default-features = false }
|
||||
bp-wococo = { path = "../../../../bridges/primitives/chain-wococo", default-features = false }
|
||||
@@ -91,7 +90,6 @@ default = [
|
||||
std = [
|
||||
"bp-bridge-hub-rococo/std",
|
||||
"bp-bridge-hub-wococo/std",
|
||||
"bp-polkadot-core/std",
|
||||
"bp-messages/std",
|
||||
"bp-runtime/std",
|
||||
"bp-rococo/std",
|
||||
|
||||
@@ -15,22 +15,21 @@
|
||||
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::{
|
||||
ParachainInfo, Runtime, WithBridgeHubWococoMessagesInstance, XcmAsPlainPayload, XcmBlobHauler,
|
||||
XcmBlobHaulerAdapter, XcmRouter,
|
||||
BridgeParachainWococoInstance, ParachainInfo, Runtime, WithBridgeHubWococoMessagesInstance,
|
||||
XcmAsPlainPayload, XcmBlobHauler, XcmBlobHaulerAdapter, XcmRouter,
|
||||
};
|
||||
use bp_messages::{
|
||||
source_chain::TargetHeaderChain,
|
||||
target_chain::{ProvedMessages, SourceHeaderChain},
|
||||
InboundLaneData, LaneId, Message, MessageNonce,
|
||||
};
|
||||
use bp_polkadot_core::parachains::ParaId;
|
||||
use bp_runtime::{Chain, ChainId};
|
||||
use bp_runtime::ChainId;
|
||||
use bridge_runtime_common::{
|
||||
messages,
|
||||
messages::{
|
||||
target::FromBridgedChainMessagesProof, BasicConfirmationTransactionEstimation,
|
||||
BridgedChain, ChainWithMessages, MessageBridge, MessageTransaction, ThisChain,
|
||||
ThisChainWithMessages,
|
||||
BridgedChain, MessageBridge, MessageTransaction, ThisChain, ThisChainWithMessages,
|
||||
UnderlyingChainProvider,
|
||||
},
|
||||
};
|
||||
use frame_support::{dispatch::Weight, parameter_types, RuntimeDebug};
|
||||
@@ -89,6 +88,11 @@ impl MessageBridge for WithBridgeHubWococoMessageBridge {
|
||||
bp_bridge_hub_rococo::WITH_BRIDGE_HUB_ROCOCO_MESSAGES_PALLET_NAME;
|
||||
type ThisChain = BridgeHubRococo;
|
||||
type BridgedChain = BridgeHubWococo;
|
||||
type BridgedHeaderChain = pallet_bridge_parachains::ParachainHeaders<
|
||||
Runtime,
|
||||
BridgeParachainWococoInstance,
|
||||
bp_bridge_hub_wococo::BridgeHubWococo,
|
||||
>;
|
||||
|
||||
fn bridged_balance_to_this_balance(
|
||||
bridged_balance: bridge_runtime_common::messages::BalanceOf<BridgedChain<Self>>,
|
||||
@@ -112,12 +116,8 @@ pub type ToBridgeHubWococoMaximalOutboundPayloadSize =
|
||||
#[derive(RuntimeDebug, Clone, Copy)]
|
||||
pub struct BridgeHubWococo;
|
||||
|
||||
impl ChainWithMessages for BridgeHubWococo {
|
||||
type Hash = bp_bridge_hub_wococo::Hash;
|
||||
type AccountId = bp_bridge_hub_wococo::AccountId;
|
||||
type Signer = bp_bridge_hub_wococo::AccountSigner;
|
||||
type Signature = bp_bridge_hub_wococo::Signature;
|
||||
type Balance = bp_bridge_hub_wococo::Balance;
|
||||
impl UnderlyingChainProvider for BridgeHubWococo {
|
||||
type Chain = bp_bridge_hub_wococo::BridgeHubWococo;
|
||||
}
|
||||
|
||||
impl SourceHeaderChain<crate::Balance> for BridgeHubWococo {
|
||||
@@ -128,12 +128,10 @@ impl SourceHeaderChain<crate::Balance> for BridgeHubWococo {
|
||||
proof: Self::MessagesProof,
|
||||
messages_count: u32,
|
||||
) -> Result<ProvedMessages<Message<crate::Balance>>, Self::Error> {
|
||||
bridge_runtime_common::messages::target::verify_messages_proof_from_parachain::<
|
||||
bridge_runtime_common::messages::target::verify_messages_proof::<
|
||||
WithBridgeHubWococoMessageBridge,
|
||||
bp_bridge_hub_wococo::Header,
|
||||
crate::Runtime,
|
||||
crate::BridgeParachainWococoInstance,
|
||||
>(ParaId(bp_bridge_hub_wococo::BRIDGE_HUB_WOCOCO_PARACHAIN_ID), proof, messages_count)
|
||||
>(proof, messages_count)
|
||||
.map_err(Into::into)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,20 +147,11 @@ impl TargetHeaderChain<XcmAsPlainPayload, crate::AccountId> for BridgeHubWococo
|
||||
fn verify_messages_delivery_proof(
|
||||
proof: Self::MessagesDeliveryProof,
|
||||
) -> Result<(LaneId, InboundLaneData<bp_bridge_hub_rococo::AccountId>), Self::Error> {
|
||||
messages::source::verify_messages_delivery_proof_from_parachain::<
|
||||
WithBridgeHubWococoMessageBridge,
|
||||
bp_bridge_hub_wococo::Header,
|
||||
crate::Runtime,
|
||||
crate::BridgeParachainWococoInstance,
|
||||
>(ParaId(bp_bridge_hub_wococo::BRIDGE_HUB_WOCOCO_PARACHAIN_ID), proof)
|
||||
messages::source::verify_messages_delivery_proof::<WithBridgeHubWococoMessageBridge>(proof)
|
||||
}
|
||||
}
|
||||
|
||||
impl messages::BridgedChainWithMessages for BridgeHubWococo {
|
||||
fn maximal_extrinsic_size() -> u32 {
|
||||
bp_bridge_hub_wococo::BridgeHubWococo::max_extrinsic_size()
|
||||
}
|
||||
|
||||
fn verify_dispatch_weight(_message_payload: &[u8]) -> bool {
|
||||
true
|
||||
}
|
||||
@@ -206,19 +195,15 @@ impl messages::BridgedChainWithMessages for BridgeHubWococo {
|
||||
#[derive(RuntimeDebug, Clone, Copy)]
|
||||
pub struct BridgeHubRococo;
|
||||
|
||||
impl ChainWithMessages for BridgeHubRococo {
|
||||
type Hash = bp_bridge_hub_rococo::Hash;
|
||||
type AccountId = bp_bridge_hub_rococo::AccountId;
|
||||
type Signer = bp_bridge_hub_rococo::AccountSigner;
|
||||
type Signature = bp_bridge_hub_rococo::Signature;
|
||||
type Balance = bp_bridge_hub_rococo::Balance;
|
||||
impl UnderlyingChainProvider for BridgeHubRococo {
|
||||
type Chain = bp_bridge_hub_rococo::BridgeHubRococo;
|
||||
}
|
||||
|
||||
impl ThisChainWithMessages for BridgeHubRococo {
|
||||
type RuntimeOrigin = crate::RuntimeOrigin;
|
||||
type RuntimeCall = crate::RuntimeCall;
|
||||
type ConfirmationTransactionEstimation = BasicConfirmationTransactionEstimation<
|
||||
Self::AccountId,
|
||||
bp_bridge_hub_rococo::AccountId,
|
||||
{ bp_bridge_hub_rococo::MAX_SINGLE_MESSAGE_DELIVERY_CONFIRMATION_TX_WEIGHT.ref_time() },
|
||||
{ bp_bridge_hub_wococo::EXTRA_STORAGE_PROOF_SIZE },
|
||||
{ bp_bridge_hub_rococo::TX_EXTRA_BYTES },
|
||||
|
||||
@@ -15,22 +15,21 @@
|
||||
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::{
|
||||
ParachainInfo, Runtime, WithBridgeHubRococoMessagesInstance, XcmAsPlainPayload, XcmBlobHauler,
|
||||
XcmBlobHaulerAdapter, XcmRouter,
|
||||
BridgeParachainRococoInstance, ParachainInfo, Runtime, WithBridgeHubRococoMessagesInstance,
|
||||
XcmAsPlainPayload, XcmBlobHauler, XcmBlobHaulerAdapter, XcmRouter,
|
||||
};
|
||||
use bp_messages::{
|
||||
source_chain::TargetHeaderChain,
|
||||
target_chain::{ProvedMessages, SourceHeaderChain},
|
||||
InboundLaneData, LaneId, Message, MessageNonce,
|
||||
};
|
||||
use bp_polkadot_core::parachains::ParaId;
|
||||
use bp_runtime::{Chain, ChainId};
|
||||
use bp_runtime::ChainId;
|
||||
use bridge_runtime_common::{
|
||||
messages,
|
||||
messages::{
|
||||
target::FromBridgedChainMessagesProof, BasicConfirmationTransactionEstimation,
|
||||
BridgedChain, ChainWithMessages, MessageBridge, MessageTransaction, ThisChain,
|
||||
ThisChainWithMessages,
|
||||
BridgedChain, MessageBridge, MessageTransaction, ThisChain, ThisChainWithMessages,
|
||||
UnderlyingChainProvider,
|
||||
},
|
||||
};
|
||||
use frame_support::{dispatch::Weight, parameter_types, RuntimeDebug};
|
||||
@@ -89,6 +88,11 @@ impl MessageBridge for WithBridgeHubRococoMessageBridge {
|
||||
bp_bridge_hub_wococo::WITH_BRIDGE_HUB_WOCOCO_MESSAGES_PALLET_NAME;
|
||||
type ThisChain = BridgeHubWococo;
|
||||
type BridgedChain = BridgeHubRococo;
|
||||
type BridgedHeaderChain = pallet_bridge_parachains::ParachainHeaders<
|
||||
Runtime,
|
||||
BridgeParachainRococoInstance,
|
||||
bp_bridge_hub_rococo::BridgeHubRococo,
|
||||
>;
|
||||
|
||||
fn bridged_balance_to_this_balance(
|
||||
bridged_balance: bridge_runtime_common::messages::BalanceOf<BridgedChain<Self>>,
|
||||
@@ -112,12 +116,8 @@ pub type ToBridgeHubRococoMaximalOutboundPayloadSize =
|
||||
#[derive(RuntimeDebug, Clone, Copy)]
|
||||
pub struct BridgeHubRococo;
|
||||
|
||||
impl ChainWithMessages for BridgeHubRococo {
|
||||
type Hash = bp_bridge_hub_rococo::Hash;
|
||||
type AccountId = bp_bridge_hub_rococo::AccountId;
|
||||
type Signer = bp_bridge_hub_rococo::AccountSigner;
|
||||
type Signature = bp_bridge_hub_rococo::Signature;
|
||||
type Balance = bp_bridge_hub_rococo::Balance;
|
||||
impl UnderlyingChainProvider for BridgeHubRococo {
|
||||
type Chain = bp_bridge_hub_rococo::BridgeHubRococo;
|
||||
}
|
||||
|
||||
impl SourceHeaderChain<crate::Balance> for BridgeHubRococo {
|
||||
@@ -128,12 +128,10 @@ impl SourceHeaderChain<crate::Balance> for BridgeHubRococo {
|
||||
proof: Self::MessagesProof,
|
||||
messages_count: u32,
|
||||
) -> Result<ProvedMessages<Message<crate::Balance>>, Self::Error> {
|
||||
bridge_runtime_common::messages::target::verify_messages_proof_from_parachain::<
|
||||
bridge_runtime_common::messages::target::verify_messages_proof::<
|
||||
WithBridgeHubRococoMessageBridge,
|
||||
bp_bridge_hub_rococo::Header,
|
||||
crate::Runtime,
|
||||
crate::BridgeParachainRococoInstance,
|
||||
>(ParaId(bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID), proof, messages_count)
|
||||
>(proof, messages_count)
|
||||
.map_err(Into::into)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,20 +147,11 @@ impl TargetHeaderChain<XcmAsPlainPayload, crate::AccountId> for BridgeHubRococo
|
||||
fn verify_messages_delivery_proof(
|
||||
proof: Self::MessagesDeliveryProof,
|
||||
) -> Result<(LaneId, InboundLaneData<bp_bridge_hub_wococo::AccountId>), Self::Error> {
|
||||
messages::source::verify_messages_delivery_proof_from_parachain::<
|
||||
WithBridgeHubRococoMessageBridge,
|
||||
bp_bridge_hub_rococo::Header,
|
||||
crate::Runtime,
|
||||
crate::BridgeParachainRococoInstance,
|
||||
>(ParaId(bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID), proof)
|
||||
messages::source::verify_messages_delivery_proof::<WithBridgeHubRococoMessageBridge>(proof)
|
||||
}
|
||||
}
|
||||
|
||||
impl messages::BridgedChainWithMessages for BridgeHubRococo {
|
||||
fn maximal_extrinsic_size() -> u32 {
|
||||
bp_bridge_hub_rococo::BridgeHubRococo::max_extrinsic_size()
|
||||
}
|
||||
|
||||
fn verify_dispatch_weight(_message_payload: &[u8]) -> bool {
|
||||
true
|
||||
}
|
||||
@@ -206,19 +195,15 @@ impl messages::BridgedChainWithMessages for BridgeHubRococo {
|
||||
#[derive(RuntimeDebug, Clone, Copy)]
|
||||
pub struct BridgeHubWococo;
|
||||
|
||||
impl ChainWithMessages for BridgeHubWococo {
|
||||
type Hash = bp_bridge_hub_wococo::Hash;
|
||||
type AccountId = bp_bridge_hub_wococo::AccountId;
|
||||
type Signer = bp_bridge_hub_wococo::AccountSigner;
|
||||
type Signature = bp_bridge_hub_wococo::Signature;
|
||||
type Balance = bp_bridge_hub_wococo::Balance;
|
||||
impl UnderlyingChainProvider for BridgeHubWococo {
|
||||
type Chain = bp_bridge_hub_wococo::BridgeHubWococo;
|
||||
}
|
||||
|
||||
impl ThisChainWithMessages for BridgeHubWococo {
|
||||
type RuntimeOrigin = crate::RuntimeOrigin;
|
||||
type RuntimeCall = crate::RuntimeCall;
|
||||
type ConfirmationTransactionEstimation = BasicConfirmationTransactionEstimation<
|
||||
Self::AccountId,
|
||||
bp_bridge_hub_wococo::AccountId,
|
||||
{ bp_bridge_hub_wococo::MAX_SINGLE_MESSAGE_DELIVERY_CONFIRMATION_TX_WEIGHT.ref_time() },
|
||||
{ bp_bridge_hub_rococo::EXTRA_STORAGE_PROOF_SIZE },
|
||||
{ bp_bridge_hub_wococo::TX_EXTRA_BYTES },
|
||||
|
||||
Reference in New Issue
Block a user