Skip to content

Commit

Permalink
Merge branch 'fraccaman/multisignature-draft-rebase-0.20.0' (#1766)
Browse files Browse the repository at this point in the history
* origin/fraccaman/multisignature-draft-rebase-0.20.0:
  added changelog
  fix: e2e test
  fix: unit test
  wasm: added new account methods to tx_prelude, refactor signature verification, rebuild wasm_for_tests
  docs: update tx definitions
  apps,shared: added cli tx and query methods
  core: added multisignature tx format, refacctor account storage api, added max_signature_per_transaction genesis parameter
  • Loading branch information
Fraccaman committed Jul 27, 2023
2 parents 7fdf079 + 4f7c639 commit a8666e6
Show file tree
Hide file tree
Showing 91 changed files with 4,337 additions and 2,173 deletions.
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))
1 change: 1 addition & 0 deletions .github/workflows/scripts/e2e.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"e2e::ledger_tests::ledger_txs_and_queries": 30,
"e2e::ledger_tests::masp_txs_and_queries": 82,
"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

0 comments on commit a8666e6

Please sign in to comment.