abi: run go fmt and update comments
This commit is contained in:
parent
14ad799a67
commit
c50127b975
|
@ -84,7 +84,7 @@ func (abi ABI) Pack(name string, args ...interface{}) ([]byte, error) {
|
|||
|
||||
func (abi ABI) getArguments(name string, data []byte) (Arguments, error) {
|
||||
// since there can't be naming collisions with contracts and events,
|
||||
// we need to decide whether we're calling a method or an event
|
||||
// we need to decide whether we're calling a method, event or an error
|
||||
var args Arguments
|
||||
if method, ok := abi.Methods[name]; ok {
|
||||
if len(data)%32 != 0 {
|
||||
|
|
|
@ -21,7 +21,6 @@ import (
|
|||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/ethereum/go-ethereum/internal/testrand"
|
||||
"math/big"
|
||||
"reflect"
|
||||
"strings"
|
||||
|
@ -30,6 +29,7 @@ import (
|
|||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/common/math"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/internal/testrand"
|
||||
)
|
||||
|
||||
const jsondata = `
|
||||
|
@ -318,7 +318,7 @@ func TestCustomErrors(t *testing.T) {
|
|||
check("MyError", "MyError(uint256)")
|
||||
}
|
||||
|
||||
func TestCustomErrorUnpack(t *testing.T) {
|
||||
func TestCustomErrorUnpackIntoInterface(t *testing.T) {
|
||||
t.Parallel()
|
||||
errorName := "MyError"
|
||||
json := fmt.Sprintf(`[{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"}],"name":"%s","type":"error"}]`, errorName)
|
||||
|
|
Loading…
Reference in New Issue