From 9b3337c99d279c26ae55f5cd2fa9ce32eb3feba1 Mon Sep 17 00:00:00 2001 From: Justin Traglia Date: Mon, 6 May 2024 07:53:43 -0500 Subject: [PATCH] Fix attestation aggregation bits error message --- spec/phase0/attestation.go | 2 +- spec/phase0/attestation_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/phase0/attestation.go b/spec/phase0/attestation.go index e87cdf38..e9c5715c 100644 --- a/spec/phase0/attestation.go +++ b/spec/phase0/attestation.go @@ -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 { diff --git a/spec/phase0/attestation_test.go b/spec/phase0/attestation_test.go index cdfd6926..162c2bde 100644 --- a/spec/phase0/attestation_test.go +++ b/spec/phase0/attestation_test.go @@ -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",