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

Multisignature (rebase) #1741

Closed
wants to merge 12 commits into from
2 changes: 2 additions & 0 deletions .changelog/unreleased/features/1606-multisignature-draft.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Introduce multisignature account and transaction format.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be nice to write a little bit more about this and/or link to docs for anyone who'll want to try it in the new release

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have docs almost ready, should I link them here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes pls!

([\#1606](https://github.com/anoma/namada/pull/1606))
1 change: 1 addition & 0 deletions .github/workflows/scripts/e2e.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"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,
Expand Down
68 changes: 53 additions & 15 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();
tx::submit_reveal_aux(
.await?;

let tx_builder = bridge_pool::build_bridge_pool_tx(
&client,
&mut ctx,
&tx_args,
addr,
pk.clone(),
&mut tx,
args.clone(),
signing_data.fee_payer.clone(),
)
.await?;
signing::sign_tx(&mut ctx.wallet, &mut tx, &tx_args, &pk)

if args.tx.dump_tx {
dump_tx(&args.tx, tx_builder);
} else {
tx::submit_reveal_aux(
&client,
&mut ctx,
tx_args.clone(),
&args.sender,
)
.await?;
sdk_tx::process_tx(&client, &mut ctx.wallet, &tx_args, tx)

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
Loading