Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Governance refactor #1803

Merged
merged 15 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Introduce multisignature accounts and transaction format. It is now possible
to supply multiple public keys when creating a new account/validator and
specify the minimum number of signatures required to authorize a transaction.
([\#1765](https://github.com/anoma/namada/pull/1765))
2 changes: 2 additions & 0 deletions .changelog/unreleased/features/1803-refactor-governance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Introduce a simplified version of Public Good Fundings.
([\#1803](https://github.com/anoma/namada/pull/1803))
2 changes: 1 addition & 1 deletion .github/workflows/scripts/e2e.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"e2e::ledger_tests::masp_pinned_txs": 75,
"e2e::ledger_tests::masp_txs_and_queries": 282,
"e2e::ledger_tests::pos_bonds": 77,
"e2e::ledger_tests::implicit_account_reveal_pk": 30,
"e2e::ledger_tests::pos_init_validator": 40,
"e2e::ledger_tests::proposal_offline": 21,
"e2e::ledger_tests::pgf_governance_proposal": 100,
"e2e::ledger_tests::eth_governance_proposal": 100,
"e2e::ledger_tests::proposal_submission": 200,
"e2e::ledger_tests::run_ledger": 5,
"e2e::ledger_tests::run_ledger_load_state_and_reset": 23,
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 52 additions & 14 deletions apps/src/bin/namada-client/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use color_eyre::eyre::{eyre, Report, Result};
use namada::ledger::eth_bridge::bridge_pool;
use namada::ledger::rpc::wait_until_node_is_synched;
use namada::ledger::tx::dump_tx;
use namada::ledger::{signing, tx as sdk_tx};
use namada::types::control_flow::ProceedOrElse;
use namada_apps::cli;
Expand Down Expand Up @@ -67,7 +68,7 @@ pub async fn main() -> Result<()> {
tx::submit_ibc_transfer::<HttpClient>(&client, ctx, args)
.await?;
}
Sub::TxUpdateVp(TxUpdateVp(mut args)) => {
Sub::TxUpdateAccount(TxUpdateAccount(mut args)) => {
let client = HttpClient::new(utils::take_config_address(
&mut args.tx.ledger_address,
))
Expand All @@ -76,8 +77,10 @@ pub async fn main() -> Result<()> {
.await
.proceed_or_else(error)?;
let args = args.to_sdk(&mut ctx);
tx::submit_update_vp::<HttpClient>(&client, &mut ctx, args)
.await?;
tx::submit_update_account::<HttpClient>(
&client, &mut ctx, args,
)
.await?;
}
Sub::TxInitAccount(TxInitAccount(mut args)) => {
let client = HttpClient::new(utils::take_config_address(
Expand Down Expand Up @@ -213,26 +216,51 @@ pub async fn main() -> Result<()> {
.proceed_or_else(error)?;
let args = args.to_sdk(&mut ctx);
let tx_args = args.tx.clone();
let (mut tx, addr, pk) = bridge_pool::build_bridge_pool_tx(

let default_signer =
signing::signer_from_address(Some(args.sender.clone()));
let signing_data = signing::aux_signing_data(
&client,
&mut ctx.wallet,
args,
&args.tx,
&args.sender,
default_signer,
)
.await
.unwrap();
.await?;

tx::submit_reveal_aux(
&client,
&mut ctx,
&tx_args,
addr,
pk.clone(),
&mut tx,
tx_args.clone(),
&args.sender,
)
.await?;
signing::sign_tx(&mut ctx.wallet, &mut tx, &tx_args, &pk)
.await?;
sdk_tx::process_tx(&client, &mut ctx.wallet, &tx_args, tx)

let tx_builder = bridge_pool::build_bridge_pool_tx(
&client,
args.clone(),
signing_data.gas_payer.clone(),
)
.await?;

if args.tx.dump_tx {
dump_tx(&args.tx, tx_builder);
} else {
let tx_builder = signing::sign_tx(
&mut ctx.wallet,
&tx_args,
tx_builder,
signing_data,
)?;

sdk_tx::process_tx(
&client,
&mut ctx.wallet,
&tx_args,
tx_builder,
)
.await?;
}
}
Sub::TxUnjailValidator(TxUnjailValidator(mut args)) => {
let client = HttpClient::new(utils::take_config_address(
Expand Down Expand Up @@ -463,6 +491,16 @@ pub async fn main() -> Result<()> {
let args = args.to_sdk(&mut ctx);
rpc::query_protocol_parameters(&client, args).await;
}
Sub::QueryAccount(QueryAccount(args)) => {
let client =
HttpClient::new(args.query.ledger_address.clone())
.unwrap();
wait_until_node_is_synched(&client)
.await
.proceed_or_else(error)?;
let args = args.to_sdk(&mut ctx);
rpc::query_account(&client, args).await;
}
}
}
cli::NamadaClient::WithoutContext(cmd, global_args) => match cmd {
Expand Down
2 changes: 1 addition & 1 deletion apps/src/bin/namada/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fn handle_command(cmd: cli::cmds::Namada, raw_sub_cmd: String) -> Result<()> {
| cli::cmds::Namada::TxCustom(_)
| cli::cmds::Namada::TxTransfer(_)
| cli::cmds::Namada::TxIbcTransfer(_)
| cli::cmds::Namada::TxUpdateVp(_)
| cli::cmds::Namada::TxUpdateAccount(_)
| cli::cmds::Namada::TxRevealPk(_)
| cli::cmds::Namada::TxInitProposal(_)
| cli::cmds::Namada::TxVoteProposal(_) => {
Expand Down
Loading