@@ -21,20 +21,20 @@ import (
21
21
"encoding/binary"
22
22
)
23
23
24
- // Metadata information to store the information about current
24
+ // NodeMetastate information to store the information about current
25
25
// height of the ledger (last accepted block sequence number).
26
26
type NodeMetastate struct {
27
27
28
28
// Actual ledger height
29
29
LedgerHeight uint64
30
30
}
31
31
32
- // Create new meta data with given ledger height148.69
32
+ // NewNodeMetastate creates new meta data with given ledger height148.69
33
33
func NewNodeMetastate (height uint64 ) * NodeMetastate {
34
34
return & NodeMetastate {height }
35
35
}
36
36
37
- // Decodes meta state into byte array for serialization
37
+ // Bytes decodes meta state into byte array for serialization
38
38
func (n * NodeMetastate ) Bytes () ([]byte , error ) {
39
39
buffer := new (bytes.Buffer )
40
40
// Explicitly specify byte order for write into the buffer
@@ -47,7 +47,7 @@ func (n *NodeMetastate) Bytes() ([]byte, error) {
47
47
return buffer .Bytes (), nil
48
48
}
49
49
50
- // Get ledger height from the state
50
+ // Height returns ledger height from the state
51
51
func (n * NodeMetastate ) Height () uint64 {
52
52
return n .LedgerHeight
53
53
}
@@ -57,7 +57,7 @@ func (n *NodeMetastate) Update(height uint64) {
57
57
n .LedgerHeight = height
58
58
}
59
59
60
- // Encode from byte array into meta data structure
60
+ // FromBytes - encode from byte array into meta data structure
61
61
func FromBytes (buf []byte ) (* NodeMetastate , error ) {
62
62
state := NodeMetastate {}
63
63
reader := bytes .NewReader (buf )
0 commit comments