uint64 height (Refs #911)

This commit is contained in:
Anton Kaliaev
2017-11-30 13:08:38 -06:00
committed by Ethan Buchman
parent b2489b4318
commit b3492356e6
64 changed files with 296 additions and 270 deletions

View File

@ -43,9 +43,9 @@ func TestApplyBlock(t *testing.T) {
//----------------------------------------------------------------------------
// make some bogus txs
func makeTxs(blockNum int) (txs []types.Tx) {
func makeTxs(height uint64) (txs []types.Tx) {
for i := 0; i < nTxsPerBlock; i++ {
txs = append(txs, types.Tx([]byte{byte(blockNum), byte(i)}))
txs = append(txs, types.Tx([]byte{byte(height), byte(i)}))
}
return txs
}
@ -61,12 +61,12 @@ func state() *State {
return s
}
func makeBlock(num int, state *State) *types.Block {
func makeBlock(height uint64, state *State) *types.Block {
prevHash := state.LastBlockID.Hash
prevParts := types.PartSetHeader{}
valHash := state.Validators.Hash()
prevBlockID := types.BlockID{prevHash, prevParts}
block, _ := types.MakeBlock(num, chainID, makeTxs(num), new(types.Commit),
block, _ := types.MakeBlock(height, chainID, makeTxs(height), new(types.Commit),
prevBlockID, valHash, state.AppHash, testPartSize)
return block
}