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
6b30617820
commit
d70a98d4b4
2 changed files with 7 additions and 7 deletions
|
|
@ -21,16 +21,16 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/ethereum/go-ethereum/common/math"
|
|
||||||
"math/big"
|
"math/big"
|
||||||
"mime"
|
"mime"
|
||||||
"reflect"
|
|
||||||
"regexp"
|
"regexp"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"unicode"
|
"unicode"
|
||||||
|
|
||||||
|
"github.com/ethereum/go-ethereum/common/math"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/accounts"
|
"github.com/ethereum/go-ethereum/accounts"
|
||||||
"github.com/ethereum/go-ethereum/accounts/abi"
|
"github.com/ethereum/go-ethereum/accounts/abi"
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
|
|
@ -508,10 +508,10 @@ func (typedData *TypedData) EncodePrimitiveValue(encType string, encValue interf
|
||||||
if size < 0 || size > 32 {
|
if size < 0 || size > 32 {
|
||||||
return nil, fmt.Errorf("invalid size on bytes: %d", size)
|
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)
|
return nil, dataMismatchError(encType, encValue)
|
||||||
} else {
|
} 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") {
|
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)
|
t.Fatalf("Expected no error, got %v", err)
|
||||||
}
|
}
|
||||||
_, err = malformedTypedData.HashStruct("EIP712Domain", malformedTypedData.Domain.Map())
|
_, err = malformedTypedData.HashStruct("EIP712Domain", malformedTypedData.Domain.Map())
|
||||||
if err == nil {
|
if err != nil {
|
||||||
t.Errorf("Expected an error, got %v", err)
|
t.Errorf("Expected no error, got %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue