Implement committee cache diffs

This commit is contained in:
Michael Sproul
2022-03-15 17:08:14 +11:00
parent 1a261e1d3b
commit ff649f0b26
8 changed files with 210 additions and 16 deletions

View File

@@ -1066,14 +1066,15 @@ mod test {
}
for v in state.validators() {
let creds = v.withdrawal_credentials.as_bytes();
let creds = v.withdrawal_credentials();
let creds = creds.as_bytes();
assert_eq!(
creds[0], spec.bls_withdrawal_prefix_byte,
"first byte of withdrawal creds should be bls prefix"
);
assert_eq!(
&creds[1..],
&hash(&v.pubkey.as_ssz_bytes())[1..],
&hash(&v.pubkey().as_ssz_bytes())[1..],
"rest of withdrawal creds should be pubkey hash"
)
}