mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
Fixed failing test, formatted files
This commit is contained in:
parent
2f33a65abd
commit
a623d751a8
2 changed files with 7 additions and 7 deletions
|
|
@ -21,16 +21,16 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/ethereum/go-ethereum/common/math"
|
||||
"math/big"
|
||||
"mime"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"unicode"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common/math"
|
||||
|
||||
"github.com/ethereum/go-ethereum/accounts"
|
||||
"github.com/ethereum/go-ethereum/accounts/abi"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
|
|
@ -508,10 +508,10 @@ func (typedData *TypedData) EncodePrimitiveValue(encType string, encValue interf
|
|||
if size < 0 || size > 32 {
|
||||
return nil, fmt.Errorf("invalid size on bytes: %d", size)
|
||||
}
|
||||
if byteval, ok := encValue.(hexutil.Bytes); !ok {
|
||||
if byteValue, ok := encValue.(hexutil.Bytes); !ok {
|
||||
return nil, dataMismatchError(encType, encValue)
|
||||
} else {
|
||||
return math.PaddedBigBytes(new(big.Int).SetBytes(byteval), 32), nil
|
||||
return math.PaddedBigBytes(new(big.Int).SetBytes(byteValue), 32), nil
|
||||
}
|
||||
}
|
||||
if strings.HasPrefix(encType, "uint") || strings.HasPrefix(encType, "int") {
|
||||
|
|
|
|||
|
|
@ -709,7 +709,7 @@ func TestMalformedData5(t *testing.T) {
|
|||
t.Fatalf("Expected no error, got %v", err)
|
||||
}
|
||||
_, err = malformedTypedData.HashStruct("EIP712Domain", malformedTypedData.Domain.Map())
|
||||
if err == nil {
|
||||
t.Errorf("Expected an error, got %v", err)
|
||||
if err != nil {
|
||||
t.Errorf("Expected no error, got %v", err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue