Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
peterlimg committed Mar 30, 2021
1 parent 518a829 commit 595fd48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions code/go/0chain.net/chaincore/wallet/wallet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package wallet

import (
"0chain.net/core/logging"
"context"
"encoding/hex"
"fmt"
"io/ioutil"
Expand Down Expand Up @@ -82,14 +83,15 @@ func TestMPTWithWalletTxns(t *testing.T) {
lmpt := GetMPT(LEVEL, util.Sequence(2010))
saveWallets(lmpt, wallets)
verifyBalance(lmpt, wallets)
lmpt.SaveChanges(pmpt.GetNodeDB(), false)
ctx := context.TODO()
lmpt.SaveChanges(ctx, pmpt.GetNodeDB(), false)
(lmpt.GetNodeDB().(*util.LevelNodeDB)).RebaseCurrentDB(pmpt.GetNodeDB())

lmpt.ResetChangeCollector(nil)
generateTransactions(lmpt, wallets, transactions)
verifyBalance(lmpt, wallets)
ts := time.Now()
lmpt.SaveChanges(pmpt.GetNodeDB(), false)
lmpt.SaveChanges(ctx, pmpt.GetNodeDB(), false)
fmt.Printf("time taken to persist: %v\n", time.Since(ts))
}
}
Expand Down
2 changes: 1 addition & 1 deletion code/go/0chain.net/sharder/s_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestLatestRoundRequestHandler(t *testing.T) {

sc := sharder.GetSharderChain()
var num int64 = 1
sc.CurrentRound = num
sc.SetCurrentRound(num)
r := round.NewRound(num)
sc.AddRound(r)

Expand Down

0 comments on commit 595fd48

Please sign in to comment.