Skip to content

Commit 71be3b0

Browse files
Merge pull request #878 from XinFinOrg/dev-upgrade
Dev upgrade monthly merge
2 parents 1b22714 + 92fb0ca commit 71be3b0

File tree

147 files changed

+3276
-1601
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+3276
-1601
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ jobs:
153153
chmod 600 $HOME/.kube/config
154154
git_hash=$(git rev-parse --short "$GITHUB_SHA")
155155
kubectl set image deployment/devnetrpc devnetrpc=xinfinorg/devnet:dev-upgrade-${git_hash} || true
156+
kubectl set image deployment/devnetrpc2 devnetrpc=xinfinorg/devnet:dev-upgrade-${git_hash} || true
156157
kubectl set image deployment/testnetrpc testnetrpc=xinfinorg/devnet:dev-upgrade-${git_hash} || true
157158
kubectl set image deployment/mainnetrpc mainnetrpc=xinfinorg/devnet:dev-upgrade-${git_hash} || true
158159
echo done

XDCx/order_processor_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"github.com/XinFinOrg/XDPoSChain/XDCx/tradingstate"
99
"github.com/XinFinOrg/XDPoSChain/common"
1010
"github.com/XinFinOrg/XDPoSChain/core/rawdb"
11+
"github.com/XinFinOrg/XDPoSChain/core/types"
1112
)
1213

1314
func Test_getCancelFeeV1(t *testing.T) {
@@ -92,7 +93,7 @@ func Test_getCancelFee(t *testing.T) {
9293
XDCx := New(&DefaultConfig)
9394
db := rawdb.NewMemoryDatabase()
9495
stateCache := tradingstate.NewDatabase(db)
95-
tradingStateDb, _ := tradingstate.New(common.Hash{}, stateCache)
96+
tradingStateDb, _ := tradingstate.New(types.EmptyRootHash, stateCache)
9697

9798
testTokenA := common.HexToAddress("0x1000000000000000000000000000000000000002")
9899
testTokenB := common.HexToAddress("0x1100000000000000000000000000000000000003")

XDCx/tradingstate/XDCx_trie_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,21 @@ package tradingstate
22

33
import (
44
"fmt"
5-
"github.com/XinFinOrg/XDPoSChain/common"
6-
"github.com/XinFinOrg/XDPoSChain/core/rawdb"
75
"math/big"
86
"math/rand"
97
"testing"
108
"time"
9+
10+
"github.com/XinFinOrg/XDPoSChain/common"
11+
"github.com/XinFinOrg/XDPoSChain/core/rawdb"
12+
"github.com/XinFinOrg/XDPoSChain/core/types"
1113
)
1214

1315
func TestXDCxTrieTest(t *testing.T) {
1416
t.SkipNow()
1517
db := rawdb.NewMemoryDatabase()
1618
stateCache := NewDatabase(db)
17-
trie, _ := stateCache.OpenStorageTrie(EmptyHash, EmptyHash)
19+
trie, _ := stateCache.OpenStorageTrie(EmptyHash, types.EmptyRootHash)
1820
max := 1000000
1921
for i := 1; i < max; i++ {
2022
k := common.BigToHash(big.NewInt(int64(i))).Bytes()

XDCx/tradingstate/orderitem.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ func IsValidRelayer(statedb *state.StateDB, address common.Address) bool {
319319

320320
locBigDeposit := new(big.Int).SetUint64(uint64(0)).Add(locRelayerState, RelayerStructMappingSlot["_deposit"])
321321
locHashDeposit := common.BigToHash(locBigDeposit)
322-
balance := statedb.GetState(common.HexToAddress(common.RelayerRegistrationSMC), locHashDeposit).Big()
322+
balance := statedb.GetState(common.RelayerRegistrationSMC, locHashDeposit).Big()
323323
if balance.Cmp(new(big.Int).Mul(common.BasePrice, common.RelayerLockedFund)) <= 0 {
324324
log.Debug("Relayer is not in relayer list", "relayer", address.String(), "balance", balance)
325325
return false

XDCx/tradingstate/relayer_state.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func GetExRelayerFee(relayer common.Address, statedb *state.StateDB) *big.Int {
2424
locBig := GetLocMappingAtKey(relayer.Hash(), slot)
2525
locBig = new(big.Int).Add(locBig, RelayerStructMappingSlot["_fee"])
2626
locHash := common.BigToHash(locBig)
27-
return statedb.GetState(common.HexToAddress(common.RelayerRegistrationSMC), locHash).Big()
27+
return statedb.GetState(common.RelayerRegistrationSMC, locHash).Big()
2828
}
2929

3030
func GetRelayerOwner(relayer common.Address, statedb *state.StateDB) common.Address {
@@ -33,23 +33,23 @@ func GetRelayerOwner(relayer common.Address, statedb *state.StateDB) common.Addr
3333
log.Debug("GetRelayerOwner", "relayer", relayer.Hex(), "slot", slot, "locBig", locBig)
3434
locBig = new(big.Int).Add(locBig, RelayerStructMappingSlot["_owner"])
3535
locHash := common.BigToHash(locBig)
36-
return common.BytesToAddress(statedb.GetState(common.HexToAddress(common.RelayerRegistrationSMC), locHash).Bytes())
36+
return common.BytesToAddress(statedb.GetState(common.RelayerRegistrationSMC, locHash).Bytes())
3737
}
3838

3939
// return true if relayer request to resign and have not withdraw locked fund
4040
func IsResignedRelayer(relayer common.Address, statedb *state.StateDB) bool {
4141
slot := RelayerMappingSlot["RESIGN_REQUESTS"]
4242
locBig := GetLocMappingAtKey(relayer.Hash(), slot)
4343
locHash := common.BigToHash(locBig)
44-
return statedb.GetState(common.HexToAddress(common.RelayerRegistrationSMC), locHash) != (common.Hash{})
44+
return statedb.GetState(common.RelayerRegistrationSMC, locHash) != (common.Hash{})
4545
}
4646

4747
func GetBaseTokenLength(relayer common.Address, statedb *state.StateDB) uint64 {
4848
slot := RelayerMappingSlot["RELAYER_LIST"]
4949
locBig := GetLocMappingAtKey(relayer.Hash(), slot)
5050
locBig = new(big.Int).Add(locBig, RelayerStructMappingSlot["_fromTokens"])
5151
locHash := common.BigToHash(locBig)
52-
return statedb.GetState(common.HexToAddress(common.RelayerRegistrationSMC), locHash).Big().Uint64()
52+
return statedb.GetState(common.RelayerRegistrationSMC, locHash).Big().Uint64()
5353
}
5454

5555
func GetBaseTokenAtIndex(relayer common.Address, statedb *state.StateDB, index uint64) common.Address {
@@ -58,15 +58,15 @@ func GetBaseTokenAtIndex(relayer common.Address, statedb *state.StateDB, index u
5858
locBig = new(big.Int).Add(locBig, RelayerStructMappingSlot["_fromTokens"])
5959
locHash := common.BigToHash(locBig)
6060
loc := state.GetLocDynamicArrAtElement(locHash, index, 1)
61-
return common.BytesToAddress(statedb.GetState(common.HexToAddress(common.RelayerRegistrationSMC), loc).Bytes())
61+
return common.BytesToAddress(statedb.GetState(common.RelayerRegistrationSMC, loc).Bytes())
6262
}
6363

6464
func GetQuoteTokenLength(relayer common.Address, statedb *state.StateDB) uint64 {
6565
slot := RelayerMappingSlot["RELAYER_LIST"]
6666
locBig := GetLocMappingAtKey(relayer.Hash(), slot)
6767
locBig = new(big.Int).Add(locBig, RelayerStructMappingSlot["_toTokens"])
6868
locHash := common.BigToHash(locBig)
69-
return statedb.GetState(common.HexToAddress(common.RelayerRegistrationSMC), locHash).Big().Uint64()
69+
return statedb.GetState(common.RelayerRegistrationSMC, locHash).Big().Uint64()
7070
}
7171

7272
func GetQuoteTokenAtIndex(relayer common.Address, statedb *state.StateDB, index uint64) common.Address {
@@ -75,13 +75,13 @@ func GetQuoteTokenAtIndex(relayer common.Address, statedb *state.StateDB, index
7575
locBig = new(big.Int).Add(locBig, RelayerStructMappingSlot["_toTokens"])
7676
locHash := common.BigToHash(locBig)
7777
loc := state.GetLocDynamicArrAtElement(locHash, index, 1)
78-
return common.BytesToAddress(statedb.GetState(common.HexToAddress(common.RelayerRegistrationSMC), loc).Bytes())
78+
return common.BytesToAddress(statedb.GetState(common.RelayerRegistrationSMC, loc).Bytes())
7979
}
8080

8181
func GetRelayerCount(statedb *state.StateDB) uint64 {
8282
slot := RelayerMappingSlot["RelayerCount"]
8383
slotHash := common.BigToHash(new(big.Int).SetUint64(slot))
84-
valueHash := statedb.GetState(common.HexToAddress(common.RelayerRegistrationSMC), slotHash)
84+
valueHash := statedb.GetState(common.RelayerRegistrationSMC, slotHash)
8585
return new(big.Int).SetBytes(valueHash.Bytes()).Uint64()
8686
}
8787

@@ -90,7 +90,7 @@ func GetAllCoinbases(statedb *state.StateDB) []common.Address {
9090
slot := RelayerMappingSlot["RELAYER_COINBASES"]
9191
coinbases := []common.Address{}
9292
for i := uint64(0); i < relayerCount; i++ {
93-
valueHash := statedb.GetState(common.HexToAddress(common.RelayerRegistrationSMC), common.BytesToHash(state.GetLocMappingAtKey(common.BigToHash(big.NewInt(int64(i))), slot).Bytes()))
93+
valueHash := statedb.GetState(common.RelayerRegistrationSMC, common.BytesToHash(state.GetLocMappingAtKey(common.BigToHash(big.NewInt(int64(i))), slot).Bytes()))
9494
coinbases = append(coinbases, common.BytesToAddress(valueHash.Bytes()))
9595
}
9696
return coinbases
@@ -102,21 +102,21 @@ func GetAllTradingPairs(statedb *state.StateDB) (map[common.Hash]bool, error) {
102102
for _, coinbase := range coinbases {
103103
locBig := GetLocMappingAtKey(coinbase.Hash(), slot)
104104
fromTokenSlot := new(big.Int).Add(locBig, RelayerStructMappingSlot["_fromTokens"])
105-
fromTokenLength := statedb.GetState(common.HexToAddress(common.RelayerRegistrationSMC), common.BigToHash(fromTokenSlot)).Big().Uint64()
105+
fromTokenLength := statedb.GetState(common.RelayerRegistrationSMC, common.BigToHash(fromTokenSlot)).Big().Uint64()
106106
toTokenSlot := new(big.Int).Add(locBig, RelayerStructMappingSlot["_toTokens"])
107-
toTokenLength := statedb.GetState(common.HexToAddress(common.RelayerRegistrationSMC), common.BigToHash(toTokenSlot)).Big().Uint64()
107+
toTokenLength := statedb.GetState(common.RelayerRegistrationSMC, common.BigToHash(toTokenSlot)).Big().Uint64()
108108
if toTokenLength != fromTokenLength {
109109
return map[common.Hash]bool{}, fmt.Errorf("invalid length from token & to token: from :%d , to :%d ", fromTokenLength, toTokenLength)
110110
}
111111
fromTokens := []common.Address{}
112112
fromTokenSlotHash := common.BytesToHash(fromTokenSlot.Bytes())
113113
for i := uint64(0); i < fromTokenLength; i++ {
114-
fromToken := common.BytesToAddress(statedb.GetState(common.HexToAddress(common.RelayerRegistrationSMC), state.GetLocDynamicArrAtElement(fromTokenSlotHash, i, uint64(1))).Bytes())
114+
fromToken := common.BytesToAddress(statedb.GetState(common.RelayerRegistrationSMC, state.GetLocDynamicArrAtElement(fromTokenSlotHash, i, uint64(1))).Bytes())
115115
fromTokens = append(fromTokens, fromToken)
116116
}
117117
toTokenSlotHash := common.BytesToHash(toTokenSlot.Bytes())
118118
for i := uint64(0); i < toTokenLength; i++ {
119-
toToken := common.BytesToAddress(statedb.GetState(common.HexToAddress(common.RelayerRegistrationSMC), state.GetLocDynamicArrAtElement(toTokenSlotHash, i, uint64(1))).Bytes())
119+
toToken := common.BytesToAddress(statedb.GetState(common.RelayerRegistrationSMC, state.GetLocDynamicArrAtElement(toTokenSlotHash, i, uint64(1))).Bytes())
120120

121121
log.Debug("GetAllTradingPairs all pair info", "from", fromTokens[i].Hex(), "toToken", toToken.Hex())
122122
allPairs[GetTradingOrderBookHash(fromTokens[i], toToken)] = true
@@ -132,14 +132,14 @@ func SubRelayerFee(relayer common.Address, fee *big.Int, statedb *state.StateDB)
132132

133133
locBigDeposit := new(big.Int).SetUint64(uint64(0)).Add(locBig, RelayerStructMappingSlot["_deposit"])
134134
locHashDeposit := common.BigToHash(locBigDeposit)
135-
balance := statedb.GetState(common.HexToAddress(common.RelayerRegistrationSMC), locHashDeposit).Big()
135+
balance := statedb.GetState(common.RelayerRegistrationSMC, locHashDeposit).Big()
136136
log.Debug("ApplyXDCXMatchedTransaction settle balance: SubRelayerFee BEFORE", "relayer", relayer.String(), "balance", balance)
137137
if balance.Cmp(fee) < 0 {
138138
return errors.Errorf("relayer %s isn't enough XDC fee", relayer.String())
139139
} else {
140140
balance = new(big.Int).Sub(balance, fee)
141-
statedb.SetState(common.HexToAddress(common.RelayerRegistrationSMC), locHashDeposit, common.BigToHash(balance))
142-
statedb.SubBalance(common.HexToAddress(common.RelayerRegistrationSMC), fee)
141+
statedb.SetState(common.RelayerRegistrationSMC, locHashDeposit, common.BigToHash(balance))
142+
statedb.SubBalance(common.RelayerRegistrationSMC, fee)
143143
log.Debug("ApplyXDCXMatchedTransaction settle balance: SubRelayerFee AFTER", "relayer", relayer.String(), "balance", balance)
144144
return nil
145145
}
@@ -151,7 +151,7 @@ func CheckRelayerFee(relayer common.Address, fee *big.Int, statedb *state.StateD
151151

152152
locBigDeposit := new(big.Int).SetUint64(uint64(0)).Add(locBig, RelayerStructMappingSlot["_deposit"])
153153
locHashDeposit := common.BigToHash(locBigDeposit)
154-
balance := statedb.GetState(common.HexToAddress(common.RelayerRegistrationSMC), locHashDeposit).Big()
154+
balance := statedb.GetState(common.RelayerRegistrationSMC, locHashDeposit).Big()
155155
if new(big.Int).Sub(balance, fee).Cmp(new(big.Int).Mul(common.BasePrice, common.RelayerLockedFund)) < 0 {
156156
return errors.Errorf("relayer %s isn't enough XDC fee : balance %d , fee : %d ", relayer.Hex(), balance.Uint64(), fee.Uint64())
157157
}
@@ -295,7 +295,7 @@ func CheckSubRelayerFee(relayer common.Address, fee *big.Int, statedb *state.Sta
295295
locBig := GetLocMappingAtKey(relayer.Hash(), slot)
296296
locBigDeposit := new(big.Int).SetUint64(uint64(0)).Add(locBig, RelayerStructMappingSlot["_deposit"])
297297
locHashDeposit := common.BigToHash(locBigDeposit)
298-
balance = statedb.GetState(common.HexToAddress(common.RelayerRegistrationSMC), locHashDeposit).Big()
298+
balance = statedb.GetState(common.RelayerRegistrationSMC, locHashDeposit).Big()
299299
}
300300
log.Debug("CheckSubRelayerFee settle balance: SubRelayerFee ", "relayer", relayer.String(), "balance", balance, "fee", fee)
301301
if balance.Cmp(fee) < 0 {
@@ -343,6 +343,6 @@ func SetSubRelayerFee(relayer common.Address, balance *big.Int, fee *big.Int, st
343343
locBig := GetLocMappingAtKey(relayer.Hash(), slot)
344344
locBigDeposit := new(big.Int).SetUint64(uint64(0)).Add(locBig, RelayerStructMappingSlot["_deposit"])
345345
locHashDeposit := common.BigToHash(locBigDeposit)
346-
statedb.SetState(common.HexToAddress(common.RelayerRegistrationSMC), locHashDeposit, common.BigToHash(balance))
347-
statedb.SubBalance(common.HexToAddress(common.RelayerRegistrationSMC), fee)
346+
statedb.SetState(common.RelayerRegistrationSMC, locHashDeposit, common.BigToHash(balance))
347+
statedb.SubBalance(common.RelayerRegistrationSMC, fee)
348348
}

XDCx/tradingstate/state_lendingbook.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"math/big"
2424

2525
"github.com/XinFinOrg/XDPoSChain/common"
26+
"github.com/XinFinOrg/XDPoSChain/core/types"
2627
"github.com/XinFinOrg/XDPoSChain/rlp"
2728
"github.com/XinFinOrg/XDPoSChain/trie"
2829
)
@@ -80,7 +81,7 @@ func (s *stateLendingBook) getTrie(db Database) Trie {
8081
var err error
8182
s.trie, err = db.OpenStorageTrie(s.lendingBook, s.data.Root)
8283
if err != nil {
83-
s.trie, _ = db.OpenStorageTrie(s.price, EmptyHash)
84+
s.trie, _ = db.OpenStorageTrie(s.price, types.EmptyRootHash)
8485
s.setError(fmt.Errorf("can't create storage trie: %v", err))
8586
}
8687
}

XDCx/tradingstate/state_liquidationprice.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"math/big"
2323

2424
"github.com/XinFinOrg/XDPoSChain/common"
25+
"github.com/XinFinOrg/XDPoSChain/core/types"
2526
"github.com/XinFinOrg/XDPoSChain/log"
2627
"github.com/XinFinOrg/XDPoSChain/rlp"
2728
"github.com/XinFinOrg/XDPoSChain/trie"
@@ -103,7 +104,7 @@ func (l *liquidationPriceState) getTrie(db Database) Trie {
103104
var err error
104105
l.trie, err = db.OpenStorageTrie(l.liquidationPrice, l.data.Root)
105106
if err != nil {
106-
l.trie, _ = db.OpenStorageTrie(l.liquidationPrice, EmptyHash)
107+
l.trie, _ = db.OpenStorageTrie(l.liquidationPrice, types.EmptyRootHash)
107108
l.setError(fmt.Errorf("can't create storage trie: %v", err))
108109
}
109110
}

XDCx/tradingstate/state_orderList.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"math/big"
2424

2525
"github.com/XinFinOrg/XDPoSChain/common"
26+
"github.com/XinFinOrg/XDPoSChain/core/types"
2627
"github.com/XinFinOrg/XDPoSChain/rlp"
2728
)
2829

@@ -91,7 +92,7 @@ func (c *stateOrderList) getTrie(db Database) Trie {
9192
var err error
9293
c.trie, err = db.OpenStorageTrie(c.price, c.data.Root)
9394
if err != nil {
94-
c.trie, _ = db.OpenStorageTrie(c.price, EmptyHash)
95+
c.trie, _ = db.OpenStorageTrie(c.price, types.EmptyRootHash)
9596
c.setError(fmt.Errorf("can't create storage trie: %v", err))
9697
}
9798
}

XDCx/tradingstate/state_orderbook.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"math/big"
2323

2424
"github.com/XinFinOrg/XDPoSChain/common"
25+
"github.com/XinFinOrg/XDPoSChain/core/types"
2526
"github.com/XinFinOrg/XDPoSChain/log"
2627
"github.com/XinFinOrg/XDPoSChain/rlp"
2728
)
@@ -135,7 +136,7 @@ func (te *tradingExchanges) getAsksTrie(db Database) Trie {
135136
var err error
136137
te.asksTrie, err = db.OpenStorageTrie(te.orderBookHash, te.data.AskRoot)
137138
if err != nil {
138-
te.asksTrie, _ = db.OpenStorageTrie(te.orderBookHash, EmptyHash)
139+
te.asksTrie, _ = db.OpenStorageTrie(te.orderBookHash, types.EmptyRootHash)
139140
te.setError(fmt.Errorf("can't create asks trie: %v", err))
140141
}
141142
}
@@ -147,7 +148,7 @@ func (te *tradingExchanges) getOrdersTrie(db Database) Trie {
147148
var err error
148149
te.ordersTrie, err = db.OpenStorageTrie(te.orderBookHash, te.data.OrderRoot)
149150
if err != nil {
150-
te.ordersTrie, _ = db.OpenStorageTrie(te.orderBookHash, EmptyHash)
151+
te.ordersTrie, _ = db.OpenStorageTrie(te.orderBookHash, types.EmptyRootHash)
151152
te.setError(fmt.Errorf("can't create asks trie: %v", err))
152153
}
153154
}
@@ -265,7 +266,7 @@ func (te *tradingExchanges) getBidsTrie(db Database) Trie {
265266
var err error
266267
te.bidsTrie, err = db.OpenStorageTrie(te.orderBookHash, te.data.BidRoot)
267268
if err != nil {
268-
te.bidsTrie, _ = db.OpenStorageTrie(te.orderBookHash, EmptyHash)
269+
te.bidsTrie, _ = db.OpenStorageTrie(te.orderBookHash, types.EmptyRootHash)
269270
te.setError(fmt.Errorf("can't create bids trie: %v", err))
270271
}
271272
}
@@ -636,7 +637,7 @@ func (t *tradingExchanges) getLiquidationPriceTrie(db Database) Trie {
636637
var err error
637638
t.liquidationPriceTrie, err = db.OpenStorageTrie(t.orderBookHash, t.data.LiquidationPriceRoot)
638639
if err != nil {
639-
t.liquidationPriceTrie, _ = db.OpenStorageTrie(t.orderBookHash, EmptyHash)
640+
t.liquidationPriceTrie, _ = db.OpenStorageTrie(t.orderBookHash, types.EmptyRootHash)
640641
t.setError(fmt.Errorf("can't create liquidation liquidationPrice trie: %v", err))
641642
}
642643
}

XDCx/tradingstate/statedb_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424

2525
"github.com/XinFinOrg/XDPoSChain/common"
2626
"github.com/XinFinOrg/XDPoSChain/core/rawdb"
27+
"github.com/XinFinOrg/XDPoSChain/core/types"
2728
)
2829

2930
func TestEchangeStates(t *testing.T) {
@@ -42,7 +43,7 @@ func TestEchangeStates(t *testing.T) {
4243
// Create an empty statedb database
4344
db := rawdb.NewMemoryDatabase()
4445
stateCache := NewDatabase(db)
45-
statedb, _ := New(common.Hash{}, stateCache)
46+
statedb, _ := New(types.EmptyRootHash, stateCache)
4647

4748
// Update it with some exchanges
4849
for i := 0; i < numberOrder; i++ {
@@ -172,7 +173,7 @@ func TestRevertStates(t *testing.T) {
172173
// Create an empty statedb database
173174
db := rawdb.NewMemoryDatabase()
174175
stateCache := NewDatabase(db)
175-
statedb, _ := New(common.Hash{}, stateCache)
176+
statedb, _ := New(types.EmptyRootHash, stateCache)
176177

177178
// Update it with some exchanges
178179
for i := 0; i < numberOrder; i++ {
@@ -277,7 +278,7 @@ func TestDumpState(t *testing.T) {
277278
// Create an empty statedb database
278279
db := rawdb.NewMemoryDatabase()
279280
stateCache := NewDatabase(db)
280-
statedb, _ := New(common.Hash{}, stateCache)
281+
statedb, _ := New(types.EmptyRootHash, stateCache)
281282

282283
for i := 0; i < len(orderItems); i++ {
283284
orderIdHash := common.BigToHash(new(big.Int).SetUint64(orderItems[i].OrderID))

0 commit comments

Comments
 (0)