From e78a43484747df4f4109281eb715119b60faf378 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Wed, 13 Sep 2017 10:52:30 +0200 Subject: [PATCH] core,tests: Updates pending new tests --- core/state_transition.go | 2 +- core/vm/evm.go | 6 +++--- tests/block_test.go | 2 -- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/core/state_transition.go b/core/state_transition.go index e7a0685893..bd2a8e1b24 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -241,7 +241,7 @@ func (st *StateTransition) TransitionDb() (ret []byte, requiredGas, usedGas *big } else { // Increment the nonce for the next transaction st.state.SetNonce(sender.Address(), st.state.GetNonce(sender.Address())+1) - ret, st.gas, vmerr = evm.Call(sender, st.to().Address(), st.data, st.gas, st.value) + ret, st.gas, vmerr = evm.Call(sender, *msg.To(), st.data, st.gas, st.value) } if vmerr != nil { log.Debug("VM returned with error", "err", vmerr) diff --git a/core/vm/evm.go b/core/vm/evm.go index 495d9beea1..8e3c65433e 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -299,9 +299,6 @@ func (evm *EVM) StaticCall(caller ContractRef, addr common.Address, input []byte // Create creates a new contract using code as deployment code. func (evm *EVM) Create(caller ContractRef, code []byte, gas uint64, value *big.Int) (ret []byte, contractAddr common.Address, leftOverGas uint64, err error) { - if evm.vmConfig.NoRecursion && evm.depth > 0 { - return nil, common.Address{}, gas, nil - } // Depth check execution. Fail if we're trying to execute above the // limit. @@ -334,6 +331,9 @@ func (evm *EVM) Create(caller ContractRef, code []byte, gas uint64, value *big.I contract := NewContract(caller, AccountRef(contractAddr), value, gas) contract.SetCallCode(&contractAddr, crypto.Keccak256Hash(code), code) + if evm.vmConfig.NoRecursion && evm.depth > 0 { + return nil, contractAddr, gas, nil + } ret, err = run(evm, snapshot, contract, nil) // check whether the max code size has been exceeded maxCodeSizeExceeded := evm.ChainConfig().IsEIP158(evm.BlockNumber) && len(ret) > params.MaxCodeSize diff --git a/tests/block_test.go b/tests/block_test.go index 56e1e1e8da..669d3ca08a 100644 --- a/tests/block_test.go +++ b/tests/block_test.go @@ -32,8 +32,6 @@ func TestBlockchain(t *testing.T) { bt.skipLoad(`^bcTotalDifficultyTest/(lotsOfLeafs|lotsOfBranches|sideChainWithMoreTransactions)`) // Constantinople is not implemented yet. bt.skipLoad(`(?i)(constantinople)`) - // Expected failures: - bt.fails(`^TransitionTests/bcHomesteadToDao/DaoTransactions(|_UncleExtradata|_EmptyTransactionAndForkBlocksAhead)\.json`, "issue in test") // Still failing tests bt.skipLoad(`^bcWalletTest.*_Byzantium$`)