Tweaks to reward APIs (#3957)

## Proposed Changes

* Return the effective balance in gwei to align with the spec ([ideal attestation rewards](https://ethereum.github.io/beacon-APIs/?urls.primaryName=dev#/Rewards/getAttestationsRewards)).
* Use quoted `i64`s for attestation and sync committee rewards.
This commit is contained in:
Michael Sproul
2023-02-10 06:19:42 +00:00
parent 5276dd0cb0
commit c9354a9d25
5 changed files with 49 additions and 19 deletions

View File

@@ -28,8 +28,10 @@ pub struct TotalAttestationRewards {
#[serde(with = "eth2_serde_utils::quoted_u64")]
pub head: u64,
// attester's reward for target vote in gwei
#[serde(with = "eth2_serde_utils::quoted_i64")]
pub target: i64,
// attester's reward for source vote in gwei
#[serde(with = "eth2_serde_utils::quoted_i64")]
pub source: i64,
// TBD attester's inclusion_delay reward in gwei (phase0 only)
// pub inclusion_delay: u64,

View File

@@ -8,5 +8,6 @@ pub struct SyncCommitteeReward {
#[serde(with = "eth2_serde_utils::quoted_u64")]
pub validator_index: u64,
// sync committee reward in gwei for the validator
#[serde(with = "eth2_serde_utils::quoted_i64")]
pub reward: i64,
}