Skip to content

Commit

Permalink
Fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
grarco authored and bengtlofgren committed May 11, 2023
1 parent aa7bdd3 commit 10aee5b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 19 deletions.
4 changes: 2 additions & 2 deletions apps/src/lib/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2349,8 +2349,8 @@ pub mod args {
.about(
"The list of proposed councils and spending \
caps:\n$council1 $cap1 $council2 $cap2 ... \
(council is bech32m encoded address, cap is expressed in \
microNAM",
(council is bech32m encoded address, cap is \
expressed in microNAM",
)
.requires(PROPOSAL_ID.name)
.conflicts_with(PROPOSAL_VOTE_ETH_OPT.name),
Expand Down
9 changes: 6 additions & 3 deletions apps/src/lib/node/ledger/shell/finalize_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ mod test_finalize_block {
use namada::types::storage::Epoch;
use namada::types::time::DurationSecs;
use namada::types::transaction::governance::{
InitProposalData, VoteProposalData,
InitProposalData, ProposalType, VoteProposalData,
};
use namada::types::transaction::{EncryptionKey, Fee, WrapperTx, MIN_FEE};
use rust_decimal_macros::dec;
Expand Down Expand Up @@ -1232,7 +1232,7 @@ mod test_finalize_block {
voting_start_epoch: Epoch::default(),
voting_end_epoch: Epoch::default().next(),
grace_epoch: Epoch::default().next(),
proposal_code: None,
r#type: ProposalType::Default(None),
};

storage_api::governance::init_proposal(
Expand All @@ -1254,7 +1254,10 @@ mod test_finalize_block {
};

// Add a proposal to be accepted and one to be rejected.
add_proposal(0, ProposalVote::Yay);
add_proposal(
0,
ProposalVote::Yay(namada::types::governance::VoteType::Default),
);
add_proposal(1, ProposalVote::Nay);

// Commit the genesis state
Expand Down
37 changes: 23 additions & 14 deletions shared/src/ledger/native_vp/governance/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ pub fn compute_tally(
return Err(Error::Tally(format!(
"Unexpected proposal type: {}",
proposal_type
)))
)));
}
};

Expand Down Expand Up @@ -238,7 +238,14 @@ pub fn compute_tally(
{
*power -= vote_power;
} else {
return Err(Error::Tally(format!("Expected PGF vote {:?} was not in tally", vote)));
return Err(Error::Tally(
format!(
"Expected PGF \
vote {:?} was \
not in tally",
vote
),
));
}
} else {
// Validator didn't vote for
Expand All @@ -251,9 +258,10 @@ pub fn compute_tally(
} else {
// Log the error and continue
tracing::error!(
"Unexpected vote type. Expected: PGFCouncil, Found: {}",
validator_vote
);
"Unexpected vote type. Expected: \
PGFCouncil, Found: {}",
validator_vote
);
continue;
}
}
Expand Down Expand Up @@ -291,9 +299,8 @@ pub fn compute_tally(
} else {
return Err(Error::Tally(
format!(
"Expected PGF \
vote {:?} was \
not in tally",
"Expected PGF vote \
{:?} was not in tally",
vote
),
));
Expand All @@ -302,9 +309,10 @@ pub fn compute_tally(
} else {
// Log the error and continue
tracing::error!(
"Unexpected vote type. Expected: PGFCouncil, Found: {}",
validator_vote
);
"Unexpected vote type. Expected: \
PGFCouncil, Found: {}",
validator_vote
);
continue;
}
}
Expand All @@ -313,9 +321,10 @@ pub fn compute_tally(
_ => {
// Log the error and continue
tracing::error!(
"Unexpected vote type. Expected: PGFCouncil, Found: {}",
delegator_vote
);
"Unexpected vote type. Expected: PGFCouncil, \
Found: {}",
delegator_vote
);
continue;
}
}
Expand Down

0 comments on commit 10aee5b

Please sign in to comment.