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

Commit

Permalink
adds more config
Browse files Browse the repository at this point in the history
  • Loading branch information
claravanstaden authored and claravanstaden committed Sep 14, 2023
1 parent 6f6c023 commit c15198d
Showing 1 changed file with 18 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ use sp_runtime::{
transaction_validity::{TransactionSource, TransactionValidity},
ApplyExtrinsicResult,
};
use xcm::v3::NetworkId::{self, Rococo};
use xcm_config::{EthereumGatewayAddress, RelayLocation, UniversalLocation};

use sp_std::prelude::*;
#[cfg(feature = "std")]
Expand Down Expand Up @@ -73,7 +71,8 @@ use pallet_xcm::EnsureXcm;

pub use sp_consensus_aura::sr25519::AuthorityId as AuraId;
pub use sp_runtime::{MultiAddress, Perbill, Permill};
use xcm_config::{XcmConfig, XcmOriginToTransactDispatchOrigin};
use xcm::v3::NetworkId::{self, Rococo};
use xcm_config::{EthereumGatewayAddress, RelayLocation, UniversalLocation, XcmConfig, XcmOriginToTransactDispatchOrigin};

use bp_parachains::SingleParaStoredHeaderDataBuilder;
use bp_runtime::HeaderId;
Expand Down Expand Up @@ -136,7 +135,7 @@ pub type SignedExtra = (

/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic =
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;

/// Migrations to apply on runtime upgrade.
pub type Migrations = (pallet_collator_selection::migration::v1::MigrateToV1<Runtime>,);
Expand Down Expand Up @@ -293,7 +292,7 @@ parameter_types! {
impl pallet_transaction_payment::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type OnChargeTransaction =
pallet_transaction_payment::CurrencyAdapter<Balances, DealWithFees<Runtime>>;
pallet_transaction_payment::CurrencyAdapter<Balances, DealWithFees<Runtime>>;
type OperationalFeeMultiplier = ConstU8<5>;
type WeightToFee = WeightToFee;
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
Expand Down Expand Up @@ -484,7 +483,7 @@ impl pallet_bridge_parachains::Config<BridgeParachainWococoInstance> for Runtime
type BridgesGrandpaPalletInstance = BridgeGrandpaWococoInstance;
type ParasPalletName = WococoBridgeParachainPalletName;
type ParaStoredHeaderDataBuilder =
SingleParaStoredHeaderDataBuilder<bp_bridge_hub_wococo::BridgeHubWococo>;
SingleParaStoredHeaderDataBuilder<bp_bridge_hub_wococo::BridgeHubWococo>;
type HeadsToKeep = ParachainHeadsToKeep;
type MaxParaHeadDataSize = MaxWococoParaHeadDataSize;
}
Expand All @@ -497,7 +496,7 @@ impl pallet_bridge_parachains::Config<BridgeParachainRococoInstance> for Runtime
type BridgesGrandpaPalletInstance = BridgeGrandpaRococoInstance;
type ParasPalletName = RococoBridgeParachainPalletName;
type ParaStoredHeaderDataBuilder =
SingleParaStoredHeaderDataBuilder<bp_bridge_hub_rococo::BridgeHubRococo>;
SingleParaStoredHeaderDataBuilder<bp_bridge_hub_rococo::BridgeHubRococo>;
type HeadsToKeep = ParachainHeadsToKeep;
type MaxParaHeadDataSize = MaxRococoParaHeadDataSize;
}
Expand All @@ -510,12 +509,12 @@ impl pallet_bridge_messages::Config<WithBridgeHubWococoMessagesInstance> for Run
type BridgedChainId = bridge_hub_rococo_config::BridgeHubWococoChainId;
type ActiveOutboundLanes = bridge_hub_rococo_config::ActiveOutboundLanesToBridgeHubWococo;
type MaxUnrewardedRelayerEntriesAtInboundLane =
bridge_hub_rococo_config::MaxUnrewardedRelayerEntriesAtInboundLane;
bridge_hub_rococo_config::MaxUnrewardedRelayerEntriesAtInboundLane;
type MaxUnconfirmedMessagesAtInboundLane =
bridge_hub_rococo_config::MaxUnconfirmedMessagesAtInboundLane;
bridge_hub_rococo_config::MaxUnconfirmedMessagesAtInboundLane;

type MaximalOutboundPayloadSize =
bridge_hub_rococo_config::ToBridgeHubWococoMaximalOutboundPayloadSize;
bridge_hub_rococo_config::ToBridgeHubWococoMaximalOutboundPayloadSize;
type OutboundPayload = XcmAsPlainPayload;

type InboundPayload = XcmAsPlainPayload;
Expand All @@ -532,7 +531,7 @@ impl pallet_bridge_messages::Config<WithBridgeHubWococoMessagesInstance> for Run

type SourceHeaderChain = SourceHeaderChainAdapter<WithBridgeHubWococoMessageBridge>;
type MessageDispatch =
XcmBlobMessageDispatch<OnBridgeHubRococoBlobDispatcher, Self::WeightInfo, ()>;
XcmBlobMessageDispatch<OnBridgeHubRococoBlobDispatcher, Self::WeightInfo, ()>;
type OnMessagesDelivered = ();
}

Expand All @@ -544,12 +543,12 @@ impl pallet_bridge_messages::Config<WithBridgeHubRococoMessagesInstance> for Run
type BridgedChainId = bridge_hub_wococo_config::BridgeHubRococoChainId;
type ActiveOutboundLanes = bridge_hub_wococo_config::ActiveOutboundLanesToBridgeHubRococo;
type MaxUnrewardedRelayerEntriesAtInboundLane =
bridge_hub_wococo_config::MaxUnrewardedRelayerEntriesAtInboundLane;
bridge_hub_wococo_config::MaxUnrewardedRelayerEntriesAtInboundLane;
type MaxUnconfirmedMessagesAtInboundLane =
bridge_hub_wococo_config::MaxUnconfirmedMessagesAtInboundLane;
bridge_hub_wococo_config::MaxUnconfirmedMessagesAtInboundLane;

type MaximalOutboundPayloadSize =
bridge_hub_wococo_config::ToBridgeHubRococoMaximalOutboundPayloadSize;
bridge_hub_wococo_config::ToBridgeHubRococoMaximalOutboundPayloadSize;
type OutboundPayload = XcmAsPlainPayload;

type InboundPayload = XcmAsPlainPayload;
Expand All @@ -566,7 +565,7 @@ impl pallet_bridge_messages::Config<WithBridgeHubRococoMessagesInstance> for Run

type SourceHeaderChain = SourceHeaderChainAdapter<WithBridgeHubRococoMessageBridge>;
type MessageDispatch =
XcmBlobMessageDispatch<OnBridgeHubWococoBlobDispatcher, Self::WeightInfo, ()>;
XcmBlobMessageDispatch<OnBridgeHubWococoBlobDispatcher, Self::WeightInfo, ()>;
type OnMessagesDelivered = ();
}

Expand All @@ -575,7 +574,7 @@ impl pallet_bridge_relayers::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Reward = Balance;
type PaymentProcedure =
bp_relayers::PayRewardFromAccount<pallet_balances::Pallet<Runtime>, AccountId>;
bp_relayers::PayRewardFromAccount<pallet_balances::Pallet<Runtime>, AccountId>;
type StakeAndSlash = pallet_bridge_relayers::StakeAndSlashNamed<
AccountId,
BlockNumber,
Expand Down Expand Up @@ -780,6 +779,7 @@ mod benches {
[frame_system, SystemBench::<Runtime>]
[pallet_balances, Balances]
[pallet_multisig, Multisig]
[pallet_message_queue, MessageQueue]
[pallet_session, SessionBench::<Runtime>]
[pallet_utility, Utility]
[pallet_timestamp, Timestamp]
Expand All @@ -800,6 +800,7 @@ mod benches {
[pallet_bridge_messages, BridgeMessagesBench::<Runtime, WithBridgeHubRococoMessagesInstance>]
// Bridge relayer pallets
[pallet_bridge_relayers, BridgeRelayersBench::<Runtime>]
// Ethereum Bridge
[snowbridge_inbound_queue, EthereumInboundQueue]
[snowbridge_control, EthereumControl]
[snowbridge_ethereum_beacon_client, EthereumBeaconClient]
Expand Down Expand Up @@ -1410,7 +1411,7 @@ mod tests {
use codec::Encode;

pub type TestBlockHeader =
sp_runtime::generic::Header<bp_polkadot_core::BlockNumber, bp_polkadot_core::Hasher>;
sp_runtime::generic::Header<bp_polkadot_core::BlockNumber, bp_polkadot_core::Hasher>;

#[test]
fn ensure_signed_extension_definition_is_compatible_with_relay() {
Expand Down

0 comments on commit c15198d

Please sign in to comment.