Skip to content

Commit

Permalink
Merge pull request #133 from jtraglia/fix-aggregation-bits-msg
Browse files Browse the repository at this point in the history
Fix attestation aggregation bits error message
  • Loading branch information
mcdee authored May 6, 2024
2 parents 01cf86b + 9b3337c commit ca1ebec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/phase0/attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (a *Attestation) unpack(attestationJSON *attestationJSON) error {
return errors.New("aggregation bits missing")
}
if a.AggregationBits, err = hex.DecodeString(strings.TrimPrefix(attestationJSON.AggregationBits, "0x")); err != nil {
return errors.Wrap(err, "invalid value for beacon block root")
return errors.Wrap(err, "invalid value for aggregation bits")
}
a.Data = attestationJSON.Data
if a.Data == nil {
Expand Down
2 changes: 1 addition & 1 deletion spec/phase0/attestation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func TestAttestationJSON(t *testing.T) {
{
name: "AggregationBitsInvalid",
input: []byte(`{"aggregation_bits":"invalid","data":{"slot":"100","index":"1","beacon_block_root":"0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f","source":{"epoch":"1","root":"0x202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f"},"target":{"epoch":"2","root":"0x404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f"}},"signature":"0x606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebf"}`),
err: "invalid value for beacon block root: encoding/hex: invalid byte: U+0069 'i'",
err: "invalid value for aggregation bits: encoding/hex: invalid byte: U+0069 'i'",
},
{
name: "DataMissing",
Expand Down

0 comments on commit ca1ebec

Please sign in to comment.