mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 15:11:02 +00:00
Switch to gav-xcm-v3 branch to be able to test bridges + XCMv3 integration (#1378)
* switch to gav-xcm-v3 branch (wip) * add comment * play with CI * keep playing with CI * play with CI * trigger CI * Revert "trigger CI" This reverts commit fc35ac648fe6a3ea8e710a2e07dfee7d8762c6c4.
This commit is contained in:
committed by
Bastian Köcher
parent
cf15c0d91b
commit
c538a39816
@@ -67,5 +67,6 @@ pub enum Subcommand {
|
||||
Inspect(node_inspect::cli::InspectCmd),
|
||||
|
||||
/// Benchmark runtime pallets.
|
||||
#[clap(subcommand)]
|
||||
Benchmark(frame_benchmarking_cli::BenchmarkCmd),
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ use crate::{
|
||||
service,
|
||||
service::new_partial,
|
||||
};
|
||||
use frame_benchmarking_cli::BenchmarkCmd;
|
||||
use millau_runtime::{Block, RuntimeApi};
|
||||
use sc_cli::{ChainSpec, RuntimeVersion, SubstrateCli};
|
||||
use sc_service::PartialComponents;
|
||||
@@ -77,11 +78,13 @@ pub fn run() -> sc_cli::Result<()> {
|
||||
));
|
||||
|
||||
match &cli.subcommand {
|
||||
Some(Subcommand::Benchmark(cmd)) =>
|
||||
if cfg!(feature = "runtime-benchmarks") {
|
||||
Some(Subcommand::Benchmark(cmd)) => {
|
||||
let runner = cli.create_runner(cmd)?;
|
||||
|
||||
runner.sync_run(|config| cmd.run::<Block, service::ExecutorDispatch>(config))
|
||||
match cmd {
|
||||
BenchmarkCmd::Pallet(cmd) =>
|
||||
if cfg!(feature = "runtime-benchmarks") {
|
||||
runner
|
||||
.sync_run(|config| cmd.run::<Block, service::ExecutorDispatch>(config))
|
||||
} else {
|
||||
println!(
|
||||
"Benchmarking wasn't enabled when building the node. \
|
||||
@@ -89,6 +92,9 @@ pub fn run() -> sc_cli::Result<()> {
|
||||
);
|
||||
Ok(())
|
||||
},
|
||||
_ => Err("Unsupported benchmarking subcommand".into()),
|
||||
}
|
||||
},
|
||||
Some(Subcommand::Key(cmd)) => cmd.run(&cli),
|
||||
Some(Subcommand::Sign(cmd)) => cmd.run(),
|
||||
Some(Subcommand::Verify(cmd)) => cmd.run(),
|
||||
|
||||
@@ -392,8 +392,9 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
||||
if role.is_authority() { Some(keystore_container.sync_keystore()) } else { None };
|
||||
|
||||
let beefy_params = beefy_gadget::BeefyParams {
|
||||
client,
|
||||
client: client.clone(),
|
||||
backend,
|
||||
runtime: client,
|
||||
key_store: keystore.clone(),
|
||||
network: network.clone(),
|
||||
signed_commitment_sender: beefy_commitment_link,
|
||||
@@ -407,7 +408,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
||||
task_manager.spawn_essential_handle().spawn_blocking(
|
||||
"beefy-gadget",
|
||||
None,
|
||||
beefy_gadget::start_beefy_gadget::<_, _, _, _>(beefy_params),
|
||||
beefy_gadget::start_beefy_gadget::<_, _, _, _, _>(beefy_params),
|
||||
);
|
||||
|
||||
let grandpa_config = sc_finality_grandpa::Config {
|
||||
|
||||
@@ -11,7 +11,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
hex-literal = "0.3"
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
|
||||
libsecp256k1 = { version = "0.7", optional = true, default-features = false, features = ["hmac"] }
|
||||
scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
|
||||
serde = { version = "1.0", optional = true, features = ["derive"] }
|
||||
|
||||
# Bridge dependencies
|
||||
@@ -44,7 +44,6 @@ pallet-beefy = { git = "https://github.com/paritytech/substrate", branch = "mast
|
||||
pallet-beefy-mmr = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
pallet-mmr = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
pallet-mmr-primitives = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
@@ -57,6 +56,7 @@ sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch =
|
||||
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
sp-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
sp-mmr-primitives = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
sp-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
|
||||
@@ -39,13 +39,13 @@ use bridge_runtime_common::messages::{
|
||||
use pallet_grandpa::{
|
||||
fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList,
|
||||
};
|
||||
use pallet_mmr_primitives::{
|
||||
DataOrHash, EncodableOpaqueLeaf, Error as MmrError, LeafDataProvider, Proof as MmrProof,
|
||||
};
|
||||
use pallet_transaction_payment::{FeeDetails, Multiplier, RuntimeDispatchInfo};
|
||||
use sp_api::impl_runtime_apis;
|
||||
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
|
||||
use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
|
||||
use sp_mmr_primitives::{
|
||||
DataOrHash, EncodableOpaqueLeaf, Error as MmrError, LeafDataProvider, Proof as MmrProof,
|
||||
};
|
||||
use sp_runtime::{
|
||||
create_runtime_str, generic, impl_opaque_keys,
|
||||
traits::{Block as BlockT, IdentityLookup, Keccak256, NumberFor, OpaqueKeys},
|
||||
@@ -61,7 +61,10 @@ use sp_version::RuntimeVersion;
|
||||
pub use frame_support::{
|
||||
construct_runtime, parameter_types,
|
||||
traits::{Currency, ExistenceRequirement, Imbalance, KeyOwnerProofSystem},
|
||||
weights::{constants::WEIGHT_PER_SECOND, DispatchClass, IdentityFee, RuntimeDbWeight, Weight},
|
||||
weights::{
|
||||
constants::WEIGHT_PER_SECOND, ConstantMultiplier, DispatchClass, IdentityFee,
|
||||
RuntimeDbWeight, Weight,
|
||||
},
|
||||
StorageValue,
|
||||
};
|
||||
|
||||
@@ -278,10 +281,19 @@ parameter_types! {
|
||||
pub LeafVersion: MmrLeafVersion = MmrLeafVersion::new(0, 0);
|
||||
}
|
||||
|
||||
pub struct BeefyDummyDataProvider;
|
||||
|
||||
impl beefy_primitives::mmr::BeefyDataProvider<()> for BeefyDummyDataProvider {
|
||||
fn extra_data() -> () {
|
||||
()
|
||||
}
|
||||
}
|
||||
|
||||
impl pallet_beefy_mmr::Config for Runtime {
|
||||
type LeafVersion = LeafVersion;
|
||||
type BeefyAuthorityToMerkleLeaf = pallet_beefy_mmr::BeefyEcdsaToEthereum;
|
||||
type ParachainHeads = ();
|
||||
type LeafExtra = ();
|
||||
type BeefyDataProvider = BeefyDummyDataProvider;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -333,9 +345,9 @@ parameter_types! {
|
||||
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter<Balances, ()>;
|
||||
type TransactionByteFee = TransactionByteFee;
|
||||
type OperationalFeeMultiplier = OperationalFeeMultiplier;
|
||||
type WeightToFee = bp_millau::WeightToFee;
|
||||
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
|
||||
type FeeMultiplierUpdate = pallet_transaction_payment::TargetedFeeAdjustment<
|
||||
Runtime,
|
||||
TargetBlockFullness,
|
||||
@@ -669,7 +681,7 @@ impl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
|
||||
impl pallet_mmr_primitives::MmrApi<Block, MmrHash> for Runtime {
|
||||
impl sp_mmr_primitives::MmrApi<Block, MmrHash> for Runtime {
|
||||
fn generate_proof(leaf_index: u64)
|
||||
-> Result<(EncodableOpaqueLeaf, MmrProof<MmrHash>), MmrError>
|
||||
{
|
||||
@@ -700,6 +712,10 @@ impl_runtime_apis! {
|
||||
let node = DataOrHash::Data(leaf.into_opaque_leaf());
|
||||
pallet_mmr::verify_leaf_proof::<MmrHashing, _>(root, node, proof)
|
||||
}
|
||||
|
||||
fn mmr_root() -> Result<MmrHash, MmrError> {
|
||||
Ok(Mmr::mmr_root())
|
||||
}
|
||||
}
|
||||
|
||||
impl fg_primitives::GrandpaApi<Block> for Runtime {
|
||||
|
||||
@@ -72,20 +72,20 @@ sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "mast
|
||||
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
|
||||
# Cumulus dependencies
|
||||
cumulus-client-consensus-aura = { git = "https://github.com/paritytech/cumulus", branch = "master" }
|
||||
cumulus-client-consensus-common = { git = "https://github.com/paritytech/cumulus", branch = "master" }
|
||||
cumulus-client-collator = { git = "https://github.com/paritytech/cumulus", branch = "master" }
|
||||
cumulus-client-cli = { git = "https://github.com/paritytech/cumulus", branch = "master" }
|
||||
cumulus-client-network = { git = "https://github.com/paritytech/cumulus", branch = "master" }
|
||||
cumulus-client-service = { git = "https://github.com/paritytech/cumulus", branch = "master" }
|
||||
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "master" }
|
||||
cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus", branch = "master" }
|
||||
cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus", branch = "master" }
|
||||
cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech/cumulus", branch = "master" }
|
||||
cumulus-client-consensus-aura = { git = "https://github.com/paritytech/cumulus", branch = "gav-xcm-v3" }
|
||||
cumulus-client-consensus-common = { git = "https://github.com/paritytech/cumulus", branch = "gav-xcm-v3" }
|
||||
cumulus-client-collator = { git = "https://github.com/paritytech/cumulus", branch = "gav-xcm-v3" }
|
||||
cumulus-client-cli = { git = "https://github.com/paritytech/cumulus", branch = "gav-xcm-v3" }
|
||||
cumulus-client-network = { git = "https://github.com/paritytech/cumulus", branch = "gav-xcm-v3" }
|
||||
cumulus-client-service = { git = "https://github.com/paritytech/cumulus", branch = "gav-xcm-v3" }
|
||||
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "gav-xcm-v3" }
|
||||
cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus", branch = "gav-xcm-v3" }
|
||||
cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus", branch = "gav-xcm-v3" }
|
||||
cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech/cumulus", branch = "gav-xcm-v3" }
|
||||
|
||||
# Polkadot dependencies
|
||||
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "master" }
|
||||
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "master" }
|
||||
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "master" }
|
||||
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "master" }
|
||||
polkadot-test-service = { git = "https://github.com/paritytech/polkadot", branch = "master" }
|
||||
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "gav-xcm-v3" }
|
||||
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "gav-xcm-v3" }
|
||||
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "gav-xcm-v3" }
|
||||
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "gav-xcm-v3" }
|
||||
polkadot-test-service = { git = "https://github.com/paritytech/polkadot", branch = "gav-xcm-v3" }
|
||||
|
||||
@@ -51,7 +51,7 @@ pub enum Subcommand {
|
||||
Revert(sc_cli::RevertCmd),
|
||||
|
||||
/// The custom benchmark subcommmand benchmarking runtime pallets.
|
||||
#[clap(name = "benchmark", about = "Benchmark runtime pallets.")]
|
||||
#[clap(subcommand)]
|
||||
Benchmark(frame_benchmarking_cli::BenchmarkCmd),
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ use crate::{
|
||||
use codec::Encode;
|
||||
use cumulus_client_service::genesis::generate_genesis_block;
|
||||
use cumulus_primitives_core::ParaId;
|
||||
use frame_benchmarking_cli::BenchmarkCmd;
|
||||
use log::info;
|
||||
use polkadot_parachain::primitives::AccountIdConversion;
|
||||
use rialto_parachain_runtime::{Block, RuntimeApi};
|
||||
@@ -255,15 +256,21 @@ pub fn run() -> Result<()> {
|
||||
|
||||
Ok(())
|
||||
},
|
||||
Some(Subcommand::Benchmark(cmd)) =>
|
||||
if cfg!(feature = "runtime-benchmarks") {
|
||||
Some(Subcommand::Benchmark(cmd)) => {
|
||||
let runner = cli.create_runner(cmd)?;
|
||||
|
||||
match cmd {
|
||||
BenchmarkCmd::Pallet(cmd) =>
|
||||
if cfg!(feature = "runtime-benchmarks") {
|
||||
runner.sync_run(|config| cmd.run::<Block, ParachainRuntimeExecutor>(config))
|
||||
} else {
|
||||
Err("Benchmarking wasn't enabled when building the node. \
|
||||
println!(
|
||||
"Benchmarking wasn't enabled when building the node. \
|
||||
You can enable it with `--features runtime-benchmarks`."
|
||||
.into())
|
||||
);
|
||||
Ok(())
|
||||
},
|
||||
_ => Err("Unsupported benchmarking subcommand".into()),
|
||||
}
|
||||
},
|
||||
None => {
|
||||
let runner = cli.create_runner(&cli.run.normalize())?;
|
||||
|
||||
@@ -13,7 +13,7 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", bran
|
||||
[dependencies]
|
||||
codec = { package = 'parity-scale-codec', version = '3.0.0', default-features = false, features = ['derive']}
|
||||
log = { version = "0.4.14", default-features = false }
|
||||
scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
|
||||
serde = { version = '1.0', optional = true, features = ['derive'] }
|
||||
|
||||
# Bridge depedencies
|
||||
@@ -38,7 +38,7 @@ sp-version = { git = "https://github.com/paritytech/substrate", branch = "master
|
||||
## Substrate FRAME Dependencies
|
||||
frame-executive = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
|
||||
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
|
||||
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
frame-system = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
|
||||
frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
@@ -53,22 +53,22 @@ pallet-transaction-payment = { git = "https://github.com/paritytech/substrate",
|
||||
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
|
||||
# Cumulus Dependencies
|
||||
cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", branch = "master", default-features = false }
|
||||
cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", branch = "master", default-features = false }
|
||||
cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "master", default-features = false }
|
||||
cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", branch = "master", default-features = false }
|
||||
cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "master", default-features = false }
|
||||
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "master", default-features = false }
|
||||
cumulus-primitives-timestamp = { git = "https://github.com/paritytech/cumulus", branch = "master", default-features = false }
|
||||
cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus", branch = "master", default-features = false }
|
||||
parachain-info = { git = "https://github.com/paritytech/cumulus", branch = "master", default-features = false }
|
||||
cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", branch = "gav-xcm-v3", default-features = false }
|
||||
cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", branch = "gav-xcm-v3", default-features = false }
|
||||
cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "gav-xcm-v3", default-features = false }
|
||||
cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", branch = "gav-xcm-v3", default-features = false }
|
||||
cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "gav-xcm-v3", default-features = false }
|
||||
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "gav-xcm-v3", default-features = false }
|
||||
cumulus-primitives-timestamp = { git = "https://github.com/paritytech/cumulus", branch = "gav-xcm-v3", default-features = false }
|
||||
cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus", branch = "gav-xcm-v3", default-features = false }
|
||||
parachain-info = { git = "https://github.com/paritytech/cumulus", branch = "gav-xcm-v3", default-features = false }
|
||||
|
||||
# Polkadot Dependencies
|
||||
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false }
|
||||
xcm = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false }
|
||||
xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false }
|
||||
xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false }
|
||||
pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false }
|
||||
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "gav-xcm-v3", default-features = false }
|
||||
xcm = { git = "https://github.com/paritytech/polkadot", branch = "gav-xcm-v3", default-features = false }
|
||||
xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "gav-xcm-v3", default-features = false }
|
||||
xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "gav-xcm-v3", default-features = false }
|
||||
pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "gav-xcm-v3", default-features = false }
|
||||
|
||||
[features]
|
||||
default = ['std']
|
||||
@@ -106,7 +106,9 @@ std = [
|
||||
"pallet-timestamp/std",
|
||||
"pallet-sudo/std",
|
||||
"pallet-transaction-payment/std",
|
||||
"pallet-xcm/std",
|
||||
"parachain-info/std",
|
||||
"polkadot-parachain/std",
|
||||
"cumulus-pallet-aura-ext/std",
|
||||
"cumulus-pallet-parachain-system/std",
|
||||
"cumulus-pallet-xcmp-queue/std",
|
||||
|
||||
@@ -43,7 +43,7 @@ use sp_version::RuntimeVersion;
|
||||
// A few exports that help ease life for downstream crates.
|
||||
pub use frame_support::{
|
||||
construct_runtime, match_types, parameter_types,
|
||||
traits::{Everything, IsInVec, Randomness},
|
||||
traits::{Everything, IsInVec, Nothing, Randomness},
|
||||
weights::{
|
||||
constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
|
||||
DispatchClass, IdentityFee, Weight,
|
||||
@@ -69,10 +69,10 @@ use polkadot_parachain::primitives::Sibling;
|
||||
use xcm::latest::prelude::*;
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter,
|
||||
EnsureXcmOrigin, FixedWeightBounds, IsConcrete, LocationInverter, NativeAsset,
|
||||
ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative,
|
||||
SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
|
||||
SovereignSignedViaLocation, TakeWeightCredit, UsingComponents,
|
||||
EnsureXcmOrigin, FixedWeightBounds, IsConcrete, NativeAsset, ParentAsSuperuser, ParentIsPreset,
|
||||
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
|
||||
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
|
||||
UsingComponents,
|
||||
};
|
||||
use xcm_executor::{Config, XcmExecutor};
|
||||
|
||||
@@ -252,9 +252,9 @@ impl pallet_balances::Config for Runtime {
|
||||
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter<Balances, ()>;
|
||||
type TransactionByteFee = TransactionByteFee;
|
||||
type OperationalFeeMultiplier = OperationalFeeMultiplier;
|
||||
type WeightToFee = IdentityFee<Balance>;
|
||||
type LengthToFee = IdentityFee<Balance>;
|
||||
type FeeMultiplierUpdate = ();
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@ parameter_types! {
|
||||
pub const RelayLocation: MultiLocation = MultiLocation::parent();
|
||||
pub const RelayNetwork: NetworkId = NetworkId::Polkadot;
|
||||
pub RelayOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into();
|
||||
pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into();
|
||||
pub UniversalLocation: InteriorMultiLocation = X1(Parachain(ParachainInfo::parachain_id().into()).into());
|
||||
}
|
||||
|
||||
/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used
|
||||
@@ -349,6 +349,7 @@ parameter_types! {
|
||||
pub const WeightPrice: (MultiLocation, u128) = (MultiLocation::parent(), UNIT);
|
||||
pub const MaxInstructions: u32 = 100;
|
||||
pub const MaxAuthorities: u32 = 100_000;
|
||||
pub MaxAssetsIntoHolding: u32 = 64;
|
||||
}
|
||||
|
||||
match_types! {
|
||||
@@ -369,12 +370,11 @@ pub struct XcmConfig;
|
||||
impl Config for XcmConfig {
|
||||
type Call = Call;
|
||||
type XcmSender = XcmRouter;
|
||||
// How to withdraw and deposit an asset.
|
||||
type AssetTransactor = LocalAssetTransactor;
|
||||
type OriginConverter = XcmOriginToTransactDispatchOrigin;
|
||||
type IsReserve = NativeAsset;
|
||||
type IsTeleporter = NativeAsset; // <- should be enough to allow teleportation of UNIT
|
||||
type LocationInverter = LocationInverter<Ancestry>;
|
||||
type UniversalLocation = UniversalLocation;
|
||||
type Barrier = Barrier;
|
||||
type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;
|
||||
type Trader = UsingComponents<IdentityFee<Balance>, RelayLocation, AccountId, Balances, ()>;
|
||||
@@ -382,6 +382,13 @@ impl Config for XcmConfig {
|
||||
type AssetTrap = PolkadotXcm;
|
||||
type AssetClaims = PolkadotXcm;
|
||||
type SubscriptionService = PolkadotXcm;
|
||||
type PalletInstancesInfo = ();
|
||||
type MaxAssetsIntoHolding = MaxAssetsIntoHolding;
|
||||
type AssetLocker = ();
|
||||
type AssetExchanger = ();
|
||||
type FeeManager = ();
|
||||
type MessageExporter = ();
|
||||
type UniversalAliases = Nothing;
|
||||
}
|
||||
|
||||
/// No local origins on this chain are allowed to dispatch XCM sends/executions.
|
||||
@@ -391,7 +398,7 @@ pub type LocalOriginToLocation = SignedToAccountId32<Origin, AccountId, RelayNet
|
||||
/// queues.
|
||||
pub type XcmRouter = (
|
||||
// Two routers - use UMP to communicate with the relay chain:
|
||||
cumulus_primitives_utility::ParentAsUmp<ParachainSystem, ()>,
|
||||
cumulus_primitives_utility::ParentAsUmp<ParachainSystem, (), ()>,
|
||||
// ..and XCMP to communicate with the sibling chains.
|
||||
XcmpQueue,
|
||||
);
|
||||
@@ -406,11 +413,16 @@ impl pallet_xcm::Config for Runtime {
|
||||
type XcmTeleportFilter = Everything;
|
||||
type XcmReserveTransferFilter = Everything;
|
||||
type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;
|
||||
type LocationInverter = LocationInverter<Ancestry>;
|
||||
type Origin = Origin;
|
||||
type Call = Call;
|
||||
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
|
||||
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
|
||||
type Currency = Balances;
|
||||
type CurrencyMatcher = ();
|
||||
type TrustedLockers = ();
|
||||
type SovereignAccountOf = ();
|
||||
type MaxLockers = frame_support::traits::ConstU32<8>;
|
||||
type UniversalLocation = UniversalLocation;
|
||||
}
|
||||
|
||||
impl cumulus_pallet_xcm::Config for Runtime {
|
||||
@@ -427,6 +439,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
|
||||
type ControllerOrigin = EnsureRoot<AccountId>;
|
||||
type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;
|
||||
type WeightInfo = ();
|
||||
type PriceForSiblingDelivery = ();
|
||||
}
|
||||
|
||||
impl cumulus_pallet_dmp_queue::Config for Runtime {
|
||||
|
||||
@@ -35,7 +35,6 @@ frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch =
|
||||
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
node-inspect = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
pallet-mmr-primitives = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
pallet-mmr-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
@@ -66,6 +65,7 @@ sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch =
|
||||
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-mmr-primitives = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-session = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
@@ -76,10 +76,10 @@ substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate
|
||||
|
||||
# Polkadot Dependencies
|
||||
|
||||
polkadot-node-core-pvf = { git = "https://github.com/paritytech/polkadot", branch = "master" }
|
||||
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "master" }
|
||||
polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "master" }
|
||||
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false, features = [ "full-node", "polkadot-native" ] }
|
||||
polkadot-node-core-pvf = { git = "https://github.com/paritytech/polkadot", branch = "gav-xcm-v3" }
|
||||
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "gav-xcm-v3" }
|
||||
polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "gav-xcm-v3" }
|
||||
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "gav-xcm-v3", default-features = false, features = [ "full-node", "polkadot-native" ] }
|
||||
|
||||
[build-dependencies]
|
||||
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
|
||||
@@ -67,6 +67,7 @@ pub enum Subcommand {
|
||||
Inspect(node_inspect::cli::InspectCmd),
|
||||
|
||||
/// Benchmark runtime pallets.
|
||||
#[clap(subcommand)]
|
||||
Benchmark(frame_benchmarking_cli::BenchmarkCmd),
|
||||
|
||||
/// FOR INTERNAL USE: analog of the "prepare-worker" command of the polkadot binary.
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::cli::{Cli, Subcommand};
|
||||
use frame_benchmarking_cli::BenchmarkCmd;
|
||||
use rialto_runtime::{Block, RuntimeApi};
|
||||
use sc_cli::{ChainSpec, Role, RuntimeVersion, SubstrateCli};
|
||||
|
||||
@@ -86,10 +87,11 @@ pub fn run() -> sc_cli::Result<()> {
|
||||
));
|
||||
|
||||
match &cli.subcommand {
|
||||
Some(Subcommand::Benchmark(cmd)) =>
|
||||
if cfg!(feature = "runtime-benchmarks") {
|
||||
Some(Subcommand::Benchmark(cmd)) => {
|
||||
let runner = cli.create_runner(cmd)?;
|
||||
|
||||
match cmd {
|
||||
BenchmarkCmd::Pallet(cmd) =>
|
||||
if cfg!(feature = "runtime-benchmarks") {
|
||||
runner.sync_run(|config| cmd.run::<Block, ExecutorDispatch>(config))
|
||||
} else {
|
||||
println!(
|
||||
@@ -98,6 +100,9 @@ pub fn run() -> sc_cli::Result<()> {
|
||||
);
|
||||
Ok(())
|
||||
},
|
||||
_ => Err("Unsupported benchmarking subcommand".into()),
|
||||
}
|
||||
},
|
||||
Some(Subcommand::Key(cmd)) => cmd.run(&cli),
|
||||
Some(Subcommand::Sign(cmd)) => cmd.run(),
|
||||
Some(Subcommand::Verify(cmd)) => cmd.run(),
|
||||
|
||||
@@ -12,7 +12,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features =
|
||||
hex-literal = "0.3"
|
||||
libsecp256k1 = { version = "0.7", optional = true, default-features = false, features = ["hmac"] }
|
||||
log = { version = "0.4.14", default-features = false }
|
||||
scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
|
||||
serde = { version = "1.0", optional = true, features = ["derive"] }
|
||||
|
||||
# Bridge dependencies
|
||||
@@ -44,7 +44,6 @@ pallet-beefy = { git = "https://github.com/paritytech/substrate", branch = "mast
|
||||
pallet-beefy-mmr = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
pallet-mmr = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
pallet-mmr-primitives = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
@@ -58,6 +57,7 @@ sp-core = { git = "https://github.com/paritytech/substrate", branch = "master",
|
||||
sp-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
sp-io = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
sp-mmr-primitives = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
sp-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
@@ -68,9 +68,9 @@ sp-version = { git = "https://github.com/paritytech/substrate", branch = "master
|
||||
|
||||
# Polkadot (parachain) Dependencies
|
||||
|
||||
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false }
|
||||
polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false }
|
||||
polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false }
|
||||
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "gav-xcm-v3", default-features = false }
|
||||
polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot", branch = "gav-xcm-v3", default-features = false }
|
||||
polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "gav-xcm-v3", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
bridge-runtime-common = { path = "../../runtime-common", features = ["integrity-test"] }
|
||||
@@ -108,7 +108,7 @@ std = [
|
||||
"pallet-bridge-messages/std",
|
||||
"pallet-grandpa/std",
|
||||
"pallet-mmr/std",
|
||||
"pallet-mmr-primitives/std",
|
||||
"sp-mmr-primitives/std",
|
||||
"pallet-shift-session-manager/std",
|
||||
"pallet-sudo/std",
|
||||
"pallet-timestamp/std",
|
||||
|
||||
@@ -40,13 +40,13 @@ use bridge_runtime_common::messages::{
|
||||
use pallet_grandpa::{
|
||||
fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList,
|
||||
};
|
||||
use pallet_mmr_primitives::{
|
||||
DataOrHash, EncodableOpaqueLeaf, Error as MmrError, LeafDataProvider, Proof as MmrProof,
|
||||
};
|
||||
use pallet_transaction_payment::{FeeDetails, Multiplier, RuntimeDispatchInfo};
|
||||
use sp_api::impl_runtime_apis;
|
||||
use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId;
|
||||
use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
|
||||
use sp_mmr_primitives::{
|
||||
DataOrHash, EncodableOpaqueLeaf, Error as MmrError, LeafDataProvider, Proof as MmrProof,
|
||||
};
|
||||
use sp_runtime::{
|
||||
create_runtime_str, generic, impl_opaque_keys,
|
||||
traits::{AccountIdLookup, Block as BlockT, Keccak256, NumberFor, OpaqueKeys},
|
||||
@@ -305,10 +305,19 @@ parameter_types! {
|
||||
pub LeafVersion: MmrLeafVersion = MmrLeafVersion::new(0, 0);
|
||||
}
|
||||
|
||||
pub struct BeefyDummyDataProvider;
|
||||
|
||||
impl beefy_primitives::mmr::BeefyDataProvider<()> for BeefyDummyDataProvider {
|
||||
fn extra_data() -> () {
|
||||
()
|
||||
}
|
||||
}
|
||||
|
||||
impl pallet_beefy_mmr::Config for Runtime {
|
||||
type LeafVersion = LeafVersion;
|
||||
type BeefyAuthorityToMerkleLeaf = pallet_beefy_mmr::BeefyEcdsaToEthereum;
|
||||
type ParachainHeads = ();
|
||||
type LeafExtra = ();
|
||||
type BeefyDataProvider = BeefyDummyDataProvider;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -360,9 +369,9 @@ parameter_types! {
|
||||
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter<Balances, ()>;
|
||||
type TransactionByteFee = TransactionByteFee;
|
||||
type OperationalFeeMultiplier = OperationalFeeMultiplier;
|
||||
type WeightToFee = bp_rialto::WeightToFee;
|
||||
type LengthToFee = bp_rialto::WeightToFee;
|
||||
type FeeMultiplierUpdate = pallet_transaction_payment::TargetedFeeAdjustment<
|
||||
Runtime,
|
||||
TargetBlockFullness,
|
||||
@@ -610,7 +619,7 @@ impl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
|
||||
impl pallet_mmr_primitives::MmrApi<Block, Hash> for Runtime {
|
||||
impl sp_mmr_primitives::MmrApi<Block, Hash> for Runtime {
|
||||
fn generate_proof(leaf_index: u64)
|
||||
-> Result<(EncodableOpaqueLeaf, MmrProof<Hash>), MmrError>
|
||||
{
|
||||
@@ -641,6 +650,10 @@ impl_runtime_apis! {
|
||||
let node = DataOrHash::Data(leaf.into_opaque_leaf());
|
||||
pallet_mmr::verify_leaf_proof::<MmrHashing, _>(root, node, proof)
|
||||
}
|
||||
|
||||
fn mmr_root() -> Result<Hash, MmrError> {
|
||||
Ok(Mmr::mmr_root())
|
||||
}
|
||||
}
|
||||
|
||||
impl bp_millau::MillauFinalityApi<Block> for Runtime {
|
||||
@@ -715,7 +728,7 @@ impl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
|
||||
impl polkadot_primitives::v2::ParachainHost<Block, Hash, BlockNumber> for Runtime {
|
||||
impl polkadot_primitives::runtime_api::ParachainHost<Block, Hash, BlockNumber> for Runtime {
|
||||
fn validators() -> Vec<polkadot_primitives::v2::ValidatorId> {
|
||||
polkadot_runtime_parachains::runtime_api_impl::v2::validators::<Runtime>()
|
||||
}
|
||||
@@ -809,6 +822,10 @@ impl_runtime_apis! {
|
||||
{
|
||||
polkadot_runtime_parachains::runtime_api_impl::v2::validation_code_hash::<Runtime>(para_id, assumption)
|
||||
}
|
||||
|
||||
fn staging_get_disputes() -> Vec<(polkadot_primitives::v2::SessionIndex, polkadot_primitives::v2::CandidateHash, polkadot_primitives::v2::DisputeState<BlockNumber>)> {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
impl sp_authority_discovery::AuthorityDiscoveryApi<Block> for Runtime {
|
||||
|
||||
@@ -11,7 +11,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
|
||||
ed25519-dalek = { version = "1.0", default-features = false, optional = true }
|
||||
hash-db = { version = "0.15.2", default-features = false }
|
||||
scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
|
||||
static_assertions = { version = "1.1", optional = true }
|
||||
|
||||
# Bridge dependencies
|
||||
|
||||
@@ -9,7 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
|
||||
log = { version = "0.4.14", default-features = false }
|
||||
scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
|
||||
|
||||
# Bridge dependencies
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features =
|
||||
finality-grandpa = { version = "0.15.0", default-features = false }
|
||||
log = { version = "0.4.14", default-features = false }
|
||||
num-traits = { version = "0.2", default-features = false }
|
||||
scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
|
||||
serde = { version = "1.0", optional = true }
|
||||
|
||||
# Bridge Dependencies
|
||||
|
||||
@@ -11,7 +11,7 @@ bitvec = { version = "1", default-features = false, features = ["alloc"] }
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
|
||||
log = { version = "0.4.14", default-features = false }
|
||||
num-traits = { version = "0.2", default-features = false }
|
||||
scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
|
||||
serde = { version = "1.0.101", optional = true, features = ["derive"] }
|
||||
|
||||
# Bridge dependencies
|
||||
|
||||
@@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
|
||||
scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
|
||||
|
||||
# Substrate Dependencies
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
|
||||
log = { version = "0.4.14", default-features = false }
|
||||
scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
|
||||
serde = { version = "1.0", optional = true }
|
||||
|
||||
# Bridge dependencies
|
||||
|
||||
@@ -301,7 +301,8 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
let swap_account = swap_account_id::<T, I>(&swap);
|
||||
let actual_send_message_weight = frame_support::storage::with_transaction(|| {
|
||||
let actual_send_message_weight = frame_support::storage::with_transaction(
|
||||
|| -> sp_runtime::TransactionOutcome<Result<_, sp_runtime::DispatchError>> {
|
||||
// funds are transferred from This account to the temporary Swap account
|
||||
let transfer_result = T::ThisCurrency::transfer(
|
||||
&swap.source_account_at_this_chain,
|
||||
@@ -324,13 +325,13 @@ pub mod pallet {
|
||||
);
|
||||
|
||||
return sp_runtime::TransactionOutcome::Rollback(Err(
|
||||
Error::<T, I>::FailedToTransferToSwapAccount,
|
||||
Error::<T, I>::FailedToTransferToSwapAccount.into(),
|
||||
))
|
||||
}
|
||||
|
||||
// the transfer message is sent over the bridge. The message is supposed to be a
|
||||
// `Currency::transfer` call on the bridged chain, but no checks are made - it is
|
||||
// the transaction submitter to ensure it is valid.
|
||||
// `Currency::transfer` call on the bridged chain, but no checks are made - it
|
||||
// is the transaction submitter to ensure it is valid.
|
||||
let send_message_result = T::MessagesBridge::send_message(
|
||||
RawOrigin::TokenSwap {
|
||||
source_account_at_this_chain: swap.source_account_at_this_chain.clone(),
|
||||
@@ -362,7 +363,7 @@ pub mod pallet {
|
||||
);
|
||||
|
||||
return sp_runtime::TransactionOutcome::Rollback(Err(
|
||||
Error::<T, I>::FailedToSendTransferMessage,
|
||||
Error::<T, I>::FailedToSendTransferMessage.into(),
|
||||
))
|
||||
},
|
||||
};
|
||||
@@ -386,7 +387,7 @@ pub mod pallet {
|
||||
);
|
||||
|
||||
return sp_runtime::TransactionOutcome::Rollback(Err(
|
||||
Error::<T, I>::SwapAlreadyStarted,
|
||||
Error::<T, I>::SwapAlreadyStarted.into(),
|
||||
))
|
||||
}
|
||||
|
||||
@@ -404,7 +405,8 @@ pub mod pallet {
|
||||
Self::deposit_event(Event::SwapStarted(swap_hash, sent_message.nonce));
|
||||
|
||||
sp_runtime::TransactionOutcome::Commit(Ok(sent_message.weight))
|
||||
})?;
|
||||
},
|
||||
)?;
|
||||
|
||||
Ok(PostDispatchInfo {
|
||||
actual_weight: Some(base_weight.saturating_add(actual_send_message_weight)),
|
||||
@@ -617,7 +619,8 @@ pub mod pallet {
|
||||
event: Event<T, I>,
|
||||
) -> DispatchResultWithPostInfo {
|
||||
let swap_account = swap_account_id::<T, I>(&swap);
|
||||
frame_support::storage::with_transaction(|| {
|
||||
frame_support::storage::with_transaction(
|
||||
|| -> sp_runtime::TransactionOutcome<Result<_, sp_runtime::DispatchError>> {
|
||||
// funds are transferred from the temporary Swap account to the destination account
|
||||
let transfer_result = T::ThisCurrency::transfer(
|
||||
&swap_account,
|
||||
@@ -658,8 +661,9 @@ pub mod pallet {
|
||||
// finally - emit the event
|
||||
Pallet::<T, I>::deposit_event(event);
|
||||
|
||||
sp_runtime::TransactionOutcome::Commit(Ok(().into()))
|
||||
})
|
||||
sp_runtime::TransactionOutcome::Commit(Ok(Ok(().into())))
|
||||
},
|
||||
)?
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ hash256-std-hasher = { version = "0.15.2", default-features = false }
|
||||
impl-codec = { version = "0.6", default-features = false }
|
||||
impl-serde = { version = "0.3.1", optional = true }
|
||||
parity-util-mem = { version = "0.11", default-features = false, features = ["primitive-types"] }
|
||||
scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
|
||||
serde = { version = "1.0", optional = true, features = ["derive"] }
|
||||
|
||||
# Substrate Based Dependencies
|
||||
|
||||
@@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
|
||||
[dependencies]
|
||||
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
|
||||
smallvec = "1.7"
|
||||
|
||||
# Bridge Dependencies
|
||||
|
||||
@@ -9,7 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
|
||||
finality-grandpa = { version = "0.15.0", default-features = false }
|
||||
scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
|
||||
serde = { version = "1.0", optional = true }
|
||||
|
||||
# Bridge dependencies
|
||||
|
||||
@@ -9,7 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
[dependencies]
|
||||
bp-runtime = { path = "../runtime", default-features = false }
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
|
||||
scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
|
||||
|
||||
# Substrate Dependencies
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
bitvec = { version = "1", default-features = false, features = ["alloc"] }
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "bit-vec"] }
|
||||
impl-trait-for-tuples = "0.2"
|
||||
scale-info = { version = "2.0.1", default-features = false, features = ["bit-vec", "derive"] }
|
||||
scale-info = { version = "2.1.1", default-features = false, features = ["bit-vec", "derive"] }
|
||||
serde = { version = "1.0", optional = true, features = ["derive"] }
|
||||
|
||||
# Bridge dependencies
|
||||
|
||||
@@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
|
||||
[dependencies]
|
||||
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
|
||||
|
||||
# Bridge Dependencies
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
|
||||
hash-db = { version = "0.15.2", default-features = false }
|
||||
num-traits = { version = "0.2", default-features = false }
|
||||
scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
|
||||
|
||||
# Substrate Dependencies
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
use bp_header_chain::justification::GrandpaJustification;
|
||||
use codec::Encode;
|
||||
use sp_application_crypto::TryFrom;
|
||||
use sp_finality_grandpa::{AuthorityId, AuthoritySignature, AuthorityWeight, SetId};
|
||||
use sp_runtime::traits::{Header as HeaderT, One, Zero};
|
||||
use sp_std::prelude::*;
|
||||
|
||||
@@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
|
||||
scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
|
||||
|
||||
# Bridge Dependencies
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
[dependencies]
|
||||
anyhow = "1.0"
|
||||
async-std = "1.9.0"
|
||||
async-trait = "0.1.42"
|
||||
async-trait = "0.1"
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0" }
|
||||
futures = "0.3.12"
|
||||
hex = "0.4"
|
||||
@@ -68,10 +68,10 @@ sp-version = { git = "https://github.com/paritytech/substrate", branch = "master
|
||||
|
||||
# Polkadot Dependencies
|
||||
|
||||
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "master" }
|
||||
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "master" }
|
||||
polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot", branch = "master" }
|
||||
polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "master" }
|
||||
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "gav-xcm-v3" }
|
||||
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "gav-xcm-v3" }
|
||||
polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot", branch = "gav-xcm-v3" }
|
||||
polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "gav-xcm-v3" }
|
||||
|
||||
[dev-dependencies]
|
||||
bp-test-utils = { path = "../../primitives/test-utils" }
|
||||
|
||||
@@ -9,7 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0" }
|
||||
relay-substrate-client = { path = "../client-substrate" }
|
||||
relay-utils = { path = "../utils" }
|
||||
scale-info = { version = "2.0.1", features = ["derive"] }
|
||||
scale-info = { version = "2.1.1", features = ["derive"] }
|
||||
|
||||
# Bridge dependencies
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0" }
|
||||
relay-substrate-client = { path = "../client-substrate" }
|
||||
relay-utils = { path = "../utils" }
|
||||
scale-info = { version = "2.0.1", features = ["derive"] }
|
||||
scale-info = { version = "2.1.1", features = ["derive"] }
|
||||
|
||||
# Bridge dependencies
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0" }
|
||||
relay-substrate-client = { path = "../client-substrate" }
|
||||
relay-utils = { path = "../utils" }
|
||||
scale-info = { version = "2.0.1", features = ["derive"] }
|
||||
scale-info = { version = "2.1.1", features = ["derive"] }
|
||||
|
||||
# Bridge dependencies
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
|
||||
[dependencies]
|
||||
async-std = { version = "1.6.5", features = ["attributes"] }
|
||||
async-trait = "0.1.40"
|
||||
async-trait = "0.1"
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0" }
|
||||
jsonrpsee = { version = "0.8", features = ["macros", "ws-client"] }
|
||||
log = "0.4.11"
|
||||
|
||||
@@ -9,7 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0" }
|
||||
relay-substrate-client = { path = "../client-substrate" }
|
||||
relay-utils = { path = "../utils" }
|
||||
scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
|
||||
|
||||
# Bridge dependencies
|
||||
bridge-runtime-common = { path = "../../bin/runtime-common" }
|
||||
|
||||
@@ -8,7 +8,7 @@ description = "Finality proofs relay"
|
||||
|
||||
[dependencies]
|
||||
async-std = "1.6.5"
|
||||
async-trait = "0.1.40"
|
||||
async-trait = "0.1"
|
||||
backoff = "0.2"
|
||||
bp-header-chain = { path = "../../primitives/header-chain" }
|
||||
futures = "0.3.5"
|
||||
|
||||
@@ -9,7 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
anyhow = "1.0"
|
||||
thiserror = "1.0.26"
|
||||
async-std = "1.9.0"
|
||||
async-trait = "0.1.42"
|
||||
async-trait = "0.1"
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0" }
|
||||
futures = "0.3.12"
|
||||
num-traits = "0.2"
|
||||
|
||||
@@ -7,7 +7,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
|
||||
[dependencies]
|
||||
async-std = { version = "1.6.5", features = ["attributes"] }
|
||||
async-trait = "0.1.40"
|
||||
async-trait = "0.1"
|
||||
futures = "0.3.5"
|
||||
hex = "0.4"
|
||||
log = "0.4.11"
|
||||
|
||||
@@ -9,7 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
ansi_term = "0.12"
|
||||
anyhow = "1.0"
|
||||
async-std = "1.6.5"
|
||||
async-trait = "0.1.40"
|
||||
async-trait = "0.1"
|
||||
backoff = "0.2"
|
||||
isahc = "1.2"
|
||||
env_logger = "0.8.2"
|
||||
|
||||
Reference in New Issue
Block a user