-
Notifications
You must be signed in to change notification settings - Fork 651
/
state_summary.go
51 lines (40 loc) · 1.06 KB
/
state_summary.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright (C) 2019-2022, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package summary
import (
"github.com/ava-labs/avalanchego/ids"
)
var _ StateSummary = (*stateSummary)(nil)
type StateSummary interface {
ID() ids.ID
ForkHeight() uint64
BlockBytes() []byte
InnerSummaryBytes() []byte
Bytes() []byte
}
type stateSummary struct {
Height uint64 `serialize:"true"`
// TODO: Rather than storing the full block here - we should only store
// proposervm information. We would then modify the StateSummary
// interface to expose the required information to generate the full
// block.
Block []byte `serialize:"true"`
InnerSummary []byte `serialize:"true"`
id ids.ID
bytes []byte
}
func (s *stateSummary) ID() ids.ID {
return s.id
}
func (s *stateSummary) ForkHeight() uint64 {
return s.Height
}
func (s *stateSummary) BlockBytes() []byte {
return s.Block
}
func (s *stateSummary) InnerSummaryBytes() []byte {
return s.InnerSummary
}
func (s *stateSummary) Bytes() []byte {
return s.bytes
}