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
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2021-11-11
toolchain: nightly-2021-11-30
override: true
target: wasm32-unknown-unknown
components: rustfmt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2021-11-11
toolchain: nightly-2021-11-30
override: true
target: wasm32-unknown-unknown
- name: Build release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2021-11-11
toolchain: nightly-2021-11-30
override: true
target: wasm32-unknown-unknown
- name: Build release
Expand Down
48 changes: 44 additions & 4 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:stretch-slim
FROM debian:buster-slim

# show backtraces
ENV RUST_BACKTRACE 1
Expand Down
3 changes: 2 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ bench pallet exection="wasm":


run +args='--dev --tmp':
./target/release/{{name}} \
cargo run --release \
-- \
{{args}} \
--port 30333 \
--ws-port 9944 \
Expand Down
12 changes: 9 additions & 3 deletions node/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ codec = { package = "parity-scale-codec", version = "2.2.0", default-features =
] }
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
static_assertions = "1.1.0"
hex-literal = { version = "0.3.1", optional = true }
hex-literal = { version = "0.3.1" }
log = { version = "0.4.14", default-features = false }

# primitives
Expand Down Expand Up @@ -90,6 +90,8 @@ pallet-nft = { path = "../../pallets/nft", default-features = false }
pallet-nft-order = { path = "../../pallets/nft-order", default-features = false }
pallet-nft-auction = { path = "../../pallets/nft-auction", default-features = false }
pallet-storage = { path = "../../pallets/storage", default-features = false }
pallet-bridge = { path = "../../pallets/bridge", default-features = false }
pallet-bridge-transfer = { path = "../../pallets/bridge-transfer", default-features = false }

[build-dependencies]
substrate-wasm-builder = { path = "../../substrate/utils/wasm-builder" }
Expand Down Expand Up @@ -160,10 +162,11 @@ std = [
"pallet-nft-order/std",
"pallet-nft-auction/std",
"pallet-storage/std",
"pallet-bridge/std",
"pallet-bridge-transfer/std",
]

runtime-benchmarks = [
"hex-literal",
"frame-benchmarking",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
Expand Down Expand Up @@ -194,11 +197,12 @@ runtime-benchmarks = [
"pallet-offences-benchmarking",
"pallet-session-benchmarking",
"frame-system-benchmarking",
"hex-literal",
"pallet-nft/runtime-benchmarks",
"pallet-nft-order/runtime-benchmarks",
"pallet-nft-auction/runtime-benchmarks",
"pallet-storage/runtime-benchmarks",
# "pallet-bridge/runtime-benchmarks",
# "pallet-bridge-transfer/runtime-benchmarks",
]
try-runtime = [
"frame-executive/try-runtime",
Expand Down Expand Up @@ -237,4 +241,6 @@ try-runtime = [
"pallet-nft-order/try-runtime",
"pallet-nft-auction/try-runtime",
"pallet-storage/try-runtime",
# "pallet-bridge/try-runtime",
# "pallet-bridge-transfer/try-runtime",
]
32 changes: 32 additions & 0 deletions node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1115,6 +1115,32 @@ impl pallet_storage::Config for Runtime {
type WeightInfo = pallet_storage::weights::SubstrateWeight<Runtime>;
}

parameter_types! {
pub const BridgeChainId: u8 = 1;
pub const ProposalLifetime: BlockNumber = 50;
}

impl pallet_bridge::Config for Runtime {
type Event = Event;
type BridgeCommitteeOrigin = EnsureRootOrHalfCouncil;
type Proposal = Call;
type BridgeChainId = BridgeChainId;
type ProposalLifetime = ProposalLifetime;
}

parameter_types! {
// bridge::derive_resource_id(1, &bridge::hashing::blake2_128(b"DEER"));
pub const NativeTokenResourceId: [u8; 32] = hex_literal::hex!("0000000000000000000000000000009b35c2b05a300b65107a1b47a320f65f01");
}

impl pallet_bridge_transfer::Config for Runtime {
type Event = Event;
type BridgeOrigin = pallet_bridge::EnsureBridge<Runtime>;
type Currency = Balances;
type NativeTokenResourceId = NativeTokenResourceId;
type OnFeePay = Treasury;
}

impl pallet_transaction_storage::Config for Runtime {
type Event = Event;
type Currency = Balances;
Expand Down Expand Up @@ -1166,6 +1192,8 @@ construct_runtime!(
FileStorage: pallet_storage::{Pallet, Call, Storage, Event<T>, Config<T>} = 33,
TransactionStorage: pallet_transaction_storage::{Pallet, Call, Storage, Inherent, Config<T>, Event<T>} = 34,
BagsList: pallet_bags_list::{Pallet, Call, Storage, Event<T>} = 36,
Bridge: pallet_bridge::{Pallet, Call, Storage, Event<T>} = 37,
BridgeTransfer: pallet_bridge_transfer::{Pallet, Call, Storage, Event<T>} = 38,
}
);

Expand Down Expand Up @@ -1446,6 +1474,8 @@ impl_runtime_apis! {
list_benchmark!(list, extra, pallet_session, SessionBench::<Runtime>);
list_benchmark!(list, extra, pallet_staking, Staking);
list_benchmark!(list, extra, pallet_storage, FileStorage);
// list_benchmark!(list, extra, pallet_bridge, Bridge);
// list_benchmark!(list, extra, pallet_bridge_transfer, BridgeTransfer);
list_benchmark!(list, extra, frame_system, SystemBench::<Runtime>);
list_benchmark!(list, extra, pallet_timestamp, Timestamp);
list_benchmark!(list, extra, pallet_tips, Tips);
Expand Down Expand Up @@ -1520,6 +1550,8 @@ impl_runtime_apis! {
add_benchmark!(params, batches, pallet_session, SessionBench::<Runtime>);
add_benchmark!(params, batches, pallet_staking, Staking);
add_benchmark!(params, batches, pallet_storage, FileStorage);
add_benchmark!(params, batches, pallet_bridge, Bridge);
add_benchmark!(params, batches, pallet_bridge_transfer, BridgeTransfer);
add_benchmark!(params, batches, frame_system, SystemBench::<Runtime>);
add_benchmark!(params, batches, pallet_timestamp, Timestamp);
add_benchmark!(params, batches, pallet_tips, Tips);
Expand Down
47 changes: 47 additions & 0 deletions pallets/bridge-transfer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[package]
name = "pallet-bridge-transfer"
version = "0.2.4"
edition = "2018"
license = "Apache 2.0"

[dependencies]
# third-party dependencies
codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false, features = ["derive", "max-encoded-len"] }
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
sp-std = { default-features = false, path = "../../substrate/primitives/std" }
sp-runtime = { default-features = false, path = "../../substrate/primitives/runtime" }
sp-io = { default-features = false, path = "../../substrate/primitives/io" }
sp-core = { default-features = false, path = "../../substrate/primitives/core" }
sp-arithmetic = { default-features = false, path = "../../substrate/primitives/arithmetic" }
frame-support = { default-features = false, path = "../../substrate/frame/support" }
frame-system = { default-features = false, path = "../../substrate/frame/system" }
frame-benchmarking = { default-features = false, path = "../../substrate/frame/benchmarking", optional = true }

pallet-bridge = { path = "../bridge", default-features = false }
hex = { version = "0.4", default-features = false }

[dev-dependencies]
hex-literal = "0.3"
pallet-balances = { default-features = false, path = "../../substrate/frame/balances" }
pallet-timestamp = { path = "../../substrate/frame/timestamp" }

[features]
default = ["std"]
runtime-benchmarks = [
'frame-benchmarking',
'frame-support/runtime-benchmarks',
'frame-system/runtime-benchmarks',
]
std = [
"codec/std",
"scale-info/std",
"sp-std/std",
"sp-runtime/std",
"sp-io/std",
"sp-core/std",
"sp-arithmetic/std",
"frame-support/std",
"frame-system/std",
"frame-benchmarking/std",
"pallet-bridge/std",
]
Loading