Skip to content

Commit

Permalink
build: fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
qianbin committed Feb 21, 2024
1 parent 27ba530 commit edfaa16
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
10 changes: 5 additions & 5 deletions builtin/energy/energy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestEnergy(t *testing.T) {

func TestInitialSupply(t *testing.T) {
db := muxdb.NewMem()
st := state.New(db, thor.Bytes32{}, 0, 0, 0)
st := state.New(db, trie.Root{})

eng := New(thor.BytesToAddress([]byte("eng")), st, 0)

Expand All @@ -65,7 +65,7 @@ func TestInitialSupply(t *testing.T) {

func TestInitialSupplyError(t *testing.T) {
db := muxdb.NewMem()
st := state.New(db, thor.Bytes32{}, 0, 0, 0)
st := state.New(db, trie.Root{})

eng := New(thor.BytesToAddress([]byte("a1")), st, 0)

Expand All @@ -79,7 +79,7 @@ func TestInitialSupplyError(t *testing.T) {

func TestTotalSupply(t *testing.T) {
db := muxdb.NewMem()
st := state.New(db, thor.Bytes32{}, 0, 0, 0)
st := state.New(db, trie.Root{})

eng := New(thor.BytesToAddress([]byte("eng")), st, 0)

Expand All @@ -93,7 +93,7 @@ func TestTotalSupply(t *testing.T) {

func TestTokenTotalSupply(t *testing.T) {
db := muxdb.NewMem()
st := state.New(db, thor.Bytes32{}, 0, 0, 0)
st := state.New(db, trie.Root{})

eng := New(thor.BytesToAddress([]byte("eng")), st, 0)

Expand All @@ -107,7 +107,7 @@ func TestTokenTotalSupply(t *testing.T) {

func TestTotalBurned(t *testing.T) {
db := muxdb.NewMem()
st := state.New(db, thor.Bytes32{}, 0, 0, 0)
st := state.New(db, trie.Root{})

eng := New(thor.BytesToAddress([]byte("eng")), st, 0)

Expand Down
3 changes: 2 additions & 1 deletion poa/candidates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/vechain/thor/v2/muxdb"
"github.com/vechain/thor/v2/state"
"github.com/vechain/thor/v2/thor"
"github.com/vechain/thor/v2/trie"
)

func generateCandidateList(candidateCount int) []*authority.Candidate {
Expand Down Expand Up @@ -104,7 +105,7 @@ func TestCopy(t *testing.T) {

func TestPick(t *testing.T) {
db := muxdb.NewMem()
state := state.New(db, thor.Bytes32{}, 0, 0, 0)
state := state.New(db, trie.Root{})

candidateList := generateCandidateList(5)

Expand Down
4 changes: 2 additions & 2 deletions txpool/tx_object_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ func SetupTest() (genesis.DevAccount, *chain.Repository, *block.Block, *state.St
repo := newChainRepo(db)
b0 := repo.GenesisBlock()
b1 := new(block.Builder).ParentID(b0.Header().ID()).GasLimit(10000000).TotalScore(100).Build()
repo.AddBlock(b1, nil, 0)
st := state.New(db, repo.GenesisBlock().Header().StateRoot(), 0, 0, 0)
repo.AddBlock(b1, nil, 0, false)
st := state.New(db, trie.Root{Hash: repo.GenesisBlock().Header().StateRoot()})

return acc, repo, b1, st
}
Expand Down

0 comments on commit edfaa16

Please sign in to comment.