diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/tx_pool.go | 6 | ||||
-rw-r--r-- | core/vm/evm/oracle_contracts.go | 4 | ||||
-rw-r--r-- | core/vm/tools/transaction.go | 5 |
3 files changed, 8 insertions, 7 deletions
diff --git a/core/tx_pool.go b/core/tx_pool.go index e7dbab0d2..df11224e7 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -30,7 +30,7 @@ import ( "github.com/dexon-foundation/dexon/common/prque" "github.com/dexon-foundation/dexon/core/state" "github.com/dexon-foundation/dexon/core/types" - "github.com/dexon-foundation/dexon/core/vm" + "github.com/dexon-foundation/dexon/core/vm/evm" "github.com/dexon-foundation/dexon/event" "github.com/dexon-foundation/dexon/log" "github.com/dexon-foundation/dexon/metrics" @@ -397,7 +397,7 @@ func (pool *TxPool) reset(oldHead, newHead *types.Header) { } else { round -= dexCore.ConfigRoundShift } - state := &vm.GovernanceState{StateDB: statedb} + state := &evm.GovernanceState{StateDB: statedb} height := state.RoundHeight(new(big.Int).SetUint64((round))).Uint64() block := pool.chain.GetBlockByNumber(height) if block == nil { @@ -409,7 +409,7 @@ func (pool *TxPool) reset(oldHead, newHead *types.Header) { log.Error("Failed to get txpool state for min gas price", "err", err) panic("cannot get state for new round's min gas price") } - govState := &vm.GovernanceState{StateDB: configState} + govState := &evm.GovernanceState{StateDB: configState} pool.setGovPrice(govState.MinGasPrice()) } diff --git a/core/vm/evm/oracle_contracts.go b/core/vm/evm/oracle_contracts.go index be7b1f5cd..94ccfb858 100644 --- a/core/vm/evm/oracle_contracts.go +++ b/core/vm/evm/oracle_contracts.go @@ -1591,7 +1591,7 @@ func (g *GovernanceContract) register( } caller := g.contract.Caller() - value := g.contract.Value() + value := g.contract.Value offset := g.state.NodesOffsetByAddress(caller) // Can not register if already registered. @@ -1642,7 +1642,7 @@ func (g *GovernanceContract) register( func (g *GovernanceContract) stake() ([]byte, error) { caller := g.contract.Caller() - value := g.contract.Value() + value := g.contract.Value if big.NewInt(0).Cmp(value) == 0 { return nil, errExecutionReverted diff --git a/core/vm/tools/transaction.go b/core/vm/tools/transaction.go index 1ff36a36e..4a230f443 100644 --- a/core/vm/tools/transaction.go +++ b/core/vm/tools/transaction.go @@ -8,10 +8,11 @@ import ( "math/big" "sync/atomic" + "golang.org/x/crypto/sha3" + "github.com/dexon-foundation/dexon/common" "github.com/dexon-foundation/dexon/common/hexutil" "github.com/dexon-foundation/dexon/crypto" - "github.com/dexon-foundation/dexon/crypto/sha3" "github.com/dexon-foundation/dexon/rlp" ) @@ -248,7 +249,7 @@ func (tx *Transaction) Hash() common.Hash { return v } func rlpHash(x interface{}) (h common.Hash) { - hw := sha3.NewKeccak256() + hw := sha3.NewLegacyKeccak256() rlp.Encode(hw, x) hw.Sum(h[:0]) return h |