Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d98fe8d
Refactors the signatures structures of the SDK
grarco May 28, 2025
441c829
Merges the two dry-run args into a single one
grarco Sep 4, 2025
dd07dda
Merges the two dump-tx args into a single one
grarco Sep 4, 2025
90df1f6
Separates wrapper-specific arguments into a specific type
grarco Sep 5, 2025
91f2035
Misc improvements to sdk interfaces and removal of some useless dispa…
grarco Sep 8, 2025
90c2912
Changes the interface of fee validation
grarco Sep 9, 2025
18146e8
Removes handling of MASP account as transaction's owner
grarco Sep 9, 2025
6398399
Slight improvement to `build_batch`
grarco Sep 9, 2025
cda75ba
Refactors signing of custom transactions
grarco Sep 9, 2025
000f142
Fixes the accounting of the number of signatures
grarco Sep 10, 2025
6e9f498
Adds a wrapper check before tx submission
grarco Sep 10, 2025
e938169
Fixes broken tests
grarco Sep 11, 2025
d164881
Refactors custom tx builder
grarco Sep 15, 2025
e18a5d6
Refactors inner tx signers' extraction
grarco Sep 16, 2025
dbfc0bd
Removes redundant `default` signer
grarco Sep 17, 2025
5d555ee
Simplifies the interface of signing data functions
grarco Sep 18, 2025
1f4e672
Fixes warning message in client and removes unnecessary owner for rev…
grarco Sep 19, 2025
f7b4ed9
Fixes comment typo
grarco Sep 23, 2025
0529619
Refactors extraction of signing data into a separate function
grarco Sep 23, 2025
daef0c8
Removes unnecessary gas-payer from integration test
grarco Sep 23, 2025
9aa2158
Avoids generating empty auth section when no serialized signatures ar…
grarco Sep 24, 2025
6cb8998
Fixes broken masp test
grarco Sep 24, 2025
ef89315
Reverts the logic of `inner_tx_signers`
grarco Sep 25, 2025
70bf862
Upgrades `build_batch` to support batched transactions
grarco Sep 26, 2025
e737bcb
Changelog #4816
grarco Sep 19, 2025
8c59a7b
Fixes typo in changelog
grarco Oct 1, 2025
445bad6
ci: add missing SDK issue category
tzemanovic Oct 1, 2025
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
15 changes: 15 additions & 0 deletions .changelog/unreleased/SDK/4816-wrapper-sigs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- Reworked SDK wrapping and signatures, including some breaking changes.
More specifically:
- The wrapper arguments have been extracted into a separate type and their
presence signals the need to wrap the tx
- The dump and dry-run arguments have been turned into enumerations
- The wrapper signer data has been removed from SigningTxData and moved into
SigningWrapperData
- Simplified the interface of aux_signing_data
- Removed redundant dispatcher functions
- Prevent casting from a wrapped to a raw transaction type
- Prevent submitting an unwrapped transaction
- Avoided passing the MASP internal address as a transaction's owner
- Updated the interface of build_batch
- Removed the owner for reveal_pk
([\#4816](https://github.com/anoma/namada/pull/4816))
4 changes: 2 additions & 2 deletions .github/workflows/scripts/check-changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ check_changelog_added_in_subfolders() {
fi
echo "Using sha: $head_commit"

subfolders=("ci" "bug-fixes" "improvements" "miscellaneous" "features" "testing" "docs")
subfolders=("ci" "bug-fixes" "improvements" "miscellaneous" "features" "testing" "docs" "SDK")

subfolder_pattern=$(printf "|%s" "${subfolders[@]}")
subfolder_pattern=${subfolder_pattern:1} # Remove the leading '|'
Expand All @@ -26,4 +26,4 @@ check_changelog_added_in_subfolders() {
fi
}

check_changelog_added_in_subfolders
check_changelog_added_in_subfolders
54 changes: 36 additions & 18 deletions crates/apps_lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7708,21 +7708,24 @@ pub mod args {
ctx: &mut Context,
) -> Result<Tx<SdkTypes>, Self::Error> {
let ctx = ctx.borrow_mut_chain_or_exit();
let wrapper = self.wrap_tx.map(|wrapper| Wrapper {
broadcast_only: wrapper.broadcast_only,
fee_amount: wrapper.fee_amount,
fee_token: ctx.get(&wrapper.fee_token).into(),
gas_limit: wrapper.gas_limit,
wrapper_fee_payer: wrapper
.wrapper_fee_payer
.map(|x| ctx.get(&x)),
});

Ok(Tx::<SdkTypes> {
dry_run: self.dry_run,
dry_run_wrapper: self.dry_run_wrapper,
dump_tx: self.dump_tx,
dump_wrapper_tx: self.dump_wrapper_tx,
output_folder: self.output_folder,
force: self.force,
broadcast_only: self.broadcast_only,
ledger_address: ctx.get(&self.ledger_address),
initialized_account_alias: self.initialized_account_alias,
wallet_alias_force: self.wallet_alias_force,
fee_amount: self.fee_amount,
fee_token: ctx.get(&self.fee_token).into(),
gas_limit: self.gas_limit,
signing_keys: self
.signing_keys
.iter()
Expand All @@ -7734,7 +7737,7 @@ pub mod args {
chain_id: self
.chain_id
.or_else(|| Some(ctx.config.ledger.chain_id.clone())),
wrapper_fee_payer: self.wrapper_fee_payer.map(|x| ctx.get(&x)),
wrap_tx: wrapper,
memo: self.memo,
use_device: self.use_device,
device_transport: self.device_transport,
Expand Down Expand Up @@ -7861,10 +7864,20 @@ pub mod args {
}

fn parse(matches: &ArgMatches) -> Self {
let dry_run = DRY_RUN_TX.parse(matches);
let dry_run_wrapper = DRY_RUN_WRAPPER_TX.parse(matches);
let dump_tx = DUMP_TX.parse(matches);
let dump_wrapper_tx = DUMP_WRAPPER_TX.parse(matches);
let dry_run = if DRY_RUN_TX.parse(matches) {
Some(DryRun::Inner)
} else if DRY_RUN_WRAPPER_TX.parse(matches) {
Some(DryRun::Wrapper)
} else {
None
};
let dump_tx = if DUMP_TX.parse(matches) {
Some(DumpTx::Inner)
} else if DUMP_WRAPPER_TX.parse(matches) {
Some(DumpTx::Wrapper)
} else {
None
};
let force = FORCE.parse(matches);
let broadcast_only = BROADCAST_ONLY.parse(matches);
let ledger_address = CONFIG_RPC_LEDGER_ADDRESS.parse(matches);
Expand Down Expand Up @@ -7893,25 +7906,30 @@ pub mod args {
}
};
let device_transport = DEVICE_TRANSPORT.parse(matches);
// Wrap the transaction unless we want to dump or dry-run the raw tx
let wrap_tx = match (&dump_tx, &dry_run) {
(_, Some(DryRun::Inner)) | (Some(DumpTx::Inner), _) => None,
_ => Some(Wrapper {
broadcast_only,
fee_amount,
wrapper_fee_payer,
fee_token,
gas_limit,
}),
};
Self {
dry_run,
dry_run_wrapper,
dump_tx,
dump_wrapper_tx,
force,
broadcast_only,
ledger_address,
initialized_account_alias,
wallet_alias_force,
fee_amount,
fee_token,
gas_limit,
expiration,
signing_keys,
tx_reveal_code_path,
password,
chain_id,
wrapper_fee_payer,
wrap_tx,
output_folder,
memo,
use_device,
Expand Down
6 changes: 2 additions & 4 deletions crates/apps_lib/src/cli/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ impl CliApi {
client.wait_until_node_is_synced(&io).await?;
let args = args.to_sdk(&mut ctx)?;
let namada = ctx.to_sdk(client, io);
let dry_run =
args.tx.dry_run || args.tx.dry_run_wrapper;
let dry_run = args.tx.dry_run.is_some();
tx::submit_custom(&namada, args).await?;
if !dry_run {
namada
Expand Down Expand Up @@ -192,8 +191,7 @@ impl CliApi {
client.wait_until_node_is_synced(&io).await?;
let args = args.to_sdk(&mut ctx)?;
let namada = ctx.to_sdk(client, io);
let dry_run =
args.tx.dry_run || args.tx.dry_run_wrapper;
let dry_run = args.tx.dry_run.is_some();
tx::submit_init_account(&namada, args).await?;
if !dry_run {
namada
Expand Down
Loading
Loading