Cherry-picked #6567: state/types: refactor makeBlock, makeBlocks and makeTxs (#6567)

This commit is contained in:
JayT106
2022-07-27 20:07:02 +02:00
committed by Sergio Mena
parent 58effdd8b3
commit 51f3118bd6
11 changed files with 128 additions and 144 deletions
+16
View File
@@ -0,0 +1,16 @@
package factory
import "github.com/tendermint/tendermint/types"
// MakeTxs is a helper function to generate mock transactions by given the block height
// and the transaction numbers.
func MakeTxs(height int64, num int) (txs []types.Tx) {
for i := 0; i < num; i++ {
txs = append(txs, types.Tx([]byte{byte(height), byte(i)}))
}
return txs
}
func MakeTenTxs(height int64) (txs []types.Tx) {
return MakeTxs(height, 10)
}