X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=protocol%2Fvalidation%2Ftx_test.go;h=484cfa2de1acb93b903ad08a60c5bdb328d937be;hb=bc213b29d91743bb9cb23c043f2856f47b34bb3e;hp=17664df3034271d6ced8ed6aa32a62a583bf3be0;hpb=73164af54a2587ba479b8b133274e3ecd0559a68;p=bytom%2Fvapor.git diff --git a/protocol/validation/tx_test.go b/protocol/validation/tx_test.go index 17664df3..484cfa2d 100644 --- a/protocol/validation/tx_test.go +++ b/protocol/validation/tx_test.go @@ -34,7 +34,7 @@ func TestGasStatus(t *testing.T) { BTMValue: 0, }, output: &GasState{ - GasLeft: 10000 / consensus.ActiveNetParams.VMGasRate, + GasLeft: 10000/consensus.ActiveNetParams.VMGasRate + consensus.ActiveNetParams.DefaultGasCredit, GasUsed: 0, BTMValue: 10000, }, @@ -66,7 +66,7 @@ func TestGasStatus(t *testing.T) { BTMValue: 0, }, output: &GasState{ - GasLeft: 200000, + GasLeft: 640000, GasUsed: 0, BTMValue: 80000000000, }, @@ -82,7 +82,7 @@ func TestGasStatus(t *testing.T) { BTMValue: 0, }, output: &GasState{ - GasLeft: 200000, + GasLeft: 640000, GasUsed: 0, BTMValue: math.MaxInt64, }, @@ -500,7 +500,7 @@ func TestTxValidation(t *testing.T) { err: bc.ErrMissingEntry, }, { - desc: "no gas spend input", + desc: "normal check with no gas spend input", f: func() { spendID := mux.Sources[len(mux.Sources)-1].Ref delete(tx.Entries, *spendID) @@ -508,7 +508,7 @@ func TestTxValidation(t *testing.T) { tx.GasInputIDs = nil vs.gasStatus.GasLeft = 0 }, - err: vm.ErrRunLimitExceeded, + err: nil, }, { desc: "no gas spend input, but set gas left, so it's ok",