OSDN Git Service

init for remove issue (#63)
[bytom/vapor.git] / netsync / tool_test.go
index d25e37a..69de67e 100644 (file)
@@ -4,7 +4,6 @@ import (
        "errors"
        "math/rand"
        "net"
-       "time"
 
        wire "github.com/tendermint/go-wire"
        "github.com/tendermint/tmlibs/flowrate"
@@ -170,14 +169,12 @@ func mockSync(blocks []*types.Block) *SyncManager {
 func mockTxs(txCount int) ([]*types.Tx, []*bc.Tx) {
        var txs []*types.Tx
        var bcTxs []*bc.Tx
-       for i := 0; i < txCount; i++ {
-               trueProg := mockControlProgram(60)
-               assetID := bc.ComputeAssetID(trueProg, 1, &bc.EmptyStringHash)
-               now := []byte(time.Now().String())
-               issuanceInp := types.NewIssuanceInput(now, 1, trueProg, nil, nil)
+       trueProg := mockControlProgram(60)
+       assetID := bc.AssetID{V0: 9999}
+       for i := uint64(0); i < uint64(txCount); i++ {
                tx := types.NewTx(types.TxData{
                        Version: 1,
-                       Inputs:  []*types.TxInput{issuanceInp},
+                       Inputs:  []*types.TxInput{types.NewSpendInput(nil, bc.Hash{V0: i + 1}, assetID, i, i, trueProg)},
                        Outputs: []*types.TxOutput{types.NewIntraChainOutput(assetID, 1, trueProg)},
                })
                txs = append(txs, tx)