"testing"
"time"
- "github.com/vapor/blockchain/txbuilder"
- "github.com/vapor/consensus"
- "github.com/vapor/protocol/bc"
- "github.com/vapor/testutil"
+ "github.com/bytom/vapor/blockchain/txbuilder"
+ "github.com/bytom/vapor/consensus"
+ "github.com/bytom/vapor/protocol/bc"
+ "github.com/bytom/vapor/testutil"
)
func TestMergeSpendAction(t *testing.T) {
}
}
-func TestCalcMergeGas(t *testing.T) {
- chainTxUtxoNum = 10
- cases := []struct {
- utxoNum int
- gas uint64
- }{
- {
- utxoNum: 0,
- gas: 0,
- },
- {
- utxoNum: 1,
- gas: 0,
- },
- {
- utxoNum: 9,
- gas: chainTxMergeGas,
- },
- {
- utxoNum: 10,
- gas: chainTxMergeGas,
- },
- {
- utxoNum: 11,
- gas: chainTxMergeGas * 2,
- },
- {
- utxoNum: 20,
- gas: chainTxMergeGas * 3,
- },
- {
- utxoNum: 21,
- gas: chainTxMergeGas * 3,
- },
- {
- utxoNum: 74,
- gas: chainTxMergeGas * 9,
- },
- }
-
- for i, c := range cases {
- gas := calcMergeGas(c.utxoNum)
- if gas != c.gas {
- t.Fatalf("case %d got %d want %d", i, gas, c.gas)
- }
- }
-}
-
func TestReserveBtmUtxoChain(t *testing.T) {
chainTxUtxoNum = 3
+ chainTxMergeGas = uint64(10000000)
+
utxos := []*UTXO{}
m := mockAccountManager(t)
for i := uint64(1); i <= 20; i++ {