Skip to content

Commit 1b5dfb3

Browse files
committed
Fix golint warning for gossip state package
Fixed code comments to remove golint warnings. Change-Id: If732f1ce7067e304df47d112edb4761faaa9800e Signed-off-by: Artem Barger <[email protected]>
1 parent ede30a4 commit 1b5dfb3

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

gossip/state/metastate.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@ import (
2121
"encoding/binary"
2222
)
2323

24-
// Metadata information to store the information about current
24+
// NodeMetastate information to store the information about current
2525
// height of the ledger (last accepted block sequence number).
2626
type NodeMetastate struct {
2727

2828
// Actual ledger height
2929
LedgerHeight uint64
3030
}
3131

32-
// Create new meta data with given ledger height148.69
32+
// NewNodeMetastate creates new meta data with given ledger height148.69
3333
func NewNodeMetastate(height uint64) *NodeMetastate {
3434
return &NodeMetastate{height}
3535
}
3636

37-
// Decodes meta state into byte array for serialization
37+
// Bytes decodes meta state into byte array for serialization
3838
func (n *NodeMetastate) Bytes() ([]byte, error) {
3939
buffer := new(bytes.Buffer)
4040
// Explicitly specify byte order for write into the buffer
@@ -47,7 +47,7 @@ func (n *NodeMetastate) Bytes() ([]byte, error) {
4747
return buffer.Bytes(), nil
4848
}
4949

50-
// Get ledger height from the state
50+
// Height returns ledger height from the state
5151
func (n *NodeMetastate) Height() uint64 {
5252
return n.LedgerHeight
5353
}
@@ -57,7 +57,7 @@ func (n *NodeMetastate) Update(height uint64) {
5757
n.LedgerHeight = height
5858
}
5959

60-
// Encode from byte array into meta data structure
60+
// FromBytes - encode from byte array into meta data structure
6161
func FromBytes(buf []byte) (*NodeMetastate, error) {
6262
state := NodeMetastate{}
6363
reader := bytes.NewReader(buf)

gossip/state/state.go

+3
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,8 @@ func (s *GossipStateProviderImpl) requestBlocksInRange(start uint64, end uint64)
367367
}, peer)
368368
}
369369

370+
371+
// GetBlock return ledger block given its sequence number as a parameter
370372
func (s *GossipStateProviderImpl) GetBlock(index uint64) *common.Block {
371373
// Try to read missing block from the ledger, should return no nil with
372374
// content including at least one block
@@ -377,6 +379,7 @@ func (s *GossipStateProviderImpl) GetBlock(index uint64) *common.Block {
377379
return nil
378380
}
379381

382+
// AddPayload add new payload into state
380383
func (s *GossipStateProviderImpl) AddPayload(payload *proto.Payload) error {
381384
return s.payloads.Push(payload)
382385
}

0 commit comments

Comments
 (0)