From ebe73fa28b5c1f320bb0a8a63f5c8228cb64ef72 Mon Sep 17 00:00:00 2001 From: antstalepresh <36045227+antstalepresh@users.noreply.github.com> Date: Mon, 2 Nov 2020 23:10:39 +1000 Subject: [PATCH] modify ADR for MsgVote backwards compatibility --- docs/architecture/adr-033-gov-split-vote.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/architecture/adr-033-gov-split-vote.md b/docs/architecture/adr-033-gov-split-vote.md index a567dd692d..b473bfc3b2 100644 --- a/docs/architecture/adr-033-gov-split-vote.md +++ b/docs/architecture/adr-033-gov-split-vote.md @@ -35,7 +35,22 @@ type Vote struct { } ``` -The `ValidateBasic` of a MsgVote struct would require that +And for backwards compatibility, we introduce `MsgWeightedVote` while keeping `MsgVote`. +``` +type MsgVote struct { + ProposalID int64 + Voter sdk.Address + Option Option +} + +type MsgWeightedVote struct { + ProposalID int64 + Voter sdk.Address + Options []WeightedVoteOption +} +``` + +The `ValidateBasic` of a `MsgWeightedVote` struct would require that 1. The sum of all the Rates is equal to 1.0 2. No Option is repeated