@@ -53,6 +53,9 @@ func ProposeText(
53
53
// votingMax does not include quantities delegated through Launchpad.
54
54
votingMax, possibleAddressWithWeight := gs.GetPossibleVotingAddressWithWeight(now - config.VotingWeightSmoothingDuration)
55
55
56
+ maxVotingWeight := u256.NewUint(votingMax)
57
+ quorumAmount := maxVotingWeight.Uint64() * config.Quorum / 100
58
+
56
59
proposal := ProposalInfo{
57
60
Proposer: proposer,
58
61
ProposalType: Text,
@@ -63,10 +66,10 @@ func ProposeText(
63
66
},
64
67
Yea: u256.Zero(),
65
68
Nay: u256.Zero(),
66
- MaxVotingWeight: u256.NewUint(votingMax) ,
69
+ MaxVotingWeight: maxVotingWeight ,
67
70
PossibleAddressWithWeight: possibleAddressWithWeight,
68
71
ConfigVersion: uint64(configVersions.Size()), // use latest config version
69
- QuorumAmount: xgns.VotingSupply() * config.Quorum / 100 ,
72
+ QuorumAmount: quorumAmount ,
70
73
Title: title,
71
74
Description: description,
72
75
}
@@ -83,10 +86,10 @@ func ProposeText(
83
86
"title", title,
84
87
"description", description,
85
88
"proposalId", formatUint64(proposalId),
89
+ "quorumAmount", formatUint64(proposal.QuorumAmount),
86
90
"maxVotingWeight", proposal.MaxVotingWeight.ToString(),
87
- "createdAt", formatUint64(proposal.State.CreatedAt),
88
91
"configVersion", formatUint64(proposal.ConfigVersion),
89
- "quorumAmount ", formatUint64(proposal.QuorumAmount ),
92
+ "createdAt ", formatUint64(proposal.State.CreatedAt ),
90
93
)
91
94
return proposalId
92
95
}
@@ -120,6 +123,9 @@ func ProposeCommunityPoolSpend(
120
123
now := uint64(time.Now().Unix())
121
124
votingMax, possibleAddressWithWeight := gs.GetPossibleVotingAddressWithWeight(now - config.VotingWeightSmoothingDuration)
122
125
126
+ maxVotingWeight := u256.NewUint(votingMax)
127
+ quorumAmount := maxVotingWeight.Uint64() * config.Quorum / 100
128
+
123
129
proposal := ProposalInfo{
124
130
Proposer: proposer,
125
131
ProposalType: CommunityPoolSpend,
@@ -130,10 +136,10 @@ func ProposeCommunityPoolSpend(
130
136
},
131
137
Yea: u256.Zero(),
132
138
Nay: u256.Zero(),
133
- MaxVotingWeight: u256.NewUint(votingMax) ,
139
+ MaxVotingWeight: maxVotingWeight ,
134
140
PossibleAddressWithWeight: possibleAddressWithWeight,
135
141
ConfigVersion: uint64(configVersions.Size()),
136
- QuorumAmount: xgns.VotingSupply() * config.Quorum / 100 ,
142
+ QuorumAmount: quorumAmount ,
137
143
Title: title,
138
144
Description: description,
139
145
CommunityPoolSpend: CommunityPoolSpendInfo{
@@ -147,17 +153,21 @@ func ProposeCommunityPoolSpend(
147
153
proposals.Set(formatUint64(proposalId), proposal)
148
154
latestProposalByProposer.Set(proposer.String(), proposalId)
149
155
150
- prevAddr, prevRealm := getPrev()
156
+ prevAddr, prevPkgPath := getPrev()
151
157
std.Emit(
152
158
"ProposeCommunityPoolSpend",
153
159
"prevAddr", prevAddr,
154
- "prevRealm", prevRealm ,
160
+ "prevRealm", prevPkgPath ,
155
161
"title", title,
156
162
"description", description,
157
163
"to", to.String(),
158
164
"tokenPath", tokenPath,
159
165
"amount", formatUint64(amount),
160
- "internal_proposalId", formatUint64(proposalId),
166
+ "proposalId", formatUint64(proposalId),
167
+ "quorumAmount", formatUint64(proposal.QuorumAmount),
168
+ "maxVotingWeight", proposal.MaxVotingWeight.ToString(),
169
+ "configVersion", formatUint64(proposal.ConfigVersion),
170
+ "createdAt", formatUint64(proposal.State.CreatedAt),
161
171
)
162
172
163
173
return proposalId
@@ -207,6 +217,9 @@ func ProposeParameterChange(
207
217
now := uint64(time.Now().Unix())
208
218
votingMax, possibleAddressWithWeight := gs.GetPossibleVotingAddressWithWeight(now - config.VotingWeightSmoothingDuration)
209
219
220
+ maxVotingWeight := u256.NewUint(votingMax)
221
+ quorumAmount := maxVotingWeight.Uint64() * config.Quorum / 100
222
+
210
223
proposal := ProposalInfo{
211
224
Proposer: proposer,
212
225
ProposalType: ParameterChange,
@@ -217,10 +230,10 @@ func ProposeParameterChange(
217
230
},
218
231
Yea: u256.Zero(),
219
232
Nay: u256.Zero(),
220
- MaxVotingWeight: u256.NewUint(votingMax) ,
233
+ MaxVotingWeight: maxVotingWeight ,
221
234
PossibleAddressWithWeight: possibleAddressWithWeight,
222
235
ConfigVersion: uint64(configVersions.Size()),
223
- QuorumAmount: xgns.VotingSupply() * config.Quorum / 100 ,
236
+ QuorumAmount: quorumAmount ,
224
237
Title: title,
225
238
Description: description,
226
239
Execution: ExecutionInfo{
@@ -233,16 +246,20 @@ func ProposeParameterChange(
233
246
proposals.Set(formatUint64(proposalId), proposal)
234
247
latestProposalByProposer.Set(proposer.String(), proposalId)
235
248
236
- prevAddr, prevRealm := getPrev()
249
+ prevAddr, prevPkgPath := getPrev()
237
250
std.Emit(
238
251
"ProposeParameterChange",
239
252
"prevAddr", prevAddr,
240
- "prevRealm", prevRealm ,
253
+ "prevRealm", prevPkgPath ,
241
254
"title", title,
242
255
"description", description,
243
256
"numToExecute", formatUint64(numToExecute),
244
257
"executions", executions,
245
- "internal_proposalId", formatUint64(proposalId),
258
+ "proposalId", formatUint64(proposalId),
259
+ "quorumAmount", formatUint64(proposal.QuorumAmount),
260
+ "maxVotingWeight", proposal.MaxVotingWeight.ToString(),
261
+ "configVersion", formatUint64(proposal.ConfigVersion),
262
+ "createdAt", formatUint64(proposal.State.CreatedAt),
246
263
)
247
264
248
265
return proposalId
0 commit comments