From e957f322c7ce17f7e2c7696f6af479816e40bcf9 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Thu, 30 Aug 2018 13:07:39 +0400 Subject: [PATCH] be more precise in comments --- types/block.go | 3 ++- types/block_test.go | 3 +-- types/tx.go | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/types/block.go b/types/block.go index 7d4551e5b..b13b3ac1d 100644 --- a/types/block.go +++ b/types/block.go @@ -17,7 +17,8 @@ const ( // MaxHeaderBytes is a maximum header size (including amino overhead). MaxHeaderBytes = 478 - // MaxAminoOverheadForBlock - amino overhead to encode the block. + // MaxAminoOverheadForBlock - maximum amino overhead to encode a block (up to + // MaxBlockSizeBytes in size). MaxAminoOverheadForBlock = 4 ) diff --git a/types/block_test.go b/types/block_test.go index 3ca1da616..4c74439c1 100644 --- a/types/block_test.go +++ b/types/block_test.go @@ -107,7 +107,6 @@ func TestBlockMakePartSet(t *testing.T) { func TestBlockMakePartSetWithEvidence(t *testing.T) { assert.Nil(t, (*Block)(nil).MakePartSet(2)) - txs := []Tx{Tx("foo"), Tx("bar")} lastID := makeBlockIDRandom() h := int64(3) @@ -118,7 +117,7 @@ func TestBlockMakePartSetWithEvidence(t *testing.T) { ev := NewMockGoodEvidence(h, 0, valSet.Validators[0].Address) evList := []Evidence{ev} - partSet := MakeBlock(h, txs, commit, evList).MakePartSet(1024) + partSet := MakeBlock(h, []Tx{Tx("Hello World")}, commit, evList).MakePartSet(1024) assert.NotNil(t, partSet) assert.Equal(t, 2, partSet.Total()) } diff --git a/types/tx.go b/types/tx.go index 53fd79c5b..896d7be07 100644 --- a/types/tx.go +++ b/types/tx.go @@ -12,7 +12,8 @@ import ( ) const ( - // MaxAminoOverheadForTx - amino overhead to encode a transaction. + // MaxAminoOverheadForTx - maximum amino overhead to encode a transaction + // (ranges from 1 to 4 bytes). MaxAminoOverheadForTx = 4 )