abi: run go fmt and update comments

This commit is contained in:
Darren Kelly 2024-11-06 19:06:35 +00:00
parent 14ad799a67
commit c50127b975
No known key found for this signature in database
GPG Key ID: 7C9A023E4B7FEE4D
2 changed files with 3 additions and 3 deletions

View File

@ -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 {

View File

@ -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)