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

Commit

Permalink
Try fix deps (#335)
Browse files Browse the repository at this point in the history
* Update dependencies

* Fix package

* Update dependencies

* Update dependencies

* fix compile

* Clippy
  • Loading branch information
fewensa authored Dec 1, 2021
1 parent 63d16b2 commit b8857eb
Show file tree
Hide file tree
Showing 33 changed files with 545 additions and 692 deletions.
693 changes: 273 additions & 420 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions components/client-crab-s2s/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ bp-messages = { git = "https://github.com/darwinia-network/parity-bri
bp-runtime = { git = "https://github.com/darwinia-network/parity-bridges-common.git", tag = "darwinia-v0.11.6-4" }

## Bridge dependencies
crab-runtime = { git = "https://github.com/darwinia-network/darwinia.git", branch = "bump-deps" }
common-primitives = { git = "https://github.com/darwinia-network/darwinia.git", branch = "bump-deps" }
bridge-primitives = { git = "https://github.com/darwinia-network/darwinia.git", branch = "bump-deps" }
dp-fee = { git = "https://github.com/darwinia-network/darwinia-common.git", tag = "darwinia-v0.11.6-3" }
crab-runtime = { git = "https://github.com/darwinia-network/darwinia.git", branch = "bump-deps" }
darwinia-common-primitives = { git = "https://github.com/darwinia-network/darwinia.git", branch = "bump-deps" }
darwinia-bridge-primitives = { git = "https://github.com/darwinia-network/darwinia.git", branch = "bump-deps" }
dp-fee = { git = "https://github.com/darwinia-network/darwinia-common.git", branch = "bump-deps-darwinia" }



Expand Down
22 changes: 11 additions & 11 deletions components/client-crab-s2s/src/api.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use bp_messages::{LaneId, MessageNonce};
use codec::Encode;
use common_primitives::AccountId;
use common_primitives::Balance;
use common_primitives::BlockNumber;
use darwinia_common_primitives::AccountId;
use darwinia_common_primitives::Balance;
use darwinia_common_primitives::BlockNumber;
use dp_fee::{Order, Relayer};
use relay_substrate_client::{ChainBase, Client, TransactionSignScheme, UnsignedTransaction};
use relay_utils::relay_loop::Client as RelayLoopClient;
Expand Down Expand Up @@ -35,7 +35,7 @@ impl CrabApi {
if e.is_connection_error() {
self.client.reconnect().await?;
}
Err(e)?
Err(e.into())
}
}
}
Expand All @@ -57,7 +57,7 @@ impl CrabApi {
if e.is_connection_error() {
self.client.reconnect().await?;
}
Err(e)?
Err(e.into())
}
}
}
Expand All @@ -73,7 +73,7 @@ impl CrabApi {
if e.is_connection_error() {
self.client.reconnect().await?;
}
Err(e)?
Err(e.into())
}
}
}
Expand All @@ -94,7 +94,7 @@ impl CrabApi {
if e.is_connection_error() {
self.client.reconnect().await?;
}
Err(e)?
Err(e.into())
}
}
}
Expand All @@ -106,14 +106,14 @@ impl CrabApi {
/// Return number of the best finalized block.
pub async fn best_finalized_header_number(
&mut self,
) -> anyhow::Result<common_primitives::BlockNumber> {
) -> anyhow::Result<darwinia_common_primitives::BlockNumber> {
match self.client.best_finalized_header_number().await {
Ok(v) => Ok(v),
Err(e) => {
if e.is_connection_error() {
self.client.reconnect().await?;
}
Err(e)?
Err(e.into())
}
}
}
Expand Down Expand Up @@ -149,7 +149,7 @@ impl CrabApi {
if e.is_connection_error() {
self.client.reconnect().await?;
}
Err(e)?
Err(e.into())
}
}
}
Expand Down Expand Up @@ -185,7 +185,7 @@ impl CrabApi {
if e.is_connection_error() {
self.client.reconnect().await?;
}
Err(e)?
Err(e.into())
}
}
}
Expand Down
34 changes: 19 additions & 15 deletions components/client-crab-s2s/src/crab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ use sp_runtime::{generic::SignedPayload, traits::IdentifyAccount};
use std::time::Duration;

/// Pangoro header id.
pub type HeaderId = relay_utils::HeaderId<common_primitives::Hash, common_primitives::BlockNumber>;
pub type HeaderId = relay_utils::HeaderId<
darwinia_common_primitives::Hash,
darwinia_common_primitives::BlockNumber,
>;

/// Pangoro chain definition.
#[derive(Debug, Clone, Copy)]
Expand All @@ -22,23 +25,24 @@ impl BridgeChain for CrabChain {
}

impl ChainBase for CrabChain {
type BlockNumber = common_primitives::BlockNumber;
type Hash = common_primitives::Hash;
type Hasher = common_primitives::Hashing;
type Header = common_primitives::Header;

type AccountId = common_primitives::AccountId;
type Balance = common_primitives::Balance;
type Index = common_primitives::Nonce;
type Signature = common_primitives::Signature;
type BlockNumber = darwinia_common_primitives::BlockNumber;
type Hash = darwinia_common_primitives::Hash;
type Hasher = darwinia_common_primitives::Hashing;
type Header = darwinia_common_primitives::Header;

type AccountId = darwinia_common_primitives::AccountId;
type Balance = darwinia_common_primitives::Balance;
type Index = darwinia_common_primitives::Nonce;
type Signature = darwinia_common_primitives::Signature;
}

impl Chain for CrabChain {
const NAME: &'static str = "Crab";
const AVERAGE_BLOCK_INTERVAL: Duration =
Duration::from_millis(common_primitives::MILLISECS_PER_BLOCK);
const STORAGE_PROOF_OVERHEAD: u32 = bridge_primitives::EXTRA_STORAGE_PROOF_SIZE;
const MAXIMAL_ENCODED_ACCOUNT_ID_SIZE: u32 = bridge_primitives::MAXIMAL_ENCODED_ACCOUNT_ID_SIZE;
Duration::from_millis(darwinia_common_primitives::MILLISECS_PER_BLOCK);
const STORAGE_PROOF_OVERHEAD: u32 = darwinia_bridge_primitives::EXTRA_STORAGE_PROOF_SIZE;
const MAXIMAL_ENCODED_ACCOUNT_ID_SIZE: u32 =
darwinia_bridge_primitives::MAXIMAL_ENCODED_ACCOUNT_ID_SIZE;

type SignedBlock = crab_runtime::SignedBlock;
type Call = crab_runtime::Call;
Expand Down Expand Up @@ -110,7 +114,7 @@ impl TransactionSignScheme for CrabChain {
tx.signature
.as_ref()
.map(|(address, _, _)| {
let account_id: common_primitives::AccountId =
let account_id: darwinia_common_primitives::AccountId =
(*signer.public().as_array_ref()).into();
*address == crab_runtime::Address::from(account_id)
})
Expand All @@ -135,4 +139,4 @@ impl TransactionSignScheme for CrabChain {
pub type SigningParams = sp_core::sr25519::Pair;

/// Pangoro header type used in headers sync.
pub type SyncHeader = relay_substrate_client::SyncHeader<common_primitives::Header>;
pub type SyncHeader = relay_substrate_client::SyncHeader<darwinia_common_primitives::Header>;
6 changes: 3 additions & 3 deletions components/client-crab-s2s/src/feemarket.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::ops::Range;

use common_primitives::AccountId;
use darwinia_common_primitives::AccountId;
use messages_relay::message_lane::MessageLane;
use messages_relay::message_lane_loop::{
SourceClient as MessageLaneSourceClient, TargetClient as MessageLaneTargetClient,
Expand Down Expand Up @@ -42,7 +42,7 @@ impl CrabRelayStrategy {
let nonce = &reference.nonce;
let order = self
.api
.order(bridge_primitives::DARWINIA_CRAB_LANE, *nonce)
.order(darwinia_bridge_primitives::DARWINIA_CRAB_LANE, *nonce)
.await
.map_err(|e| {
log::error!("[Pangoro] Failed to query order: {:?}", e);
Expand Down Expand Up @@ -101,7 +101,7 @@ impl CrabRelayStrategy {
let ranges = relayers
.iter()
.map(|item| item.valid_range.clone())
.collect::<Vec<Range<common_primitives::BlockNumber>>>();
.collect::<Vec<Range<darwinia_common_primitives::BlockNumber>>>();

let mut maximum_timeout = 0;
for range in ranges {
Expand Down
10 changes: 5 additions & 5 deletions components/client-darwinia-s2s/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ bp-messages = { git = "https://github.com/darwinia-network/parity-bri
bp-runtime = { git = "https://github.com/darwinia-network/parity-bridges-common.git", tag = "darwinia-v0.11.6-4" }

## Bridge dependencies
darwinia-runtime = { git = "https://github.com/darwinia-network/darwinia.git", branch = "bump-deps" }
common-primitives = { git = "https://github.com/darwinia-network/darwinia.git", branch = "bump-deps" }
bridge-primitives = { git = "https://github.com/darwinia-network/darwinia.git", branch = "bump-deps" }
darwinia-bridge-ethereum = { git = "https://github.com/darwinia-network/darwinia-common.git", tag = "darwinia-v0.11.6-3" }
dp-fee = { git = "https://github.com/darwinia-network/darwinia-common.git", tag = "darwinia-v0.11.6-3" }
darwinia-runtime = { git = "https://github.com/darwinia-network/darwinia.git", branch = "bump-deps" }
darwinia-common-primitives = { git = "https://github.com/darwinia-network/darwinia.git", branch = "bump-deps" }
darwinia-bridge-primitives = { git = "https://github.com/darwinia-network/darwinia.git", branch = "bump-deps" }
darwinia-bridge-ethereum = { git = "https://github.com/darwinia-network/darwinia-common.git", branch = "bump-deps-darwinia" }
dp-fee = { git = "https://github.com/darwinia-network/darwinia-common.git", branch = "bump-deps-darwinia" }



Expand Down
22 changes: 11 additions & 11 deletions components/client-darwinia-s2s/src/api.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use bp_messages::{LaneId, MessageNonce};
use codec::Encode;
use common_primitives::AccountId;
use common_primitives::Balance;
use common_primitives::BlockNumber;
use darwinia_common_primitives::AccountId;
use darwinia_common_primitives::Balance;
use darwinia_common_primitives::BlockNumber;
use dp_fee::{Order, Relayer};
use relay_substrate_client::{ChainBase, Client, TransactionSignScheme, UnsignedTransaction};
use relay_utils::relay_loop::Client as RelayLoopClient;
Expand Down Expand Up @@ -35,7 +35,7 @@ impl DarwiniaApi {
if e.is_connection_error() {
self.client.reconnect().await?;
}
Err(e)?
Err(e.into())
}
}
}
Expand All @@ -57,7 +57,7 @@ impl DarwiniaApi {
if e.is_connection_error() {
self.client.reconnect().await?;
}
Err(e)?
Err(e.into())
}
}
}
Expand All @@ -73,7 +73,7 @@ impl DarwiniaApi {
if e.is_connection_error() {
self.client.reconnect().await?;
}
Err(e)?
Err(e.into())
}
}
}
Expand All @@ -94,7 +94,7 @@ impl DarwiniaApi {
if e.is_connection_error() {
self.client.reconnect().await?;
}
Err(e)?
Err(e.into())
}
}
}
Expand All @@ -106,14 +106,14 @@ impl DarwiniaApi {
/// Return number of the best finalized block.
pub async fn best_finalized_header_number(
&mut self,
) -> anyhow::Result<common_primitives::BlockNumber> {
) -> anyhow::Result<darwinia_common_primitives::BlockNumber> {
match self.client.best_finalized_header_number().await {
Ok(v) => Ok(v),
Err(e) => {
if e.is_connection_error() {
self.client.reconnect().await?;
}
Err(e)?
Err(e.into())
}
}
}
Expand Down Expand Up @@ -149,7 +149,7 @@ impl DarwiniaApi {
if e.is_connection_error() {
self.client.reconnect().await?;
}
Err(e)?
Err(e.into())
}
}
}
Expand Down Expand Up @@ -186,7 +186,7 @@ impl DarwiniaApi {
if e.is_connection_error() {
self.client.reconnect().await?;
}
Err(e)?
Err(e.into())
}
}
}
Expand Down
34 changes: 19 additions & 15 deletions components/client-darwinia-s2s/src/darwinia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ use sp_core::{storage::StorageKey, Pair};
use sp_runtime::{generic::SignedPayload, traits::IdentifyAccount};

/// Pangolin header id.
pub type HeaderId = relay_utils::HeaderId<common_primitives::Hash, common_primitives::BlockNumber>;
pub type HeaderId = relay_utils::HeaderId<
darwinia_common_primitives::Hash,
darwinia_common_primitives::BlockNumber,
>;

/// Rialto header type used in headers sync.
pub type SyncHeader = relay_substrate_client::SyncHeader<common_primitives::Header>;
pub type SyncHeader = relay_substrate_client::SyncHeader<darwinia_common_primitives::Header>;

/// Millau chain definition.
#[derive(Debug, Clone, Copy)]
Expand All @@ -24,23 +27,24 @@ impl BridgeChain for DarwiniaChain {
}

impl ChainBase for DarwiniaChain {
type BlockNumber = common_primitives::BlockNumber;
type Hash = common_primitives::Hash;
type Hasher = common_primitives::Hashing;
type Header = common_primitives::Header;

type AccountId = common_primitives::AccountId;
type Balance = common_primitives::Balance;
type Index = common_primitives::Nonce;
type Signature = common_primitives::Signature;
type BlockNumber = darwinia_common_primitives::BlockNumber;
type Hash = darwinia_common_primitives::Hash;
type Hasher = darwinia_common_primitives::Hashing;
type Header = darwinia_common_primitives::Header;

type AccountId = darwinia_common_primitives::AccountId;
type Balance = darwinia_common_primitives::Balance;
type Index = darwinia_common_primitives::Nonce;
type Signature = darwinia_common_primitives::Signature;
}

impl Chain for DarwiniaChain {
const NAME: &'static str = "Darwinia";
const AVERAGE_BLOCK_INTERVAL: Duration =
Duration::from_millis(common_primitives::MILLISECS_PER_BLOCK);
const STORAGE_PROOF_OVERHEAD: u32 = bridge_primitives::EXTRA_STORAGE_PROOF_SIZE;
const MAXIMAL_ENCODED_ACCOUNT_ID_SIZE: u32 = bridge_primitives::MAXIMAL_ENCODED_ACCOUNT_ID_SIZE;
Duration::from_millis(darwinia_common_primitives::MILLISECS_PER_BLOCK);
const STORAGE_PROOF_OVERHEAD: u32 = darwinia_bridge_primitives::EXTRA_STORAGE_PROOF_SIZE;
const MAXIMAL_ENCODED_ACCOUNT_ID_SIZE: u32 =
darwinia_bridge_primitives::MAXIMAL_ENCODED_ACCOUNT_ID_SIZE;

type SignedBlock = darwinia_runtime::SignedBlock;
type Call = darwinia_runtime::Call;
Expand Down Expand Up @@ -110,7 +114,7 @@ impl TransactionSignScheme for DarwiniaChain {
tx.signature
.as_ref()
.map(|(address, _, _)| {
let account_id: common_primitives::AccountId =
let account_id: darwinia_common_primitives::AccountId =
(*signer.public().as_array_ref()).into();
*address == darwinia_runtime::Address::from(account_id)
})
Expand Down
6 changes: 3 additions & 3 deletions components/client-darwinia-s2s/src/feemarket.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::ops::Range;

use common_primitives::AccountId;
use darwinia_common_primitives::AccountId;
use messages_relay::message_lane::MessageLane;
use messages_relay::message_lane_loop::{
SourceClient as MessageLaneSourceClient, TargetClient as MessageLaneTargetClient,
Expand Down Expand Up @@ -39,7 +39,7 @@ impl RelayStrategy for DarwiniaRelayStrategy {
let nonce = &reference.nonce;
let order = self
.api
.order(bridge_primitives::DARWINIA_CRAB_LANE, *nonce)
.order(darwinia_bridge_primitives::DARWINIA_CRAB_LANE, *nonce)
.await
.map_err(|e| {
log::error!("Failed to query order: {:?}", e);
Expand Down Expand Up @@ -94,7 +94,7 @@ impl RelayStrategy for DarwiniaRelayStrategy {
let ranges = relayers
.iter()
.map(|item| item.valid_range.clone())
.collect::<Vec<Range<common_primitives::BlockNumber>>>();
.collect::<Vec<Range<darwinia_common_primitives::BlockNumber>>>();

let mut maximum_timeout = 0;
for range in ranges {
Expand Down
4 changes: 2 additions & 2 deletions components/client-pangolin-s2s/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ bp-runtime = { git = "https://github.com/darwinia-network/parity-bri

## Bridge dependencies
pangolin-runtime = { git = "https://github.com/darwinia-network/darwinia-common.git", branch = "bump-deps" }
common-primitives = { git = "https://github.com/darwinia-network/darwinia-common.git", branch = "bump-deps" }
bridge-primitives = { git = "https://github.com/darwinia-network/darwinia-common.git", branch = "bump-deps" }
drml-common-primitives = { git = "https://github.com/darwinia-network/darwinia-common.git", branch = "bump-deps" }
drml-bridge-primitives = { git = "https://github.com/darwinia-network/darwinia-common.git", branch = "bump-deps" }
darwinia-bridge-ethereum = { git = "https://github.com/darwinia-network/darwinia-common.git", branch = "bump-deps" }
dp-fee = { git = "https://github.com/darwinia-network/darwinia-common.git", branch = "bump-deps" }

Expand Down
Loading

0 comments on commit b8857eb

Please sign in to comment.