mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-17 21:08:32 +00:00
Fix ef tests
This commit is contained in:
@@ -2152,7 +2152,7 @@ impl<E: EthSpec> BeaconState<E> {
|
||||
pubkey: validator.pubkey,
|
||||
withdrawal_credentials: validator.withdrawal_credentials,
|
||||
amount: excess_balance,
|
||||
signature: Signature::infinity()?,
|
||||
signature: Signature::infinity()?.into(),
|
||||
slot: spec.genesis_slot,
|
||||
})?;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use crate::test_utils::TestRandom;
|
||||
use crate::{Hash256, PublicKeyBytes, Signature};
|
||||
use crate::{Hash256, PublicKeyBytes};
|
||||
use bls::SignatureBytes;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use ssz::Encode;
|
||||
use ssz_derive::{Decode, Encode};
|
||||
@@ -10,7 +11,6 @@ use tree_hash_derive::TreeHash;
|
||||
arbitrary::Arbitrary,
|
||||
Debug,
|
||||
PartialEq,
|
||||
Eq,
|
||||
Hash,
|
||||
Clone,
|
||||
Serialize,
|
||||
@@ -25,7 +25,7 @@ pub struct DepositRequest {
|
||||
pub withdrawal_credentials: Hash256,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
pub amount: u64,
|
||||
pub signature: Signature,
|
||||
pub signature: SignatureBytes,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
pub index: u64,
|
||||
}
|
||||
@@ -36,7 +36,7 @@ impl DepositRequest {
|
||||
pubkey: PublicKeyBytes::empty(),
|
||||
withdrawal_credentials: Hash256::ZERO,
|
||||
amount: 0,
|
||||
signature: Signature::empty(),
|
||||
signature: SignatureBytes::empty(),
|
||||
index: 0,
|
||||
}
|
||||
.as_ssz_bytes()
|
||||
|
||||
@@ -9,7 +9,6 @@ use tree_hash_derive::TreeHash;
|
||||
arbitrary::Arbitrary,
|
||||
Debug,
|
||||
PartialEq,
|
||||
Eq,
|
||||
Hash,
|
||||
Clone,
|
||||
Serialize,
|
||||
@@ -24,7 +23,7 @@ pub struct PendingDeposit {
|
||||
pub withdrawal_credentials: Hash256,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
pub amount: u64,
|
||||
pub signature: Signature,
|
||||
pub signature: SignatureBytes,
|
||||
pub slot: Slot,
|
||||
}
|
||||
|
||||
|
||||
@@ -152,6 +152,17 @@ impl Validator {
|
||||
.flatten()
|
||||
}
|
||||
|
||||
pub fn get_eth1_withdrawal_credential(&self, spec: &ChainSpec) -> Option<Address> {
|
||||
self.has_eth1_withdrawal_credential(spec)
|
||||
.then(|| {
|
||||
self.withdrawal_credentials
|
||||
.as_slice()
|
||||
.get(12..)
|
||||
.map(Address::from_slice)
|
||||
})
|
||||
.flatten()
|
||||
}
|
||||
|
||||
/// Changes withdrawal credentials to the provided eth1 execution address.
|
||||
///
|
||||
/// WARNING: this function does NO VALIDATION - it just does it!
|
||||
|
||||
Reference in New Issue
Block a user