-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Eth Beacon receiver in dancelight (#717)
* eth receiver * wip * add eth client tests * more tests * add new tests * add comments to tests * fix a couple things * first typescript test * final tests * lint and fmt * zepter * toml-maid * solo-chains and typescript-api * added weights * use workspace dep * fix errors2 * hex use * toml * remove dup * stack size increase for fixtures * only download files when current version does not match * fix
- Loading branch information
Showing
25 changed files
with
2,028 additions
and
373 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
solo-chains/runtime/dancelight/src/bridge_to_ethereum_config.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
// Copyright (C) Moondance Labs Ltd. | ||
// This file is part of Tanssi. | ||
|
||
// Tanssi is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// Tanssi is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with Tanssi. If not, see <http://www.gnu.org/licenses/> | ||
|
||
//! The bridge to ethereum config | ||
pub const SLOTS_PER_EPOCH: u32 = snowbridge_pallet_ethereum_client::config::SLOTS_PER_EPOCH as u32; | ||
use crate::{parameter_types, weights, Runtime, RuntimeEvent}; | ||
use snowbridge_beacon_primitives::{Fork, ForkVersions}; | ||
|
||
// For tests, benchmarks and fast-runtime configurations we use the mocked fork versions | ||
#[cfg(any( | ||
feature = "std", | ||
feature = "fast-runtime", | ||
feature = "runtime-benchmarks", | ||
test | ||
))] | ||
parameter_types! { | ||
pub const ChainForkVersions: ForkVersions = ForkVersions { | ||
genesis: Fork { | ||
version: [0, 0, 0, 0], // 0x00000000 | ||
epoch: 0, | ||
}, | ||
altair: Fork { | ||
version: [1, 0, 0, 0], // 0x01000000 | ||
epoch: 0, | ||
}, | ||
bellatrix: Fork { | ||
version: [2, 0, 0, 0], // 0x02000000 | ||
epoch: 0, | ||
}, | ||
capella: Fork { | ||
version: [3, 0, 0, 0], // 0x03000000 | ||
epoch: 0, | ||
}, | ||
deneb: Fork { | ||
version: [4, 0, 0, 0], // 0x04000000 | ||
epoch: 0, | ||
} | ||
}; | ||
} | ||
|
||
// Holesky: https://github.com/eth-clients/holesky | ||
#[cfg(not(any( | ||
feature = "std", | ||
feature = "fast-runtime", | ||
feature = "runtime-benchmarks", | ||
test | ||
)))] | ||
parameter_types! { | ||
pub const ChainForkVersions: ForkVersions = ForkVersions { | ||
genesis: Fork { | ||
version: hex_literal::hex!("01017000"), // 0x01017000 | ||
epoch: 0, | ||
}, | ||
altair: Fork { | ||
version: hex_literal::hex!("01017000"), // 0x01017000 | ||
epoch: 0, | ||
}, | ||
bellatrix: Fork { | ||
version: hex_literal::hex!("01017000"), // 0x01017000 | ||
epoch: 0, | ||
}, | ||
capella: Fork { | ||
version: hex_literal::hex!("01017001"), // 0x01017001 | ||
epoch: 256, | ||
}, | ||
deneb: Fork { | ||
version: hex_literal::hex!("01017002"), // 0x01017002 | ||
epoch: 29696, | ||
}, | ||
}; | ||
} | ||
|
||
impl snowbridge_pallet_ethereum_client::Config for Runtime { | ||
type RuntimeEvent = RuntimeEvent; | ||
type ForkVersions = ChainForkVersions; | ||
type WeightInfo = weights::snowbridge_pallet_ethereum_client::SubstrateWeight<Runtime>; | ||
} |
Oops, something went wrong.