Skip to content

Commit

Permalink
Merge branch 'fraccaman+grarco/governance-custom-proposals' (#1056)
Browse files Browse the repository at this point in the history
* fraccaman+grarco/governance-custom-proposals:
  changelog: add #1056
  Refactors proposal execution
  Updates governance user guide
  [ci] wasm checksums update
  Fmt
  Removes unwrap from `compute_tally`
  Replaces `TallyResult::Failed` with `Error`
  Continues governance tally if wrong vote type
  Misc fixes
  Fixes vote memo in governance docs
  Clippy + fmt
  Removes comment
  Fixes nam value in governance eth test
  Fixes length of hex message in e2e tests
  Generates keypair for eth proposal e2e test
  Fixes typos in e2e tests
  Fixes pgf e2e test and governance vp
  Adds e2e test for eth proposal
  Refactors pgf council vote to HashSet
  Refactors custom proposal vote in client
  Updates cli proposal vote help
  Manages eth proposals in `finalize_block`
  Updates tally with eth proposals
  Updates governance vp for eth votes
  Adds ETH bridge cutom proposal
  Updates eth bridge vote in gov specs
  Clippy + fmt
  Fixes pgf e2e error
  Refunds for pgf proposal
  Finalizes pgf e2e test
  Improves governance VP vote check
  Improves pgf e2e test
  Fixes `ProposalType` serialization
  Clippy + fmt
  Adds pgf e2e test to github workflow
  Pgf proposal e2e test
  Fixes governance VP
  Improves governance vote command help
  Refactors cli governance vote. Improves custom proposal vote validation
  Clippy + fmt
  Refactors governance `Votes`
  Refactors `compute_tally` and removes duplicate
  Updates tally result
  Fixes governance specs
  Updates proposal tally for proposal types
  Updates governance specs with regard to PGF
  Updates init proposal tx and governance VP
  Renames `proposal_type`
  Adds `ProposalType` and `VoteType`
  • Loading branch information
tzemanovic committed Apr 6, 2023
2 parents cd74ed2 + b5c3c5b commit f608908
Show file tree
Hide file tree
Showing 16 changed files with 1,640 additions and 428 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Implements governance custom proposals
([#1056](https://github.com/anoma/namada/pull/1056))
2 changes: 2 additions & 0 deletions .github/workflows/scripts/e2e.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"e2e::ledger_tests::pos_bonds": 19,
"e2e::ledger_tests::pos_init_validator": 15,
"e2e::ledger_tests::proposal_offline": 15,
"e2e::ledger_tests::pgf_governance_proposal": 35,
"e2e::ledger_tests::eth_governance_proposal": 35,
"e2e::ledger_tests::proposal_submission": 35,
"e2e::ledger_tests::run_ledger": 5,
"e2e::ledger_tests::run_ledger_load_state_and_reset": 5,
Expand Down
39 changes: 35 additions & 4 deletions apps/src/lib/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1569,7 +1569,6 @@ pub mod args {
use namada::ibc::core::ics24_host::identifier::{ChannelId, PortId};
use namada::types::address::Address;
use namada::types::chain::{ChainId, ChainIdPrefix};
use namada::types::governance::ProposalVote;
use namada::types::key::*;
use namada::types::masp::MaspValue;
use namada::types::storage::{self, Epoch};
Expand Down Expand Up @@ -1663,7 +1662,9 @@ pub mod args {
const PUBLIC_KEY: Arg<WalletPublicKey> = arg("public-key");
const PROPOSAL_ID: Arg<u64> = arg("proposal-id");
const PROPOSAL_ID_OPT: ArgOpt<u64> = arg_opt("proposal-id");
const PROPOSAL_VOTE: Arg<ProposalVote> = arg("vote");
const PROPOSAL_VOTE_PGF_OPT: ArgOpt<String> = arg_opt("pgf");
const PROPOSAL_VOTE_ETH_OPT: ArgOpt<String> = arg_opt("eth");
const PROPOSAL_VOTE: Arg<String> = arg("vote");
const RAW_ADDRESS: Arg<Address> = arg("address");
const RAW_ADDRESS_OPT: ArgOpt<Address> = RAW_ADDRESS.opt();
const RAW_PUBLIC_KEY_OPT: ArgOpt<common::PublicKey> = arg_opt("public-key");
Expand Down Expand Up @@ -2295,7 +2296,11 @@ pub mod args {
/// Proposal id
pub proposal_id: Option<u64>,
/// The vote
pub vote: ProposalVote,
pub vote: String,
/// PGF proposal
pub proposal_pgf: Option<String>,
/// ETH proposal
pub proposal_eth: Option<String>,
/// Flag if proposal vote should be run offline
pub offline: bool,
/// The proposal file path
Expand All @@ -2306,6 +2311,8 @@ pub mod args {
fn parse(matches: &ArgMatches) -> Self {
let tx = Tx::parse(matches);
let proposal_id = PROPOSAL_ID_OPT.parse(matches);
let proposal_pgf = PROPOSAL_VOTE_PGF_OPT.parse(matches);
let proposal_eth = PROPOSAL_VOTE_ETH_OPT.parse(matches);
let vote = PROPOSAL_VOTE.parse(matches);
let offline = PROPOSAL_OFFLINE.parse(matches);
let proposal_data = DATA_PATH_OPT.parse(matches);
Expand All @@ -2314,6 +2321,8 @@ pub mod args {
tx,
proposal_id,
vote,
proposal_pgf,
proposal_eth,
offline,
proposal_data,
}
Expand All @@ -2333,7 +2342,29 @@ pub mod args {
.arg(
PROPOSAL_VOTE
.def()
.about("The vote for the proposal. Either yay or nay."),
.about("The vote for the proposal. Either yay or nay"),
)
.arg(
PROPOSAL_VOTE_PGF_OPT
.def()
.about(
"The list of proposed councils and spending \
caps:\n$council1 $cap1 $council2 $cap2 ... \
(council is bech32m encoded address, cap is \
expressed in microNAM",
)
.requires(PROPOSAL_ID.name)
.conflicts_with(PROPOSAL_VOTE_ETH_OPT.name),
)
.arg(
PROPOSAL_VOTE_ETH_OPT
.def()
.about(
"The signing key and message bytes (hex encoded) \
to be signed: $signing_key $message",
)
.requires(PROPOSAL_ID.name)
.conflicts_with(PROPOSAL_VOTE_PGF_OPT.name),
)
.arg(
PROPOSAL_OFFLINE
Expand Down
Loading

0 comments on commit f608908

Please sign in to comment.