Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update polkadot dependencies #417

Merged
merged 27 commits into from
Jun 28, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Merge branch 'main' into update-cumulus
  • Loading branch information
vgeddes committed Jun 4, 2021
commit c800e61ba298eaba2e4010c541edba65d641da2f
8 changes: 4 additions & 4 deletions parachain/runtime/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
use frame_support::{
parameter_types,
dispatch::DispatchResult,
PalletId,
weights::{DispatchClass, Weight},
};
use frame_system::limits::BlockWeights;
use sp_runtime::{ModuleId, Perbill};
use sp_runtime::Perbill;
use sp_std::marker::PhantomData;
use sp_core::H160;

Expand Down Expand Up @@ -41,7 +42,6 @@ pub fn build_block_weights(
}

pub const INDEXING_PREFIX: &'static [u8] = b"commitment";

pub struct OutboundRouter<T>(PhantomData<T>);

impl<T> artemis_core::OutboundRouter<T::AccountId> for OutboundRouter<T>
Expand All @@ -63,6 +63,6 @@ parameter_types! {
}

parameter_types! {
pub const TreasuryModuleId: ModuleId = ModuleId(*b"s/treasy");
pub const DotModuleId: ModuleId = ModuleId(*b"s/dotapp");
pub const TreasuryPalletId: PalletId = PalletId(*b"s/treasy");
pub const DotPalletId: PalletId = PalletId(*b"s/dotapp");
}
55 changes: 10 additions & 45 deletions parachain/runtime/local/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub use frame_support::{
constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
IdentityFee, Weight,
},
PalletId, StorageValue,
StorageValue,
};
use frame_system::{EnsureOneOf, EnsureRoot};
pub use pallet_balances::Call as BalancesCall;
Expand All @@ -49,7 +49,7 @@ use pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo;
pub use sp_runtime::BuildStorage;
pub use sp_runtime::{traits::AccountIdConversion, Perbill, Permill};

pub use artemis_core::{AssetId, ChannelId, MessageId, OutboundRouter};
pub use artemis_core::{AssetId, ChannelId, MessageId};
use dispatch::EnsureEthereumAccount;

pub use verifier_lightclient::{EthereumDifficultyConfig, EthereumHeader};
Expand All @@ -75,8 +75,8 @@ use runtime_common::{
Ether,
MaxMessagePayloadSize,
MaxMessagesPerCommit,
DotModuleId,
TreasuryModuleId,
DotPalletId,
TreasuryPalletId,
};

/// An index to a block.
Expand Down Expand Up @@ -498,16 +498,6 @@ impl pallet_membership::Config<LocalCouncilMembershipInstance> for Runtime {

// Our pallets

// Module accounts
parameter_types! {
pub const TreasuryPalletId: PalletId = PalletId(*b"s/treasy");
pub const DotPalletId: PalletId = PalletId(*b"s/dotapp");
}

pub fn module_accounts() -> Vec<AccountId> {
vec![TreasuryPalletId::get().into_account()]
}

pub struct CallFilter;
impl Filter<Call> for CallFilter {
fn filter(call: &Call) -> bool {
Expand Down Expand Up @@ -551,7 +541,6 @@ impl basic_channel_outbound::Config for Runtime {
parameter_types! {
pub SourceAccount: AccountId = DotPalletId::get().into_account();
pub TreasuryAccount: AccountId = TreasuryPalletId::get().into_account();

}

pub struct FeeConverter;
Expand Down Expand Up @@ -585,30 +574,6 @@ impl incentivized_channel_outbound::Config for Runtime {
type WeightInfo = ();
}

use sp_core::H160;
use sp_std::marker::PhantomData;

pub struct SimpleOutboundRouter<T>(PhantomData<T>);

impl<T> OutboundRouter<T::AccountId> for SimpleOutboundRouter<T>
where
T: basic_channel_outbound::Config + incentivized_channel_outbound::Config,
{
fn submit(
channel_id: ChannelId,
who: &T::AccountId,
target: H160,
payload: &[u8],
) -> DispatchResult {
match channel_id {
ChannelId::Basic => basic_channel_outbound::Module::<T>::submit(who, target, payload),
ChannelId::Incentivized => {
incentivized_channel_outbound::Module::<T>::submit(who, target, payload)
}
}
}
}

pub const ROPSTEN_DIFFICULTY_CONFIG: EthereumDifficultyConfig = EthereumDifficultyConfig {
byzantium_fork_block: 1700000,
constantinople_fork_block: 4230000,
Expand Down Expand Up @@ -694,14 +659,14 @@ construct_runtime!(
VerifierLightclient: verifier_lightclient::{Pallet, Call, Storage, Event, Config} = 14,
Assets: assets::{Pallet, Call, Config<T>, Storage, Event<T>} = 15,

XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 17,
LocalXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 18,
CumulusXcm: cumulus_pallet_xcm::{Pallet, Origin} = 19,
Transfer: artemis_transfer::{Pallet, Call, Event<T>} = 20,
Utility: pallet_utility::{Pallet, Call, Event, Storage} = 21,
XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 16,
LocalXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 17,
CumulusXcm: cumulus_pallet_xcm::{Pallet, Origin} = 18,
Transfer: artemis_transfer::{Pallet, Call, Event<T>} = 19,
Utility: pallet_utility::{Pallet, Call, Event, Storage} = 20,

// For dev only, will be removed in production
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>} = 22,
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>} = 21,

DOT: dot_app::{Pallet, Call, Config<T>, Storage, Event<T>} = 64,
ETH: eth_app::{Pallet, Call, Config, Storage, Event<T>} = 65,
Expand Down
55 changes: 10 additions & 45 deletions parachain/runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub use frame_support::{
parameter_types,
traits::{All, Filter, IsInVec, KeyOwnerProofSystem, Randomness},
weights::{constants::WEIGHT_PER_SECOND, IdentityFee, Weight},
PalletId, StorageValue,
StorageValue,
};
use frame_system::{EnsureOneOf, EnsureRoot};
pub use pallet_balances::Call as BalancesCall;
Expand All @@ -46,7 +46,7 @@ use pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo;
pub use sp_runtime::BuildStorage;
pub use sp_runtime::{traits::AccountIdConversion, Perbill, Permill};

pub use artemis_core::{AssetId, ChannelId, MessageId, OutboundRouter};
pub use artemis_core::{AssetId, ChannelId, MessageId};
use dispatch::EnsureEthereumAccount;

pub use verifier_lightclient::{EthereumDifficultyConfig, EthereumHeader};
Expand All @@ -72,8 +72,8 @@ use runtime_common::{
Ether,
MaxMessagePayloadSize,
MaxMessagesPerCommit,
DotModuleId,
TreasuryModuleId,
DotPalletId,
TreasuryPalletId,
};


Expand Down Expand Up @@ -498,16 +498,6 @@ impl pallet_membership::Config<LocalCouncilMembershipInstance> for Runtime {

// Our pallets

// Module accounts
parameter_types! {
pub const TreasuryPalletId: PalletId = PalletId(*b"s/treasy");
pub const DotPalletId: PalletId = PalletId(*b"s/dotapp");
}

pub fn module_accounts() -> Vec<AccountId> {
vec![TreasuryPalletId::get().into_account()]
}

pub struct CallFilter;
impl Filter<Call> for CallFilter {
fn filter(call: &Call) -> bool {
Expand Down Expand Up @@ -551,7 +541,6 @@ impl basic_channel_outbound::Config for Runtime {
parameter_types! {
pub SourceAccount: AccountId = DotPalletId::get().into_account();
pub TreasuryAccount: AccountId = TreasuryPalletId::get().into_account();

}

pub struct FeeConverter;
Expand Down Expand Up @@ -586,30 +575,6 @@ impl incentivized_channel_outbound::Config for Runtime {
type WeightInfo = weights::incentivized_channel_outbound_weights::WeightInfo<Runtime>;
}

use sp_core::H160;
use sp_std::marker::PhantomData;

pub struct SimpleOutboundRouter<T>(PhantomData<T>);

impl<T> OutboundRouter<T::AccountId> for SimpleOutboundRouter<T>
where
T: basic_channel_outbound::Config + incentivized_channel_outbound::Config,
{
fn submit(
channel_id: ChannelId,
who: &T::AccountId,
target: H160,
payload: &[u8],
) -> DispatchResult {
match channel_id {
ChannelId::Basic => basic_channel_outbound::Module::<T>::submit(who, target, payload),
ChannelId::Incentivized => {
incentivized_channel_outbound::Module::<T>::submit(who, target, payload)
}
}
}
}

pub const ROPSTEN_DIFFICULTY_CONFIG: EthereumDifficultyConfig = EthereumDifficultyConfig {
byzantium_fork_block: 1700000,
constantinople_fork_block: 4230000,
Expand Down Expand Up @@ -695,14 +660,14 @@ construct_runtime!(
VerifierLightclient: verifier_lightclient::{Pallet, Call, Storage, Event, Config} = 14,
Assets: assets::{Pallet, Call, Config<T>, Storage, Event<T>} = 15,

XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 17,
LocalXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 18,
CumulusXcm: cumulus_pallet_xcm::{Pallet, Origin} = 19,
Transfer: artemis_transfer::{Pallet, Call, Event<T>} = 20,
Utility: pallet_utility::{Pallet, Call, Event, Storage} = 21,
XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 16,
LocalXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 17,
CumulusXcm: cumulus_pallet_xcm::{Pallet, Origin} = 18,
Transfer: artemis_transfer::{Pallet, Call, Event<T>} = 19,
Utility: pallet_utility::{Pallet, Call, Event, Storage} = 20,

// For dev only, will be removed in production
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>} = 22,
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>} = 21,

DOT: dot_app::{Pallet, Call, Config<T>, Storage, Event<T>} = 64,
ETH: eth_app::{Pallet, Call, Config, Storage, Event<T>} = 65,
Expand Down
48 changes: 7 additions & 41 deletions parachain/runtime/snowbridge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo;
pub use sp_runtime::BuildStorage;
pub use sp_runtime::{traits::AccountIdConversion, Perbill, Permill};

pub use artemis_core::{AssetId, ChannelId, MessageId, OutboundRouter};
pub use artemis_core::{AssetId, ChannelId, MessageId};
use dispatch::EnsureEthereumAccount;

pub use verifier_lightclient::{EthereumDifficultyConfig, EthereumHeader};
Expand Down Expand Up @@ -497,16 +497,6 @@ impl pallet_membership::Config<LocalCouncilMembershipInstance> for Runtime {

// Our pallets

// Module accounts
parameter_types! {
pub const TreasuryPalletId: PalletId = PalletId(*b"s/treasy");
pub const DotPalletId: PalletId = PalletId(*b"s/dotapp");
}

pub fn module_accounts() -> Vec<AccountId> {
vec![TreasuryPalletId::get().into_account()]
}

pub struct CallFilter;
impl Filter<Call> for CallFilter {
fn filter(call: &Call) -> bool {
Expand Down Expand Up @@ -585,30 +575,6 @@ impl incentivized_channel_outbound::Config for Runtime {
type WeightInfo = weights::incentivized_channel_outbound_weights::WeightInfo<Runtime>;
}

use sp_core::H160;
use sp_std::marker::PhantomData;

pub struct SimpleOutboundRouter<T>(PhantomData<T>);

impl<T> OutboundRouter<T::AccountId> for SimpleOutboundRouter<T>
where
T: basic_channel_outbound::Config + incentivized_channel_outbound::Config,
{
fn submit(
channel_id: ChannelId,
who: &T::AccountId,
target: H160,
payload: &[u8],
) -> DispatchResult {
match channel_id {
ChannelId::Basic => basic_channel_outbound::Module::<T>::submit(who, target, payload),
ChannelId::Incentivized => {
incentivized_channel_outbound::Module::<T>::submit(who, target, payload)
}
}
}
}

pub const ROPSTEN_DIFFICULTY_CONFIG: EthereumDifficultyConfig = EthereumDifficultyConfig {
byzantium_fork_block: 1700000,
constantinople_fork_block: 4230000,
Expand Down Expand Up @@ -694,14 +660,14 @@ construct_runtime!(
VerifierLightclient: verifier_lightclient::{Pallet, Call, Storage, Event, Config} = 14,
Assets: assets::{Pallet, Call, Config<T>, Storage, Event<T>} = 15,

XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 17,
LocalXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 18,
CumulusXcm: cumulus_pallet_xcm::{Pallet, Origin} = 19,
Transfer: artemis_transfer::{Pallet, Call, Event<T>} = 20,
Utility: pallet_utility::{Pallet, Call, Event, Storage} = 21,
XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 16,
LocalXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 17,
CumulusXcm: cumulus_pallet_xcm::{Pallet, Origin} = 18,
Transfer: artemis_transfer::{Pallet, Call, Event<T>} = 19,
Utility: pallet_utility::{Pallet, Call, Event, Storage} = 20,

// For dev only, will be removed in production
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>} = 22,
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>} = 21,

DOT: dot_app::{Pallet, Call, Config<T>, Storage, Event<T>} = 64,
ETH: eth_app::{Pallet, Call, Config, Storage, Event<T>} = 65,
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.