Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3,202 changes: 1,487 additions & 1,715 deletions Cargo.lock

Large diffs are not rendered by default.

346 changes: 173 additions & 173 deletions Cargo.toml

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions crates/annuity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ scale-info = { version = "2.0.0", default-features = false, features = ["derive"
primitives = { package = "interbtc-primitives", path = "../../primitives", default-features = false }

# Substrate dependencies
sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }

frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false, optional = true }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false, optional = true }

[dev-dependencies]
mocktopus = "0.7.0"
rand = "0.8.3"
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }

primitives = { package = "interbtc-primitives", path = "../../primitives", default-features = false }

Expand Down
2 changes: 1 addition & 1 deletion crates/annuity/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ pub mod pallet {
// "Internal" functions, callable by code.
impl<T: Config<I>, I: 'static> Pallet<T, I> {
pub fn account_id() -> T::AccountId {
T::AnnuityPalletId::get().into_account()
T::AnnuityPalletId::get().into_account_truncating()
}

pub fn min_reward_per_block() -> BalanceOf<T, I> {
Expand Down
6 changes: 3 additions & 3 deletions crates/bitcoin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ secp256k1 = { package = "secp256k1", git = "https://github.com/rust-bitcoin/rust
spin = { version = "0.7.1", default-features = false }

# Substrate dependencies
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }

[dev-dependencies]
mocktopus = "0.7.0"
Expand Down
20 changes: 10 additions & 10 deletions crates/btc-relay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features =
scale-info = { version = "2.0.0", default-features = false, features = ["derive"] }

# Substrate dependencies
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }

frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false, optional = true }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false, optional = true }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }

# Parachain dependencies
bitcoin = { path = "../bitcoin", default-features = false }
Expand All @@ -27,7 +27,7 @@ security = { path = "../security", default-features = false }
[dev-dependencies]
mocktopus = "0.7.0"
hex = "0.4.2"
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
itertools = "0.10.0"

[features]
Expand Down
10 changes: 4 additions & 6 deletions crates/btc-relay/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ edition = "2021"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0" }
jsonrpc-core = "18.0.0"
jsonrpc-core-client = "18.0.0"
jsonrpc-derive = "18.0.0"
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20" }
jsonrpsee = { version = "0.13.0", features = ["server", "macros"] }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
module-btc-relay-rpc-runtime-api = { path = "runtime-api" }
6 changes: 3 additions & 3 deletions crates/btc-relay/rpc/runtime-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ edition = "2021"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }

[features]
default = ["std"]
Expand Down
45 changes: 20 additions & 25 deletions crates/btc-relay/rpc/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
//! RPC interface for the BtcRelay Module.

use codec::Codec;
use jsonrpc_core::{Error as RpcError, ErrorCode, Result as JsonRpcResult};
use jsonrpc_derive::rpc;
use jsonrpsee::{
core::{async_trait, Error as JsonRpseeError, RpcResult},
proc_macros::rpc,
types::error::{CallError, ErrorCode, ErrorObject},
};
use sp_api::ProvideRuntimeApi;
use sp_blockchain::HeaderBackend;
use sp_runtime::{generic::BlockId, traits::Block as BlockT, DispatchError};
use std::sync::Arc;

pub use self::gen_client::Client as RefundClient;
pub use module_btc_relay_rpc_runtime_api::BtcRelayApi as BtcRelayRuntimeApi;

#[rpc]
#[rpc(client, server)]
pub trait BtcRelayApi<BlockHash, H256Le> {
#[rpc(name = "btcRelay_verifyBlockHeaderInclusion")]
#[method(name = "btcRelay_verifyBlockHeaderInclusion")]
fn verify_block_header_inclusion(
&self,
block_hash: H256Le,
at: Option<BlockHash>,
) -> JsonRpcResult<Result<(), DispatchError>>;
) -> RpcResult<Result<(), DispatchError>>;
}

fn internal_err<T: ToString>(message: T) -> JsonRpseeError {
JsonRpseeError::Call(CallError::Custom(ErrorObject::owned(
ErrorCode::InternalError.code(),
message.to_string(),
None::<()>,
)))
}

/// A struct that implements the [`BtcRelayApi`].
Expand All @@ -37,19 +47,8 @@ impl<C, B> BtcRelay<C, B> {
}
}

pub enum Error {
RuntimeError,
}

impl From<Error> for i64 {
fn from(e: Error) -> i64 {
match e {
Error::RuntimeError => 1,
}
}
}

impl<C, Block, H256Le> BtcRelayApi<<Block as BlockT>::Hash, H256Le> for BtcRelay<C, Block>
#[async_trait]
impl<C, Block, H256Le> BtcRelayApiServer<<Block as BlockT>::Hash, H256Le> for BtcRelay<C, Block>
where
Block: BlockT,
C: Send + Sync + 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>,
Expand All @@ -60,15 +59,11 @@ where
&self,
block_hash: H256Le,
at: Option<<Block as BlockT>::Hash>,
) -> JsonRpcResult<Result<(), DispatchError>> {
) -> RpcResult<Result<(), DispatchError>> {
let api = self.client.runtime_api();
let at = BlockId::hash(at.unwrap_or_else(|| self.client.info().best_hash));

api.verify_block_header_inclusion(&at, block_hash)
.map_err(|e| RpcError {
code: ErrorCode::ServerError(Error::RuntimeError.into()),
message: "Unable to verify block header inclusion".into(),
data: Some(format!("{:?}", e).into()),
})
.map_err(|e| internal_err(format!("execution error: Unable to dry run extrinsic {:?}", e)))
}
}
22 changes: 11 additions & 11 deletions crates/currency/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@ serde = { version = "1.0.130", default-features = false, features = ["derive"],
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] }
scale-info = { version = "2.0.0", default-features = false, features = ["derive"] }

sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }

# Parachain dependencies
primitives = { package = "interbtc-primitives", path = "../../primitives", default-features = false }

# Orml dependencies
orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "78f2d4521856e100d625336692befcc10819e856", default-features = false }
orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "78f2d4521856e100d625336692befcc10819e856", default-features = false }
orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "e1caed6585f97110c2fd6f5fbcde9eea011457df", default-features = false }
orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "e1caed6585f97110c2fd6f5fbcde9eea011457df", default-features = false }

# for other pallets wanting to mock functions
mocktopus = {version = "0.7.0", optional = true }

[dev-dependencies]
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }

[features]
default = ["std"]
Expand Down
2 changes: 2 additions & 0 deletions crates/currency/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ impl orml_tokens::Config for Test {
type DustRemovalWhitelist = Everything;
type MaxReserves = ConstU32<0>; // we don't use named reserves
type ReserveIdentifier = (); // we don't use named reserves
type OnNewTokenAccount = ();
type OnKilledTokenAccount = ();
}

pub struct CurrencyConvert;
Expand Down
20 changes: 10 additions & 10 deletions crates/democracy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ serde = { version = "1.0.130", default-features = false, features = ["derive"],
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] }
scale-info = { version = "2.0.0", default-features = false, features = ["derive"] }

sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false, optional = true }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20", default-features = false }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false, optional = true }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }

[dev-dependencies]
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20" }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20" }
pallet-scheduler = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.20" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
pallet-scheduler = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }

[features]
default = ["std"]
Expand Down
Loading