X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;ds=sidebyside;f=database%2Fstore_test.go;h=ea009eb6bd3c9c720de5699ac84327a9b5b5e3c3;hb=50a1191f042f2284da529ce08f9df0c3ee56e817;hp=e9d7527c0c98862647b9d5ccbe24b290914b3179;hpb=6f7fe6fd7442ddcec8ee959c09b6d45639ef045f;p=bytom%2Fvapor.git diff --git a/database/store_test.go b/database/store_test.go index e9d7527c..ea009eb6 100644 --- a/database/store_test.go +++ b/database/store_test.go @@ -169,10 +169,12 @@ func TestSaveChainStatus(t *testing.T) { bc.Hash{V0: 1, V1: 1, V2: 3, V3: 4}: &storage.UtxoEntry{Type: storage.NormalUTXOType, BlockHeight: 100, Spent: true}, bc.Hash{V0: 1, V1: 1, V2: 3, V3: 5}: &storage.UtxoEntry{Type: storage.CrosschainUTXOType, BlockHeight: 100, Spent: false}, bc.Hash{V0: 1, V1: 1, V2: 3, V3: 6}: &storage.UtxoEntry{Type: storage.CrosschainUTXOType, BlockHeight: 100, Spent: true}, + bc.Hash{V0: 1, V1: 3, V2: 3, V3: 7}: &storage.UtxoEntry{Type: storage.VoteUTXOType, BlockHeight: 100, Spent: false}, + bc.Hash{V0: 1, V1: 3, V2: 3, V3: 7}: &storage.UtxoEntry{Type: storage.VoteUTXOType, BlockHeight: 100, Spent: true}, }, } - if err := store.SaveChainStatus(node, node, view, map[uint64]*state.VoteResult{}); err != nil { + if err := store.SaveChainStatus(node, node, view, []*state.VoteResult{}); err != nil { t.Fatal(err) } @@ -188,6 +190,9 @@ func TestSaveChainStatus(t *testing.T) { if (utxo.Type == storage.CrosschainUTXOType) && (!utxo.Spent) { continue } + if (utxo.Type == storage.VoteUTXOType) && (utxo.Spent) { + continue + } gotUtxo, err := store.GetUtxo(&hash) if err != nil { @@ -216,7 +221,7 @@ func TestSaveBlock(t *testing.T) { } blockHash := block.Hash() - gotBlock, err := store.GetBlock(&blockHash) + gotBlock, err := store.GetBlock(&blockHash, block.Height) if err != nil { t.Fatal(err) }