aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2020-06-30 20:56:12 -0400
committerDeterminant <[email protected]>2020-06-30 20:56:12 -0400
commitfbe0f2d6b14d7b6fc43068e224412d4e65176550 (patch)
tree5db367ee2d219386c2968f30e51c8c67c1ef8121 /core
parent7feec02902d52a3abf722613eb9e218e015b723c (diff)
test multi-coin smart contracts
Diffstat (limited to 'core')
-rw-r--r--core/state/statedb.go3
-rw-r--r--core/state_transition.go1
2 files changed, 2 insertions, 2 deletions
diff --git a/core/state/statedb.go b/core/state/statedb.go
index 1d3207d..9c7535b 100644
--- a/core/state/statedb.go
+++ b/core/state/statedb.go
@@ -41,6 +41,7 @@ type revision struct {
var (
// emptyRoot is the known root hash of an empty trie.
emptyRoot = common.HexToHash("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")
+ zeroRoot = common.HexToHash("0000000000000000000000000000000000000000000000000000000000000000")
// emptyCode is the known hash of the empty EVM bytecode.
emptyCode = crypto.Keccak256Hash(nil)
@@ -239,7 +240,7 @@ func (self *StateDB) GetBalanceMultiCoin(addr common.Address, coinID common.Hash
func (self *StateDB) EnableMultiCoin(addr common.Address) error {
stateObject := self.GetOrNewStateObject(addr)
- if stateObject.data.Root != emptyRoot {
+ if stateObject.data.Root != emptyRoot && stateObject.data.Root != zeroRoot {
return errors.New("not a fresh account")
}
if !stateObject.EnableMultiCoin() {
diff --git a/core/state_transition.go b/core/state_transition.go
index 139289f..7a48597 100644
--- a/core/state_transition.go
+++ b/core/state_transition.go
@@ -219,7 +219,6 @@ func (st *StateTransition) TransitionDb() (ret []byte, usedGas uint64, failed bo
if contractCreation {
ret, _, st.gas, vmerr = evm.Create(sender, st.data, st.gas, st.value)
} else {
- log.Debug("here2")
// Increment the nonce for the next transaction
st.state.SetNonce(msg.From(), st.state.GetNonce(sender.Address())+1)
ret, st.gas, vmerr = evm.CallExpert(sender, st.to(), st.data, st.gas, st.value, st.coinID, st.value2)