forked from sigp/lighthouse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Electra: Add New Containers (sigp#5607)
* Electra: Add New Containers
- Loading branch information
1 parent
ad7f0e0
commit 82b131d
Showing
8 changed files
with
253 additions
and
0 deletions.
There are no files selected for viewing
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,35 @@ | ||
use crate::test_utils::TestRandom; | ||
use crate::Epoch; | ||
use serde::{Deserialize, Serialize}; | ||
use ssz_derive::{Decode, Encode}; | ||
use test_random_derive::TestRandom; | ||
use tree_hash_derive::TreeHash; | ||
|
||
#[derive( | ||
arbitrary::Arbitrary, | ||
Debug, | ||
PartialEq, | ||
Eq, | ||
Hash, | ||
Clone, | ||
Serialize, | ||
Deserialize, | ||
Encode, | ||
Decode, | ||
TreeHash, | ||
TestRandom, | ||
)] | ||
pub struct Consolidation { | ||
#[serde(with = "serde_utils::quoted_u64")] | ||
pub source_index: u64, | ||
#[serde(with = "serde_utils::quoted_u64")] | ||
pub target_index: u64, | ||
pub epoch: Epoch, | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
ssz_and_tree_hash_tests!(Consolidation); | ||
} |
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,37 @@ | ||
use crate::test_utils::TestRandom; | ||
use crate::{Hash256, PublicKeyBytes, Signature}; | ||
use serde::{Deserialize, Serialize}; | ||
use ssz_derive::{Decode, Encode}; | ||
use test_random_derive::TestRandom; | ||
use tree_hash_derive::TreeHash; | ||
|
||
#[derive( | ||
arbitrary::Arbitrary, | ||
Debug, | ||
PartialEq, | ||
Eq, | ||
Hash, | ||
Clone, | ||
Serialize, | ||
Deserialize, | ||
Encode, | ||
Decode, | ||
TreeHash, | ||
TestRandom, | ||
)] | ||
pub struct DepositReceipt { | ||
pub pubkey: PublicKeyBytes, | ||
pub withdrawal_credentials: Hash256, | ||
#[serde(with = "serde_utils::quoted_u64")] | ||
pub amount: u64, | ||
pub signature: Signature, | ||
#[serde(with = "serde_utils::quoted_u64")] | ||
pub index: u64, | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
ssz_and_tree_hash_tests!(DepositReceipt); | ||
} |
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,34 @@ | ||
use crate::test_utils::TestRandom; | ||
use crate::{Address, PublicKeyBytes}; | ||
use serde::{Deserialize, Serialize}; | ||
use ssz_derive::{Decode, Encode}; | ||
use test_random_derive::TestRandom; | ||
use tree_hash_derive::TreeHash; | ||
|
||
#[derive( | ||
arbitrary::Arbitrary, | ||
Debug, | ||
PartialEq, | ||
Eq, | ||
Hash, | ||
Clone, | ||
Serialize, | ||
Deserialize, | ||
Encode, | ||
Decode, | ||
TreeHash, | ||
TestRandom, | ||
)] | ||
pub struct ExecutionLayerWithdrawalRequest { | ||
pub source_address: Address, | ||
pub validator_pubkey: PublicKeyBytes, | ||
#[serde(with = "serde_utils::quoted_u64")] | ||
pub amount: u64, | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
ssz_and_tree_hash_tests!(ExecutionLayerWithdrawalRequest); | ||
} |
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,33 @@ | ||
use crate::test_utils::TestRandom; | ||
use serde::{Deserialize, Serialize}; | ||
use ssz_derive::{Decode, Encode}; | ||
use test_random_derive::TestRandom; | ||
use tree_hash_derive::TreeHash; | ||
|
||
#[derive( | ||
arbitrary::Arbitrary, | ||
Debug, | ||
PartialEq, | ||
Eq, | ||
Hash, | ||
Clone, | ||
Serialize, | ||
Deserialize, | ||
Encode, | ||
Decode, | ||
TreeHash, | ||
TestRandom, | ||
)] | ||
pub struct PendingBalanceDeposit { | ||
#[serde(with = "serde_utils::quoted_u64")] | ||
pub index: u64, | ||
#[serde(with = "serde_utils::quoted_u64")] | ||
pub amount: u64, | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
ssz_and_tree_hash_tests!(PendingBalanceDeposit); | ||
} |
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,33 @@ | ||
use crate::test_utils::TestRandom; | ||
use serde::{Deserialize, Serialize}; | ||
use ssz_derive::{Decode, Encode}; | ||
use test_random_derive::TestRandom; | ||
use tree_hash_derive::TreeHash; | ||
|
||
#[derive( | ||
arbitrary::Arbitrary, | ||
Debug, | ||
PartialEq, | ||
Eq, | ||
Hash, | ||
Clone, | ||
Serialize, | ||
Deserialize, | ||
Encode, | ||
Decode, | ||
TreeHash, | ||
TestRandom, | ||
)] | ||
pub struct PendingConsolidation { | ||
#[serde(with = "serde_utils::quoted_u64")] | ||
pub source_index: u64, | ||
#[serde(with = "serde_utils::quoted_u64")] | ||
pub target_index: u64, | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
ssz_and_tree_hash_tests!(PendingConsolidation); | ||
} |
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,35 @@ | ||
use crate::test_utils::TestRandom; | ||
use crate::Epoch; | ||
use serde::{Deserialize, Serialize}; | ||
use ssz_derive::{Decode, Encode}; | ||
use test_random_derive::TestRandom; | ||
use tree_hash_derive::TreeHash; | ||
|
||
#[derive( | ||
arbitrary::Arbitrary, | ||
Debug, | ||
PartialEq, | ||
Eq, | ||
Hash, | ||
Clone, | ||
Serialize, | ||
Deserialize, | ||
Encode, | ||
Decode, | ||
TreeHash, | ||
TestRandom, | ||
)] | ||
pub struct PendingPartialWithdrawal { | ||
#[serde(with = "serde_utils::quoted_u64")] | ||
pub index: u64, | ||
#[serde(with = "serde_utils::quoted_u64")] | ||
pub amount: u64, | ||
pub withdrawable_epoch: Epoch, | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
ssz_and_tree_hash_tests!(PendingPartialWithdrawal); | ||
} |
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::{Consolidation, Signature}; | ||
use serde::{Deserialize, Serialize}; | ||
use ssz_derive::{Decode, Encode}; | ||
use test_random_derive::TestRandom; | ||
use tree_hash_derive::TreeHash; | ||
|
||
#[derive( | ||
arbitrary::Arbitrary, | ||
Debug, | ||
PartialEq, | ||
Eq, | ||
Hash, | ||
Clone, | ||
Serialize, | ||
Deserialize, | ||
Encode, | ||
Decode, | ||
TreeHash, | ||
TestRandom, | ||
)] | ||
pub struct SignedConsolidation { | ||
pub message: Consolidation, | ||
pub signature: Signature, | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
ssz_and_tree_hash_tests!(SignedConsolidation); | ||
} |