@@ -18,6 +18,7 @@ package abi
18
18
19
19
import (
20
20
"encoding/json"
21
+ "errors"
21
22
"fmt"
22
23
"reflect"
23
24
"strings"
@@ -79,7 +80,7 @@ func (arguments Arguments) isTuple() bool {
79
80
func (arguments Arguments ) Unpack (data []byte ) ([]interface {}, error ) {
80
81
if len (data ) == 0 {
81
82
if len (arguments .NonIndexed ()) != 0 {
82
- return nil , fmt . Errorf ("abi: attempting to unmarshall an empty string while arguments are expected" )
83
+ return nil , errors . New ("abi: attempting to unmarshall an empty string while arguments are expected" )
83
84
}
84
85
return make ([]interface {}, 0 ), nil
85
86
}
@@ -90,11 +91,11 @@ func (arguments Arguments) Unpack(data []byte) ([]interface{}, error) {
90
91
func (arguments Arguments ) UnpackIntoMap (v map [string ]interface {}, data []byte ) error {
91
92
// Make sure map is not nil
92
93
if v == nil {
93
- return fmt . Errorf ("abi: cannot unpack into a nil map" )
94
+ return errors . New ("abi: cannot unpack into a nil map" )
94
95
}
95
96
if len (data ) == 0 {
96
97
if len (arguments .NonIndexed ()) != 0 {
97
- return fmt . Errorf ("abi: attempting to unmarshall an empty string while arguments are expected" )
98
+ return errors . New ("abi: attempting to unmarshall an empty string while arguments are expected" )
98
99
}
99
100
return nil // Nothing to unmarshal, return
100
101
}
@@ -116,7 +117,7 @@ func (arguments Arguments) Copy(v interface{}, values []interface{}) error {
116
117
}
117
118
if len (values ) == 0 {
118
119
if len (arguments .NonIndexed ()) != 0 {
119
- return fmt . Errorf ("abi: attempting to copy no values while arguments are expected" )
120
+ return errors . New ("abi: attempting to copy no values while arguments are expected" )
120
121
}
121
122
return nil // Nothing to copy, return
122
123
}
0 commit comments