-
Notifications
You must be signed in to change notification settings - Fork 785
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d632c18
commit 9e80cfb
Showing
1 changed file
with
37 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,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 DepositRequest { | ||
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!(DepositRequest); | ||
} |