Skip to content

Commit

Permalink
Seperate outbound router crates
Browse files Browse the repository at this point in the history
  • Loading branch information
yrong committed Nov 28, 2024
1 parent a7ced85 commit 5696fdf
Show file tree
Hide file tree
Showing 25 changed files with 3,570 additions and 3,524 deletions.
25 changes: 24 additions & 1 deletion 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ members = [
"bridges/snowbridge/primitives/core",
"bridges/snowbridge/primitives/ethereum",
"bridges/snowbridge/primitives/merkle-tree",
"bridges/snowbridge/primitives/outbound-router",
"bridges/snowbridge/primitives/router",
"bridges/snowbridge/runtime/runtime-common",
"bridges/snowbridge/runtime/test-common",
Expand Down Expand Up @@ -1227,6 +1228,7 @@ snowbridge-ethereum = { path = "bridges/snowbridge/primitives/ethereum", default
snowbridge-merkle-tree = { path = "bridges/snowbridge/primitives/merkle-tree", default-features = false }
snowbridge-outbound-queue-runtime-api = { path = "bridges/snowbridge/pallets/outbound-queue/runtime-api", default-features = false }
snowbridge-outbound-queue-runtime-api-v2 = { path = "bridges/snowbridge/pallets/outbound-queue-v2/runtime-api", default-features = false }
snowbridge-outbound-router-primitives = { path = "bridges/snowbridge/primitives/outbound-router", default-features = false }
snowbridge-pallet-ethereum-client = { path = "bridges/snowbridge/pallets/ethereum-client", default-features = false }
snowbridge-pallet-ethereum-client-fixtures = { path = "bridges/snowbridge/pallets/ethereum-client/fixtures", default-features = false }
snowbridge-pallet-inbound-queue = { path = "bridges/snowbridge/pallets/inbound-queue", default-features = false }
Expand Down
6 changes: 3 additions & 3 deletions bridges/snowbridge/pallets/outbound-queue-v2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ snowbridge-core = { features = ["serde"], workspace = true }
ethabi = { workspace = true }
hex-literal = { workspace = true, default-features = true }
snowbridge-merkle-tree = { workspace = true }
snowbridge-router-primitives = { workspace = true }
snowbridge-outbound-router-primitives = { workspace = true }
xcm = { workspace = true }
xcm-executor = { workspace = true }
xcm-builder = { workspace = true }
Expand All @@ -61,7 +61,7 @@ std = [
"serde/std",
"snowbridge-core/std",
"snowbridge-merkle-tree/std",
"snowbridge-router-primitives/std",
"snowbridge-outbound-router-primitives/std",
"sp-arithmetic/std",
"sp-core/std",
"sp-io/std",
Expand All @@ -79,7 +79,7 @@ runtime-benchmarks = [
"frame-system/runtime-benchmarks",
"pallet-message-queue/runtime-benchmarks",
"snowbridge-core/runtime-benchmarks",
"snowbridge-router-primitives/runtime-benchmarks",
"snowbridge-outbound-router-primitives/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
Expand Down
2 changes: 1 addition & 1 deletion bridges/snowbridge/pallets/outbound-queue-v2/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use snowbridge_core::outbound::{
DryRunError,
};
use snowbridge_merkle_tree::{merkle_proof, MerkleProof};
use snowbridge_router_primitives::outbound::v2::convert::XcmConverter;
use snowbridge_outbound_router_primitives::v2::convert::XcmConverter;
use sp_core::Get;
use sp_std::{default::Default, vec::Vec};
use xcm::prelude::Xcm;
Expand Down
2 changes: 1 addition & 1 deletion bridges/snowbridge/pallets/outbound-queue-v2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//! Messages come either from sibling parachains via XCM, or BridgeHub itself
//! via the `snowbridge-pallet-system`:
//!
//! 1. `snowbridge_router_primitives::outbound::v2::EthereumBlobExporter::deliver`
//! 1. `snowbridge_outbound_router_primitives::v2::EthereumBlobExporter::deliver`
//! 2. `snowbridge_pallet_system::Pallet::send_v2`
//!
//! The message submission pipeline works like this:
Expand Down
2 changes: 1 addition & 1 deletion bridges/snowbridge/pallets/outbound-queue/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//! Messages come either from sibling parachains via XCM, or BridgeHub itself
//! via the `snowbridge-pallet-system`:
//!
//! 1. `snowbridge_router_primitives::outbound::EthereumBlobExporter::deliver`
//! 1. `snowbridge_outbound_router_primitives::EthereumBlobExporter::deliver`
//! 2. `snowbridge_pallet_system::Pallet::send`
//!
//! The message submission pipeline works like this:
Expand Down
57 changes: 57 additions & 0 deletions bridges/snowbridge/primitives/outbound-router/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[package]
name = "snowbridge-outbound-router-primitives"
description = "Snowbridge Router Primitives"
version = "0.9.0"
authors = ["Snowfork <[email protected]>"]
edition.workspace = true
repository.workspace = true
license = "Apache-2.0"
categories = ["cryptography::cryptocurrencies"]

[lints]
workspace = true

[dependencies]
codec = { workspace = true }
scale-info = { features = ["derive"], workspace = true }
log = { workspace = true }

frame-support = { workspace = true }
sp-core = { workspace = true }
sp-io = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }

xcm = { workspace = true }
xcm-executor = { workspace = true }
xcm-builder = { workspace = true }

snowbridge-core = { workspace = true }

hex-literal = { workspace = true, default-features = true }

[dev-dependencies]

[features]
default = ["std"]
std = [
"codec/std",
"frame-support/std",
"log/std",
"scale-info/std",
"snowbridge-core/std",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
"sp-std/std",
"xcm-builder/std",
"xcm-executor/std",
"xcm/std",
]
runtime-benchmarks = [
"frame-support/runtime-benchmarks",
"snowbridge-core/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
]
4 changes: 4 additions & 0 deletions bridges/snowbridge/primitives/outbound-router/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Outbound Router Primitives

Outbound router logic. Does XCM conversion to a lowered, simpler format the Ethereum contracts can
understand.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]>
// SPDX-FileCopyrightText: 2021-2022 Parity Technologies (UK) Ltd.
#![cfg_attr(not(feature = "std"), no_std)]

pub mod v1;
pub mod v2;
Loading

0 comments on commit 5696fdf

Please sign in to comment.