Skip to content

Commit

Permalink
test: fix block test
Browse files Browse the repository at this point in the history
  • Loading branch information
aeddi committed Nov 20, 2024
1 parent df75b32 commit c34bfd5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tm2/pkg/bft/types/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ func (b *Block) ValidateBasic() error {
)
}

// TODO: fix tests so we can do this
/*if b.TotalTxs < b.NumTxs {
if b.TotalTxs < b.NumTxs {
return fmt.Errorf("Header.TotalTxs (%d) is less than Header.NumTxs (%d)", b.TotalTxs, b.NumTxs)
}*/
}

Check warning on line 58 in tm2/pkg/bft/types/block.go

View check run for this annotation

Codecov / codecov/patch

tm2/pkg/bft/types/block.go#L58

Added line #L58 was not covered by tests
if b.TotalTxs < 0 {
return errors.New("Negative Header.TotalTxs")
}
Expand Down Expand Up @@ -259,8 +258,9 @@ func (h *Header) GetTime() time.Time { return h.Time }
func MakeBlock(height int64, txs []Tx, lastCommit *Commit) *Block {
block := &Block{
Header: Header{
Height: height,
NumTxs: int64(len(txs)),
Height: height,
NumTxs: int64(len(txs)),
TotalTxs: int64(len(txs)),
},
Data: Data{
Txs: txs,
Expand Down

0 comments on commit c34bfd5

Please sign in to comment.