Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bkontur committed Oct 6, 2022
1 parent 67ebeaf commit 27dc187
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 32 deletions.
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions primitives/chain-rococo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ bp-runtime = { path = "../runtime", default-features = false }

# Substrate Based Dependencies
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }

[features]
default = ["std"]
std = [
"bp-polkadot-core/std",
"bp-runtime/std",
"sp-api/std",
"frame-support/std",
]
10 changes: 9 additions & 1 deletion primitives/chain-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,24 @@

pub use bp_polkadot_core::*;
use bp_runtime::decl_bridge_finality_runtime_apis;
use frame_support::parameter_types;

/// Rococo Chain
pub type Rococo = PolkadotLike;

parameter_types! {
pub const SS58Prefix: u8 = 42;
}

/// The target length of a session (how often authorities change) on Rococo measured in of number
/// of blocks.
///
/// Note that since this is a target sessions may change before/after this time depending on network
/// conditions.
pub const SESSION_LENGTH: BlockNumber = time_units::HOURS;
pub const SESSION_LENGTH: BlockNumber = HOURS;

/// Name of the parachains pallet in the Rococo runtime.
pub const PARAS_PALLET_NAME: &str = "Paras";

/// Name of the With-Rococo GRANDPA pallet instance that is deployed at bridged chains.
pub const WITH_ROCOCO_GRANDPA_PALLET_NAME: &str = "BridgeRococoGrandpa";
Expand Down
2 changes: 2 additions & 0 deletions primitives/chain-wococo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
# Bridge Dependencies
bp-polkadot-core = { path = "../polkadot-core", default-features = false }
bp-runtime = { path = "../runtime", default-features = false }
bp-rococo = { path = "../chain-rococo", default-features = false }

# Substrate Based Dependencies
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
Expand All @@ -20,5 +21,6 @@ default = ["std"]
std = [
"bp-polkadot-core/std",
"bp-runtime/std",
"bp-rococo/std",
"sp-api/std",
]
3 changes: 2 additions & 1 deletion primitives/chain-wococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#![allow(clippy::too_many_arguments)]

pub use bp_polkadot_core::*;
pub use bp_rococo::{SS58Prefix, PARAS_PALLET_NAME};
use bp_runtime::decl_bridge_finality_runtime_apis;

/// Wococo Chain
Expand All @@ -29,7 +30,7 @@ pub type Wococo = PolkadotLike;
///
/// Note that since this is a target sessions may change before/after this time depending on network
/// conditions.
pub const SESSION_LENGTH: BlockNumber = time_units::MINUTES;
pub const SESSION_LENGTH: BlockNumber = MINUTES;

/// Name of the With-Wococo GRANDPA pallet instance that is deployed at bridged chains.
pub const WITH_WOCOCO_GRANDPA_PALLET_NAME: &str = "BridgeWococoGrandpa";
Expand Down
1 change: 1 addition & 0 deletions relays/bin-substrate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ strum = { version = "0.21.0", features = ["derive"] }

bp-bridge-hub-rococo = { path = "../../primitives/chain-bridge-hub-rococo" }
bp-bridge-hub-wococo = { path = "../../primitives/chain-bridge-hub-wococo" }
bp-header-chain = { path = "../../primitives/header-chain" }
bp-messages = { path = "../../primitives/messages" }
bp-millau = { path = "../../primitives/chain-millau" }
bp-polkadot-core = { path = "../../primitives/polkadot-core" }
Expand Down
5 changes: 2 additions & 3 deletions relays/bin-substrate/src/chains/rococo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ use relay_rococo_client::Rococo;
use sp_version::RuntimeVersion;

impl CliChain for Rococo {
// TODO: maybe not needed?
const RUNTIME_VERSION: RuntimeVersion = bp_rococo::VERSION;
const RUNTIME_VERSION: Option<RuntimeVersion> = None;

type KeyPair = sp_core::sr25519::Pair;
type MessagePayload = Vec<u8>;
Expand All @@ -34,7 +33,7 @@ impl CliChain for Rococo {
}

impl CliChain for BridgeHubRococo {
const RUNTIME_VERSION: RuntimeVersion = relay_bridge_hub_rococo_client::runtime::VERSION;
const RUNTIME_VERSION: Option<RuntimeVersion> = None;

type KeyPair = sp_core::sr25519::Pair;
type MessagePayload = Vec<u8>;
Expand Down
4 changes: 2 additions & 2 deletions relays/bin-substrate/src/chains/wococo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use relay_wococo_client::Wococo;
use sp_version::RuntimeVersion;

impl CliChain for Wococo {
const RUNTIME_VERSION: RuntimeVersion = bp_wococo::VERSION;
const RUNTIME_VERSION: Option<RuntimeVersion> = None;

type KeyPair = sp_core::sr25519::Pair;
type MessagePayload = Vec<u8>;
Expand All @@ -33,7 +33,7 @@ impl CliChain for Wococo {
}

impl CliChain for BridgeHubWococo {
const RUNTIME_VERSION: RuntimeVersion = relay_bridge_hub_wococo_client::runtime::VERSION;
const RUNTIME_VERSION: Option<RuntimeVersion> = None;

type KeyPair = sp_core::sr25519::Pair;
type MessagePayload = Vec<u8>;
Expand Down
1 change: 0 additions & 1 deletion relays/client-bridge-hub-rococo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ bp-runtime = { path = "../../primitives/runtime" }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-version = { git = "https://github.com/paritytech/substrate", branch = "master" }

[dev-dependencies]
sp-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master" }
1 change: 0 additions & 1 deletion relays/client-bridge-hub-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ impl Chain for BridgeHubRococo {

type SignedBlock = bp_bridge_hub_rococo::SignedBlock;
type Call = runtime::Call;
type WeightToFee = bp_bridge_hub_rococo::WeightToFee;
}

impl TransactionSignScheme for BridgeHubRococo {
Expand Down
17 changes: 0 additions & 17 deletions relays/client-bridge-hub-rococo/src/runtime_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,11 @@
use bp_polkadot_core::PolkadotLike;
use codec::{Decode, Encode};
use scale_info::TypeInfo;
use sp_runtime::create_runtime_str;
use sp_version::RuntimeVersion;

pub use bp_bridge_hub_rococo::SS58Prefix;
use bp_polkadot_core::parachains::{ParaHash, ParaHeadsProof, ParaId};
use bp_runtime::Chain;

// TODO: we meed to keep this up-to-date with
// [github.com/paritytech/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/lib.rs::VERSION]
/// This runtime version.
pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("bridge-hub-rococo"),
impl_name: create_runtime_str!("bridge-hub-rococo"),
authoring_version: 1,
spec_version: 1,
impl_version: 0,
// TODO:check-parameter
apis: /*RUNTIME_API_VERSIONS*/ sp_version::create_apis_vec![[]],
transaction_version: 1,
state_version: 1,
};

// TODO:check-parameter - check SignedExtension
/// Unchecked BridgeHubRococo extrinsic.
pub type UncheckedExtrinsic = bp_bridge_hub_rococo::UncheckedExtrinsic<Call>;
Expand Down
1 change: 0 additions & 1 deletion relays/client-bridge-hub-wococo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ relay-bridge-hub-rococo-client = { path = "../client-bridge-hub-rococo" }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-version = { git = "https://github.com/paritytech/substrate", branch = "master" }
1 change: 0 additions & 1 deletion relays/client-bridge-hub-wococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ impl Chain for BridgeHubWococo {

type SignedBlock = bp_bridge_hub_wococo::SignedBlock;
type Call = runtime::Call;
type WeightToFee = bp_bridge_hub_wococo::WeightToFee;
}

impl TransactionSignScheme for BridgeHubWococo {
Expand Down
3 changes: 1 addition & 2 deletions relays/client-bridge-hub-wococo/src/runtime_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.

// TODO: join with primitives do we need this here or move to the primitives?
// TODO:check-parameter - join with primitives do we need this here or move to the primitives?

//! Types that are specific to the BridgeHubWococo runtime.

pub use bp_bridge_hub_wococo::SS58Prefix;

// We reuse everything from rococo runtime wrapper
pub const VERSION: sp_version::RuntimeVersion = relay_bridge_hub_rococo_client::runtime::VERSION;
pub type Call = relay_bridge_hub_rococo_client::runtime::Call;
pub type UncheckedExtrinsic = bp_bridge_hub_wococo::UncheckedExtrinsic<Call>;
pub type BridgeGrandpaRococoCall = relay_bridge_hub_rococo_client::runtime::BridgeGrandpaRococoCall;
Expand Down

0 comments on commit 27dc187

Please sign in to comment.