mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-16 11:22:56 +00:00
merge upstream, fix compile errors
This commit is contained in:
@@ -27,7 +27,7 @@ impl From<jsonwebtoken::errors::Error> for Error {
|
||||
/// Provides wrapper around `[u8; JWT_SECRET_LENGTH]` that implements `Zeroize`.
|
||||
#[derive(Zeroize, Clone)]
|
||||
#[zeroize(drop)]
|
||||
pub struct JwtKey([u8; JWT_SECRET_LENGTH as usize]);
|
||||
pub struct JwtKey([u8; JWT_SECRET_LENGTH]);
|
||||
|
||||
impl JwtKey {
|
||||
/// Wrap given slice in `Self`. Returns an error if slice.len() != `JWT_SECRET_LENGTH`.
|
||||
|
||||
@@ -889,11 +889,11 @@ impl HttpJsonRpc {
|
||||
pub async fn supported_apis_v1(&self) -> Result<SupportedApis, Error> {
|
||||
Ok(SupportedApis {
|
||||
new_payload_v1: true,
|
||||
new_payload_v2: cfg!(feature = "withdrawals-processing"),
|
||||
new_payload_v2: cfg!(any(feature = "withdrawals-processing", test)),
|
||||
forkchoice_updated_v1: true,
|
||||
forkchoice_updated_v2: cfg!(feature = "withdrawals-processing"),
|
||||
forkchoice_updated_v2: cfg!(any(feature = "withdrawals-processing", test)),
|
||||
get_payload_v1: true,
|
||||
get_payload_v2: cfg!(feature = "withdrawals-processing"),
|
||||
get_payload_v2: cfg!(any(feature = "withdrawals-processing", test)),
|
||||
exchange_transition_configuration_v1: true,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -348,12 +348,14 @@ impl From<Withdrawal> for JsonWithdrawal {
|
||||
|
||||
impl From<JsonWithdrawal> for Withdrawal {
|
||||
fn from(jw: JsonWithdrawal) -> Self {
|
||||
// This comparison is done to avoid a scenario where the EE gives us too large a number and we
|
||||
// panic when attempting to cast to a `u64`.
|
||||
let amount = std::cmp::max(jw.amount / 1000000000, Uint256::from(u64::MAX));
|
||||
Self {
|
||||
index: jw.index,
|
||||
validator_index: jw.validator_index,
|
||||
address: jw.address,
|
||||
//FIXME(sean) if EE gives us too large a number this panics
|
||||
amount: (jw.amount / 1000000000).as_u64(),
|
||||
amount: amount.as_u64(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user