aboutsummaryrefslogtreecommitdiffstats
path: root/tests/transaction_test_util.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-01-03 22:53:06 +0800
committerGitHub <noreply@github.com>2018-01-03 22:53:06 +0800
commit762f3a48a00da02fe58063cb6ce8dc2d08821f15 (patch)
tree783421f8ece4306f69cb17e515ee07c1ab4fe0eb /tests/transaction_test_util.go
parentb47285f1cf0cb475f29322ceb9fac4d7e1cfb11f (diff)
parent6f69cdd109b1dd692b8dfb15e7c53d2051fbc946 (diff)
downloaddexon-762f3a48a00da02fe58063cb6ce8dc2d08821f15.tar
dexon-762f3a48a00da02fe58063cb6ce8dc2d08821f15.tar.gz
dexon-762f3a48a00da02fe58063cb6ce8dc2d08821f15.tar.bz2
dexon-762f3a48a00da02fe58063cb6ce8dc2d08821f15.tar.lz
dexon-762f3a48a00da02fe58063cb6ce8dc2d08821f15.tar.xz
dexon-762f3a48a00da02fe58063cb6ce8dc2d08821f15.tar.zst
dexon-762f3a48a00da02fe58063cb6ce8dc2d08821f15.zip
Merge pull request #15466 from karalabe/uint64-gas-limit
all: switch gas limits from big.Int to uint64
Diffstat (limited to 'tests/transaction_test_util.go')
-rw-r--r--tests/transaction_test_util.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/transaction_test_util.go b/tests/transaction_test_util.go
index 472b3d6f2..2028d2a27 100644
--- a/tests/transaction_test_util.go
+++ b/tests/transaction_test_util.go
@@ -46,7 +46,7 @@ type ttJSON struct {
type ttTransaction struct {
Data []byte `gencodec:"required"`
- GasLimit *big.Int `gencodec:"required"`
+ GasLimit uint64 `gencodec:"required"`
GasPrice *big.Int `gencodec:"required"`
Nonce uint64 `gencodec:"required"`
Value *big.Int `gencodec:"required"`
@@ -58,7 +58,7 @@ type ttTransaction struct {
type ttTransactionMarshaling struct {
Data hexutil.Bytes
- GasLimit *math.HexOrDecimal256
+ GasLimit math.HexOrDecimal64
GasPrice *math.HexOrDecimal256
Nonce math.HexOrDecimal64
Value *math.HexOrDecimal256
@@ -100,8 +100,8 @@ func (tt *ttTransaction) verify(signer types.Signer, tx *types.Transaction) erro
if !bytes.Equal(tx.Data(), tt.Data) {
return fmt.Errorf("Tx input data mismatch: got %x want %x", tx.Data(), tt.Data)
}
- if tx.Gas().Cmp(tt.GasLimit) != 0 {
- return fmt.Errorf("GasLimit mismatch: got %v, want %v", tx.Gas(), tt.GasLimit)
+ if tx.Gas() != tt.GasLimit {
+ return fmt.Errorf("GasLimit mismatch: got %d, want %d", tx.Gas(), tt.GasLimit)
}
if tx.GasPrice().Cmp(tt.GasPrice) != 0 {
return fmt.Errorf("GasPrice mismatch: got %v, want %v", tx.GasPrice(), tt.GasPrice)