OSDN Git Service

Merge branch 'dev' into dev-verify
[bytom/bytom.git] / test / tx_test.go
index cf8f04d..c773454 100644 (file)
@@ -83,7 +83,7 @@ func (cfg *TxTestConfig) Run() error {
                }
 
                gasOnlyTx := false
-               if err != nil && status.GasVaild {
+               if err != nil && status.GasValid {
                        gasOnlyTx = true
                }
                if gasOnlyTx != t.GasOnly {
@@ -172,6 +172,10 @@ func TestCoinbaseMature(t *testing.T) {
        chain, _, _, _ := MockChain(db)
 
        defaultCtrlProg := []byte{byte(vm.OP_TRUE)}
+       if err := AppendBlocks(chain, 1); err != nil {
+               t.Fatal(err)
+       }
+
        height := chain.BestBlockHeight()
        block, err := chain.GetBlockByHeight(height)
        if err != nil {
@@ -248,8 +252,7 @@ func TestCoinbaseTx(t *testing.T) {
                        t.Fatal(err)
                }
 
-               err = SolveAndUpdate(chain, block)
-               if err == nil {
+               if err := SolveAndUpdate(chain, block); err == nil {
                        t.Fatalf("invalid coinbase tx validate success")
                }
        }