From c2c4c9f1e5f887058285c1299d250899fe0f7d89 Mon Sep 17 00:00:00 2001 From: gary rong Date: Wed, 14 Aug 2019 20:53:21 +0800 Subject: 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 --- tests/transaction_test_util.go | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'tests') 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 } -- cgit v1.2.3