aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorgary rong <garyrong0905@gmail.com>2019-08-14 20:53:21 +0800
committerPéter Szilágyi <peterke@gmail.com>2019-08-14 20:53:21 +0800
commitc2c4c9f1e5f887058285c1299d250899fe0f7d89 (patch)
tree75bf202494ff70905f0c67e56b0840e615979c1e /tests
parent44c8b9ad373dd99d4a92d6e5de63a7e7354bd850 (diff)
downloadgo-tangerine-c2c4c9f1e5f887058285c1299d250899fe0f7d89.tar
go-tangerine-c2c4c9f1e5f887058285c1299d250899fe0f7d89.tar.gz
go-tangerine-c2c4c9f1e5f887058285c1299d250899fe0f7d89.tar.bz2
go-tangerine-c2c4c9f1e5f887058285c1299d250899fe0f7d89.tar.lz
go-tangerine-c2c4c9f1e5f887058285c1299d250899fe0f7d89.tar.xz
go-tangerine-c2c4c9f1e5f887058285c1299d250899fe0f7d89.tar.zst
go-tangerine-c2c4c9f1e5f887058285c1299d250899fe0f7d89.zip
core, light, params: implement eip2028 (#19931)
* core, light, params: implement eip2028 * core, light: address comments * core: address comments * tests: disable Istanbul tx tests (until updated) * core: address comment
Diffstat (limited to 'tests')
-rw-r--r--tests/transaction_test_util.go24
1 files changed, 14 insertions, 10 deletions
diff --git a/tests/transaction_test_util.go b/tests/transaction_test_util.go
index 12444720c..85bf1fb0b 100644
--- a/tests/transaction_test_util.go
+++ b/tests/transaction_test_util.go
@@ -32,6 +32,7 @@ type TransactionTest struct {
RLP hexutil.Bytes `json:"rlp"`
Byzantium ttFork
Constantinople ttFork
+ Istanbul ttFork
EIP150 ttFork
EIP158 ttFork
Frontier ttFork
@@ -45,7 +46,7 @@ type ttFork struct {
func (tt *TransactionTest) Run(config *params.ChainConfig) error {
- validateTx := func(rlpData hexutil.Bytes, signer types.Signer, isHomestead bool) (*common.Address, *common.Hash, error) {
+ validateTx := func(rlpData hexutil.Bytes, signer types.Signer, isHomestead bool, isIstanbul bool) (*common.Address, *common.Hash, error) {
tx := new(types.Transaction)
if err := rlp.DecodeBytes(rlpData, tx); err != nil {
return nil, nil, err
@@ -55,7 +56,7 @@ func (tt *TransactionTest) Run(config *params.ChainConfig) error {
return nil, nil, err
}
// Intrinsic gas
- requiredGas, err := core.IntrinsicGas(tx.Data(), tx.To() == nil, isHomestead)
+ requiredGas, err := core.IntrinsicGas(tx.Data(), tx.To() == nil, isHomestead, isIstanbul)
if err != nil {
return nil, nil, err
}
@@ -71,19 +72,22 @@ func (tt *TransactionTest) Run(config *params.ChainConfig) error {
signer types.Signer
fork ttFork
isHomestead bool
+ isIstanbul bool
}{
- {"Frontier", types.FrontierSigner{}, tt.Frontier, false},
- {"Homestead", types.HomesteadSigner{}, tt.Homestead, true},
- {"EIP150", types.HomesteadSigner{}, tt.EIP150, true},
- {"EIP158", types.NewEIP155Signer(config.ChainID), tt.EIP158, true},
- {"Byzantium", types.NewEIP155Signer(config.ChainID), tt.Byzantium, true},
- {"Constantinople", types.NewEIP155Signer(config.ChainID), tt.Constantinople, true},
+ {"Frontier", types.FrontierSigner{}, tt.Frontier, false, false},
+ {"Homestead", types.HomesteadSigner{}, tt.Homestead, true, false},
+ {"EIP150", types.HomesteadSigner{}, tt.EIP150, true, false},
+ {"EIP158", types.NewEIP155Signer(config.ChainID), tt.EIP158, true, false},
+ {"Byzantium", types.NewEIP155Signer(config.ChainID), tt.Byzantium, true, false},
+ {"Constantinople", types.NewEIP155Signer(config.ChainID), tt.Constantinople, true, false},
+ //TODO! @holiman or @rjl493456442 : enable this after tests have been updated for Istanbul
+ //{"Istanbul", types.NewEIP155Signer(config.ChainID), tt.Istanbul, true, true},
} {
- sender, txhash, err := validateTx(tt.RLP, testcase.signer, testcase.isHomestead)
+ sender, txhash, err := validateTx(tt.RLP, testcase.signer, testcase.isHomestead, testcase.isIstanbul)
if testcase.fork.Sender == (common.UnprefixedAddress{}) {
if err == nil {
- return fmt.Errorf("Expected error, got none (address %v)", sender.String())
+ return fmt.Errorf("Expected error, got none (address %v)[%v]", sender.String(), testcase.name)
}
continue
}