mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-19 13:58:28 +00:00
Use SignatureBytes and PublicKeyBytes for deposits (#472)
* Replace deposit signatures with SignatureBytes, a struct which lazyly parsers signatures only on demand. * check byte length when parsing SignatureBytes * add comment to struct * distinguish BadSignature and BadSignatureBytes in verify_deposit_signature * add test for valid signature * Implements TryInto<Signature> for &SignatureBytes and From<Signature> for &SignatureBytes * add and use PublicKeyBytes + fix formatting * fix compiler warning + docs for macro generated structs * adds tests to ensure correct byte lengths * small style improvement as suggested by michaelsproul
This commit is contained in:
committed by
Paul Hauner
parent
845f336a59
commit
01054ecf2f
@@ -150,6 +150,15 @@ mod tests {
|
||||
assert_eq!(original, decoded);
|
||||
}
|
||||
|
||||
#[test]
|
||||
pub fn test_byte_size() {
|
||||
let sk = SecretKey::random();
|
||||
let original = PublicKey::from_secret_key(&sk);
|
||||
|
||||
let bytes = ssz_encode(&original);
|
||||
assert_eq!(bytes.len(), BLS_PUBLIC_KEY_BYTE_SIZE);
|
||||
}
|
||||
|
||||
#[test]
|
||||
// TODO: once `CachedTreeHash` is fixed, this test should _not_ panic.
|
||||
#[should_panic]
|
||||
|
||||
Reference in New Issue
Block a user