forked from toorop/go-bitcoind
-
Notifications
You must be signed in to change notification settings - Fork 2
/
dao.go
106 lines (97 loc) · 4.67 KB
/
dao.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
package navcoind
import "encoding/json"
type Proposal struct {
Version uint32 `json:"version"`
Hash string `json:"hash"`
BlockHash string `json:"blockHash"`
Description string `json:"description"`
RequestedAmount string `json:"requestedAmount"`
NotPaidYet string `json:"notPaidYet"`
NotRequestedYet string `json:"notRequestedYet"`
UserPaidFee string `json:"userPaidFee"`
PaymentAddress string `json:"paymentAddress"`
ProposalDuration uint64 `json:"proposalDuration"`
ExpiresOn uint64 `json:"expiresOn"`
VotesYes uint `json:"votesYes"`
VotesAbs uint `json:"votesAbs"`
VotesNo uint `json:"votesNo"`
VotesExcluded uint `json:"excludedVotes"`
VotingCycle uint `json:"votingCycle"`
Status string `json:"status"`
State uint `json:"state"`
StateChangedOnBlock string `json:"stateChangedOnBlock,omitempty"`
PaymentRequests []PaymentRequest `json:"paymentRequests"`
}
type PaymentRequest struct {
Version uint32 `json:"version"`
Hash string `json:"hash"`
BlockHash string `json:"blockHash"`
ProposalHash string `json:"proposalHash,omitempty"`
Description string `json:"description"`
RequestedAmount string `json:"requestedAmount"`
VotesYes uint `json:"votesYes"`
VotesAbs uint `json:"votesAbs"`
VotesNo uint `json:"votesNo"`
VotesExcluded uint `json:"excludedVotes"`
VotingCycle uint `json:"votingCycle"`
Status string `json:"status"`
State uint `json:"state"`
StateChangedOnBlock string `json:"stateChangedOnBlock,omitempty"`
PaidOnBlock string `json:"paidOnBlock,omitempty"`
}
type CFundStats struct {
Consensus Consensus `json:"consensus"`
}
type Consensus struct {
BlocksPerVotingCycle uint `json:"blocksPerVotingCycle"`
MinSumVotesPerVotingCycle uint `json:"minSumVotesPerVotingCycle"`
MaxCountVotingCycleProposals uint `json:"maxCountVotingCycleProposals"`
MaxCountVotingCyclePaymentRequests uint `json:"maxCountVotingCyclePaymentRequests"`
VotesAcceptProposalPercentage uint `json:"votesAcceptProposalPercentage"`
VotesRejectProposalPercentage uint `json:"votesRejectProposalPercentage"`
VotesAcceptPaymentRequestPercentage uint `json:"votesAcceptPaymentRequestPercentage"`
VotesRejectPaymentRequestPercentage uint `json:"votesRejectPaymentRequestPercentage"`
ProposalMinimalFee float64 `json:"proposalMinimalFee"`
}
type ConsensusParameter struct {
Id int `json:"id"`
Description string `json:"desc"`
Type int `json:"type"`
Value int `json:"value"`
}
type Consultation struct {
Version uint32 `json:"version"`
Hash string `json:"hash"`
BlockHash string `json:"blockhash"`
Question string `json:"question"`
Support int `json:"support"`
Abstain int `json:"abstain"`
RawAnswers json.RawMessage `json:"answers"`
Answers []*Answer `json:"-"`
RangeAnswers map[string]int `json:"-"`
Min int `json:"min"`
Max int `json:"max"`
VotingCyclesFromCreation int `json:"votingCyclesFromCreation"`
VotingCycleForState Cycle `json:"votingCycleForState"`
Status string `json:"status"`
State int `json:"state"`
StateChangedOnBlock string `json:"stateChangedOnBlock"`
MapState map[int]string `json:"mapState"`
}
type Cycle struct {
Current int `json:"current"`
Max int `json:"max"`
}
type Answer struct {
Version uint32 `json:"version"`
Answer interface{} `json:"answer"`
Support int `json:"support"`
Votes int `json:"votes"`
Status string `json:"status"`
State int `json:"state"`
StateChangedOnBlock string `json:"stateChangedOnBlock"`
TxBlockHash string `json:"txblockhash"`
Parent string `json:"parent"`
Hash string `json:"hash"`
MapState map[int]string `json:"mapState"`
}