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
1e39180
Refactors the signatures structures of the SDK
grarco May 28, 2025
dd0d9bc
Merges the two dry-run args into a single one
grarco Sep 4, 2025
5427a95
Merges the two dump-tx args into a single one
grarco Sep 4, 2025
c16c923
Separates wrapper-specific arguments into a specific type
grarco Sep 5, 2025
5020964
Misc improvements to sdk interfaces and removal of some useless dispa…
grarco Sep 8, 2025
8024df1
Changes the interface of fee validation
grarco Sep 9, 2025
5f05408
Removes handling of MASP account as transaction's owner
grarco Sep 9, 2025
167a642
Slight improvement to `build_batch`
grarco Sep 9, 2025
597df8c
Refactors signing of custom transactions
grarco Sep 9, 2025
c6b8334
Fixes the accounting of the number of signatures
grarco Sep 10, 2025
b629788
Adds a wrapper check before tx submission
grarco Sep 10, 2025
a0f462f
Fixes broken tests
grarco Sep 11, 2025
20991d2
Refactors custom tx builder
grarco Sep 15, 2025
c096ccb
Refactors inner tx signers' extraction
grarco Sep 16, 2025
7106c1f
Removes redundant `default` signer
grarco Sep 17, 2025
f19da12
Simplifies the interface of signing data functions
grarco Sep 18, 2025
2060a0a
Fixes warning message in client and removes unnecessary owner for rev…
grarco Sep 19, 2025
9e76505
Fixes comment typo
grarco Sep 23, 2025
cde13a2
Refactors extraction of signing data into a separate function
grarco Sep 23, 2025
031c177
Removes unnecessary gas-payer from integration test
grarco Sep 23, 2025
df6cb55
Avoids generating empty auth section when no serialized signatures ar…
grarco Sep 24, 2025
8111e2d
Fixes broken masp test
grarco Sep 24, 2025
eec8a90
Reverts the logic of `inner_tx_signers`
grarco Sep 25, 2025
0fb380f
Upgrades `build_batch` to support batched transactions
grarco Sep 26, 2025
73c9efd
Changelog #4816
grarco Sep 19, 2025
603b826
Fixes typo in changelog
grarco Oct 1, 2025
3394fd7
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 @@ -7813,21 +7813,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 @@ -7839,7 +7842,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 @@ -7966,10 +7969,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 @@ -7998,25 +8011,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 @@ -193,8 +192,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