Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
wip
  • Loading branch information
daniel-savu committed Nov 11, 2022
commit 88eb0ffae2530c119b0c8b96d6866d5ea30a05ca
403 changes: 274 additions & 129 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,14 @@ sp-transaction-pool = { git = "https://github.com/paritytech//substrate", branch
sp-trie = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.31" }
sp-version = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.31" }
sp-wasm-interface = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.31" }
sp-weights = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.31" }
substrate-build-script-utils = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.31" }
substrate-frame-rpc-system = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.31" }
substrate-prometheus-endpoint = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.31" }
substrate-wasm-builder = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.31" }
try-runtime-cli = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.31" }
sc-consensus-manual-seal = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.31" }
sc-peerset = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.31" }
sc-sysinfo = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.31" }
substrate-state-trie-migration-rpc = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.31" }
beefy-gadget= { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.31" }
Expand Down Expand Up @@ -195,6 +197,8 @@ xcm = { git = "https://github.com/paritytech//polkadot", branch = "release-v0.9.
xcm-builder = { git = "https://github.com/paritytech//polkadot", branch = "release-v0.9.31" }
xcm-executor = { git = "https://github.com/paritytech//polkadot", branch = "release-v0.9.31" }
xcm-simulator = { git = "https://github.com/paritytech//polkadot", branch = "release-v0.9.31" }
polkadot-node-subsystem-util = { git = "https://github.com/paritytech//polkadot", branch = "release-v0.9.31" }
polkadot-node-core-av-store = { git = "https://github.com/paritytech//polkadot", branch = "release-v0.9.31" }

[patch."https://github.com/paritytech/cumulus"]
cumulus-client-cli = { git = "https://github.com/paritytech//cumulus", branch = "polkadot-v0.9.31" }
Expand Down
3 changes: 2 additions & 1 deletion parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ name = "interbtc-parachain"
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" }

[dependencies]
clap = { version = "3.1", features = [ "derive" ] }
clap = { version = "4.0.9", features = [ "derive" ] }
log = "0.4.8"
codec = { package = "parity-scale-codec", version = "3.1.5" }
serde = { version = "1.0.130", features = ["derive"] }
Expand Down Expand Up @@ -96,6 +96,7 @@ cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus
cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.31" }
cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.31" }
cumulus-relay-chain-rpc-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.31" }
cumulus-relay-chain-minimal-node = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.31" }

# Polkadot dependencies
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.31" }
Expand Down
12 changes: 6 additions & 6 deletions parachain/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub enum Subcommand {
Revert(sc_cli::RevertCmd),

/// The custom benchmark subcommmand benchmarking runtime pallets.
#[clap(subcommand)]
#[command(subcommand)]
Benchmark(frame_benchmarking_cli::BenchmarkCmd),

/// Try some command against runtime state.
Expand All @@ -56,19 +56,19 @@ pub enum Subcommand {
#[derive(Debug, Parser)]
pub struct ExportMetadataCommand {
/// Output file name or stdout if unspecified.
#[clap(action)]
#[arg(action)]
pub output: Option<PathBuf>,

/// Write output in binary. Default is to write in hex.
#[clap(short, long)]
#[arg(short, long)]
pub raw: bool,

/// The name of the runtime to retrieve the metadata from.
#[clap(long, arg_enum)]
#[arg(long)]
pub runtime: RuntimeName,
}

#[derive(clap::ArgEnum, Debug, Clone)]
#[derive(clap::ValueEnum, Debug, Clone)]
pub enum RuntimeName {
Interlay,
Kintsugi,
Expand All @@ -83,7 +83,7 @@ pub enum RuntimeName {
subcommand_negates_reqs = true
)]
pub struct Cli {
#[clap(subcommand)]
#[command(subcommand)]
pub subcommand: Option<Subcommand>,

#[clap(flatten)]
Expand Down
8 changes: 2 additions & 6 deletions parachain/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use cumulus_primitives_core::ParaId;
use cumulus_primitives_parachain_inherent::{MockValidationDataInherentDataProvider, MockXcmConfig};
use cumulus_relay_chain_inprocess_interface::build_inprocess_relay_chain;
use cumulus_relay_chain_interface::{RelayChainError, RelayChainInterface, RelayChainResult};
use cumulus_relay_chain_rpc_interface::{create_client_and_start_worker, RelayChainRpcInterface};
use cumulus_relay_chain_minimal_node::build_minimal_relay_chain_node;
use polkadot_service::CollatorPair;

use futures::StreamExt;
Expand Down Expand Up @@ -280,10 +280,7 @@ async fn build_relay_chain_interface(
collator_options: CollatorOptions,
) -> RelayChainResult<(Arc<(dyn RelayChainInterface + 'static)>, Option<CollatorPair>)> {
match collator_options.relay_chain_rpc_url {
Some(relay_chain_url) => {
let client = create_client_and_start_worker(relay_chain_url, task_manager).await?;
Ok((Arc::new(RelayChainRpcInterface::new(client)) as Arc<_>, None))
}
Some(relay_chain_url) => build_minimal_relay_chain_node(polkadot_config, task_manager, relay_chain_url).await,
None => build_inprocess_relay_chain(
polkadot_config,
parachain_config,
Expand Down Expand Up @@ -449,7 +446,6 @@ where
relay_chain_interface,
import_queue,
relay_chain_slot_duration,
collator_options,
};

start_full_node(params)?;
Expand Down
2 changes: 1 addition & 1 deletion standalone/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ name = "interbtc-standalone"
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" }

[dependencies]
clap = { version = "3.1", features = [ "derive" ] }
clap = { version = "4.0.9", features = [ "derive" ] }
log = "0.4.8"
codec = { package = "parity-scale-codec", version = "3.1.5" }
serde = { version = "1.0.130", features = ["derive"] }
Expand Down
12 changes: 6 additions & 6 deletions standalone/runtime/tests/test_annuity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,36 +134,36 @@ fn should_distribute_vault_rewards_from_supply() {
when: start_height + YEARS * 0,
maybe_periodic: None,
priority: 63,
call: Box::new(MaybeHashed::Value(RuntimeCall::Tokens(TokensCall::force_transfer {
call: Box::new(RuntimeCall::Tokens(TokensCall::force_transfer {
source: SupplyPallet::account_id(),
dest: VaultAnnuityPallet::account_id(),
currency_id: DEFAULT_NATIVE_CURRENCY,
amount: Permill::from_percent(40) * total_rewards,
}))),
})),
}),
RuntimeCall::Scheduler(SchedulerCall::schedule_named {
id: "Year 2".encode(),
when: start_height + YEARS * 1,
maybe_periodic: None,
priority: 63,
call: Box::new(MaybeHashed::Value(RuntimeCall::Tokens(TokensCall::force_transfer {
call: Box::new(RuntimeCall::Tokens(TokensCall::force_transfer {
source: SupplyPallet::account_id(),
dest: VaultAnnuityPallet::account_id(),
currency_id: DEFAULT_NATIVE_CURRENCY,
amount: Permill::from_percent(30) * total_rewards,
}))),
})),
}),
RuntimeCall::Scheduler(SchedulerCall::schedule_named {
id: "Year 3".encode(),
when: start_height + YEARS * 2,
maybe_periodic: None,
priority: 63,
call: Box::new(MaybeHashed::Value(RuntimeCall::Tokens(TokensCall::force_transfer {
call: Box::new(RuntimeCall::Tokens(TokensCall::force_transfer {
source: SupplyPallet::account_id(),
dest: VaultAnnuityPallet::account_id(),
currency_id: DEFAULT_NATIVE_CURRENCY,
amount: Permill::from_percent(20) * total_rewards,
}))),
})),
}),
RuntimeCall::Scheduler(SchedulerCall::schedule_named {
id: "Year 4".encode(),
Expand Down
23 changes: 9 additions & 14 deletions standalone/runtime/tests/test_multisig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,12 @@ fn integration_test_transfer_from_multisig_to_vested() {
dest: account_of(EVE),
currency_id: Token(INTR),
amount: 20_000_000_000_001,
})
.encode();
});
assert_ok!(RuntimeCall::Multisig(MultisigCall::as_multi {
threshold: 2,
other_signatories: vec![account_of(BOB)],
maybe_timepoint: None,
call: WrapperKeepOpaque::from_encoded(call.clone()),
store_call: true,
call: Box::new(call.clone()),
max_weight: Weight::from_ref_time(1000000000000 as u64),
})
.dispatch(origin_of(account_of(ALICE))));
Expand All @@ -72,7 +70,7 @@ fn integration_test_transfer_from_multisig_to_vested() {
threshold: 2,
other_signatories: vec![account_of(ALICE)],
maybe_timepoint: Some(timepoint),
call_hash: sp_core::blake2_256(&call),
call_hash: sp_core::blake2_256(&call.encode()),
max_weight: Weight::from_ref_time(1000000000000 as u64),
})
.dispatch(origin_of(account_of(BOB))));
Expand Down Expand Up @@ -109,15 +107,13 @@ fn integration_test_transfer_from_multisig_to_unvested() {
period_count: 100,
per_period: vesting_amount / 100,
},
})
.encode();
});

assert_ok!(RuntimeCall::Multisig(MultisigCall::as_multi {
threshold: 2,
other_signatories: vec![account_of(BOB)],
maybe_timepoint: None,
call: WrapperKeepOpaque::from_encoded(call.clone()),
store_call: true,
call: Box::new(call.clone()),
max_weight: Weight::from_ref_time(1000000000000 as u64),
})
.dispatch(origin_of(account_of(ALICE))));
Expand All @@ -126,7 +122,7 @@ fn integration_test_transfer_from_multisig_to_unvested() {
threshold: 2,
other_signatories: vec![account_of(ALICE)],
maybe_timepoint: Some(MultisigPallet::timepoint()),
call_hash: sp_core::blake2_256(&call),
call_hash: sp_core::blake2_256(&call.encode()),
max_weight: Weight::from_ref_time(1000000000000 as u64),
})
.dispatch(origin_of(account_of(BOB))));
Expand Down Expand Up @@ -265,14 +261,13 @@ fn integration_test_batched_multisig_vesting() {
})
.collect();

let batch = RuntimeCall::Utility(UtilityCall::batch { calls }).encode();
let batch = RuntimeCall::Utility(UtilityCall::batch { calls });

assert_ok!(RuntimeCall::Multisig(MultisigCall::as_multi {
threshold: 2,
other_signatories: vec![account_of(BOB)],
maybe_timepoint: None,
call: WrapperKeepOpaque::from_encoded(batch.clone()),
store_call: true,
call: Box::new(batch.clone()),
max_weight: Weight::from_ref_time(1000000000000 as u64),
})
.dispatch(origin_of(account_of(ALICE))));
Expand All @@ -281,7 +276,7 @@ fn integration_test_batched_multisig_vesting() {
threshold: 2,
other_signatories: vec![account_of(ALICE)],
maybe_timepoint: Some(MultisigPallet::timepoint()),
call_hash: sp_core::blake2_256(&batch),
call_hash: sp_core::blake2_256(&batch.encode()),
max_weight: Weight::from_ref_time(1000000000000 as u64),
})
.dispatch(origin_of(account_of(BOB))));
Expand Down
4 changes: 2 additions & 2 deletions standalone/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub enum Subcommand {
Revert(sc_cli::RevertCmd),

/// The custom benchmark subcommmand benchmarking runtime pallets.
#[clap(subcommand)]
#[command(subcommand)]
Benchmark(frame_benchmarking_cli::BenchmarkCmd),
}

Expand Down Expand Up @@ -67,7 +67,7 @@ impl std::ops::Deref for RunCmd {
subcommand_negates_reqs = true
)]
pub struct Cli {
#[clap(subcommand)]
#[command(subcommand)]
pub subcommand: Option<Subcommand>,

#[clap(flatten)]
Expand Down