OSDN Git Service
(root)
/
bytom
/
vapor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
clean up
[bytom/vapor.git]
/
test
/
protocol_test.go
diff --git
a/test/protocol_test.go
b/test/protocol_test.go
index
b02a511
..
7be6689
100644
(file)
--- a/
test/protocol_test.go
+++ b/
test/protocol_test.go
@@
-6,9
+6,8
@@
import (
"os"
"testing"
"os"
"testing"
- dbm "github.com/tendermint/tmlibs/db"
-
"github.com/vapor/consensus"
"github.com/vapor/consensus"
+ dbm "github.com/vapor/database/leveldb"
"github.com/vapor/protocol/bc/types"
"github.com/vapor/protocol/vm"
)
"github.com/vapor/protocol/bc/types"
"github.com/vapor/protocol/vm"
)
@@
-108,7
+107,7
@@
func TestDoubleSpentInDiffBlock(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if err != nil {
t.Fatal(err)
}
- if err := AppendBlocks(chain, consensus.CoinbasePendingBlockNumber+1); err != nil {
+ if err := AppendBlocks(chain, consensus.
ActiveNetParams.
CoinbasePendingBlockNumber+1); err != nil {
t.Fatal(err)
}
t.Fatal(err)
}
@@
-123,7
+122,7
@@
func TestDoubleSpentInDiffBlock(t *testing.T) {
}
newBlock, err := NewBlock(chain, []*types.Tx{tx}, []byte{byte(vm.OP_TRUE)})
}
newBlock, err := NewBlock(chain, []*types.Tx{tx}, []byte{byte(vm.OP_TRUE)})
-
err = SolveAndUpdate(chain,
newBlock)
+
_, err = chain.ProcessBlock(
newBlock)
if err != nil {
t.Fatal(err)
}
if err != nil {
t.Fatal(err)
}
@@
-149,7
+148,7
@@
func TestDoubleSpentInSameBlock(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if err != nil {
t.Fatal(err)
}
- if err := AppendBlocks(chain, consensus.CoinbasePendingBlockNumber+1); err != nil {
+ if err := AppendBlocks(chain, consensus.
ActiveNetParams.
CoinbasePendingBlockNumber+1); err != nil {
t.Fatal(err)
}
t.Fatal(err)
}
@@
-190,7
+189,7
@@
func TestDoubleSpentInSameBlock(t *testing.T) {
t.Fatal(err)
}
t.Fatal(err)
}
- if
err := SolveAndUpdate(chain,
block); err == nil {
+ if
_, err := chain.ProcessBlock(
block); err == nil {
t.Fatalf("process double spent tx success")
}
}
t.Fatalf("process double spent tx success")
}
}
@@
-202,7
+201,7
@@
func TestTxPoolDependencyTx(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if err != nil {
t.Fatal(err)
}
- if err := AppendBlocks(chain, consensus.CoinbasePendingBlockNumber+1); err != nil {
+ if err := AppendBlocks(chain, consensus.
ActiveNetParams.
CoinbasePendingBlockNumber+1); err != nil {
t.Fatal(err)
}
t.Fatal(err)
}
@@
-243,7
+242,7
@@
func TestTxPoolDependencyTx(t *testing.T) {
t.Fatal(err)
}
t.Fatal(err)
}
- if
err := SolveAndUpdate(chain,
block); err != nil {
+ if
_, err := chain.ProcessBlock(
block); err != nil {
t.Fatal("process dependency tx failed")
}
}
t.Fatal("process dependency tx failed")
}
}
@@
-257,7
+256,7
@@
func TestAddInvalidTxToTxPool(t *testing.T) {
t.Fatal(err)
}
t.Fatal(err)
}
- if err := AppendBlocks(chain, consensus.CoinbasePendingBlockNumber+1); err != nil {
+ if err := AppendBlocks(chain, consensus.
ActiveNetParams.
CoinbasePendingBlockNumber+1); err != nil {
t.Fatal(err)
}
t.Fatal(err)
}