aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Macalinao <me@ian.pw>2018-07-24 21:12:49 +0800
committerFelix Lange <fjl@users.noreply.github.com>2018-07-24 21:12:49 +0800
commitd96ba77113e1a87e0402fa4eb6a5776786f8e005 (patch)
tree19cbb8627be4e76d5bd245e00aef997295ca509b
parent62467e440582db5cc806584c196aaa53d1154425 (diff)
downloadgo-tangerine-d96ba77113e1a87e0402fa4eb6a5776786f8e005.tar
go-tangerine-d96ba77113e1a87e0402fa4eb6a5776786f8e005.tar.gz
go-tangerine-d96ba77113e1a87e0402fa4eb6a5776786f8e005.tar.bz2
go-tangerine-d96ba77113e1a87e0402fa4eb6a5776786f8e005.tar.lz
go-tangerine-d96ba77113e1a87e0402fa4eb6a5776786f8e005.tar.xz
go-tangerine-d96ba77113e1a87e0402fa4eb6a5776786f8e005.tar.zst
go-tangerine-d96ba77113e1a87e0402fa4eb6a5776786f8e005.zip
eth/filters: improve error message for invalid filter topics (#17234)
-rw-r--r--eth/filters/api.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/eth/filters/api.go b/eth/filters/api.go
index 4e686c0ce..6fea14fee 100644
--- a/eth/filters/api.go
+++ b/eth/filters/api.go
@@ -564,7 +564,7 @@ func (args *FilterCriteria) UnmarshalJSON(data []byte) error {
func decodeAddress(s string) (common.Address, error) {
b, err := hexutil.Decode(s)
if err == nil && len(b) != common.AddressLength {
- err = fmt.Errorf("hex has invalid length %d after decoding", len(b))
+ err = fmt.Errorf("hex has invalid length %d after decoding; expected %d for address", len(b), common.AddressLength)
}
return common.BytesToAddress(b), err
}
@@ -572,7 +572,7 @@ func decodeAddress(s string) (common.Address, error) {
func decodeTopic(s string) (common.Hash, error) {
b, err := hexutil.Decode(s)
if err == nil && len(b) != common.HashLength {
- err = fmt.Errorf("hex has invalid length %d after decoding", len(b))
+ err = fmt.Errorf("hex has invalid length %d after decoding; expected %d for topic", len(b), common.HashLength)
}
return common.BytesToHash(b), err
}