/
storable.go
44 lines (35 loc) · 1.13 KB
/
storable.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
package governance
import (
"fmt"
"github.com/sirupsen/logrus"
"github.com/barnbridge/meminero/ethtypes"
"github.com/barnbridge/meminero/types"
)
type Storable struct {
block *types.Block
logger *logrus.Entry
Processed struct {
proposals []Proposal
proposalsActions []ProposalActions
abrogationProposals []ethtypes.GovernanceAbrogationProposalStartedEvent
abrogationProposalsDescription map[string]string
proposalEvents []ProposalEvent
votes []ethtypes.GovernanceVoteEvent
canceledVotes []ethtypes.GovernanceVoteCanceledEvent
abrogationVotes []ethtypes.GovernanceAbrogationProposalVoteEvent
abrogationCanceledVotes []ethtypes.GovernanceAbrogationProposalVoteCancelledEvent
}
}
const storableID = "dao.governance"
func New(block *types.Block) *Storable {
return &Storable{
block: block,
logger: logrus.WithField("module", fmt.Sprintf("storable(%s)", storableID)),
}
}
func (s *Storable) ID() string {
return storableID
}
func (s *Storable) Result() interface{} {
return s.Processed
}