-
Notifications
You must be signed in to change notification settings - Fork 702
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Start fixing enr-fork-id * Fix time-until-next-fork logic * Remove fork crate
- Loading branch information
1 parent
30fb9b7
commit 58e5167
Showing
14 changed files
with
129 additions
and
152 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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
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,32 @@ | ||
use crate::test_utils::TestRandom; | ||
use crate::utils::{fork_from_hex_str, fork_to_hex_str}; | ||
use crate::{Hash256, SignedRoot}; | ||
|
||
use serde_derive::{Deserialize, Serialize}; | ||
use ssz_derive::{Decode, Encode}; | ||
use test_random_derive::TestRandom; | ||
use tree_hash_derive::TreeHash; | ||
|
||
/// Specifies a fork of the `BeaconChain`, to prevent replay attacks. | ||
/// | ||
/// Spec v0.11.0 | ||
#[derive( | ||
Debug, Clone, PartialEq, Default, Serialize, Deserialize, Encode, Decode, TreeHash, TestRandom, | ||
)] | ||
pub struct ForkData { | ||
#[serde( | ||
serialize_with = "fork_to_hex_str", | ||
deserialize_with = "fork_from_hex_str" | ||
)] | ||
pub current_version: [u8; 4], | ||
pub genesis_validators_root: Hash256, | ||
} | ||
|
||
impl SignedRoot for ForkData {} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
ssz_and_tree_hash_tests!(ForkData); | ||
} |
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
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
Oops, something went wrong.