Skip to content

Commit 570d506

Browse files
authored
fix: add nouns proposal options (#591)
1 parent 7cbf1a9 commit 570d506

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ require (
6363
github.com/mitchellh/mapstructure v1.5.0
6464
github.com/redis/rueidis v1.0.45
6565
github.com/redis/rueidis/rueidiscompat v1.0.45
66-
github.com/rss3-network/protocol-go v0.5.12
66+
github.com/rss3-network/protocol-go v0.5.13
6767
github.com/spf13/afero v1.11.0
6868
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
6969
github.com/tidwall/sjson v1.2.5

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,8 @@ github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU
390390
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
391391
github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik=
392392
github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
393-
github.com/rss3-network/protocol-go v0.5.12 h1:hDqTa3Ft0PDM6/IhXGC0kOY4Ogig7TuM3UvQ7U9cM2A=
394-
github.com/rss3-network/protocol-go v0.5.12/go.mod h1:npcyduWt86uVbIi77xQaYk8eqltI9XNjk1FMGpjyIq0=
393+
github.com/rss3-network/protocol-go v0.5.13 h1:/rUfdGfWyg9p1NnwCJEkGYIv/eLBvQlL/c91IFCIbNc=
394+
github.com/rss3-network/protocol-go v0.5.13/go.mod h1:npcyduWt86uVbIi77xQaYk8eqltI9XNjk1FMGpjyIq0=
395395
github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww=
396396
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
397397
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=

internal/engine/worker/decentralized/contract/nouns/worker.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@ func (w *worker) Transform(ctx context.Context, task engine.Task) (*activityx.Ac
134134
activity.Actions = append(activity.Actions, actions...)
135135
}
136136

137-
// zap.L().Info("Processing task", zap.Any("task", ethereumTask))
138-
139137
return activity, nil
140138
}
141139

@@ -287,9 +285,13 @@ func (w *worker) buildGovernanceProposalAction(from, to common.Address, id *big.
287285
From: from.String(),
288286
To: to.String(),
289287
Metadata: metadata.GovernanceProposal{
290-
ID: id.String(),
291-
Body: description,
292-
Options: []string{},
288+
ID: id.String(),
289+
Body: description,
290+
Options: []string{
291+
metadata.ActionGovernanceVoteFor.String(),
292+
metadata.ActionGovernanceVoteAgainst.String(),
293+
metadata.ActionGovernanceVoteAbstain.String(),
294+
},
293295
StartBlock: decimal.NewFromBigInt(start, 0).String(),
294296
EndBlock: decimal.NewFromBigInt(end, 0).String(),
295297
},

internal/engine/worker/decentralized/contract/nouns/worker_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,11 @@ func TestWorker_Ethereum(t *testing.T) {
381381
Body: "# Increase Voting Delay and Voting Period\n\nAs the number of nouners and nouns sub-communities increase, we will see more proposals appear on-chain without prior off-chain coordination. This is a proposal to increase the ‘Voting Delay’ to 4 days, and the ‘Voting Period’ to 5 days, so that nouners have more time to diligence proposals and to decide how they will vote.",
382382
StartBlock: "14597722",
383383
EndBlock: "14617432",
384-
Options: []string{},
385-
Link: "",
384+
Options: []string{
385+
metadata.ActionGovernanceVoteFor.String(),
386+
metadata.ActionGovernanceVoteAgainst.String(),
387+
metadata.ActionGovernanceVoteAbstain.String(),
388+
},
386389
},
387390
},
388391
},

0 commit comments

Comments
 (0)