Skip to content

feat: make --ext override PAPI builtin extensions - #271

Open
peetzweg wants to merge 1 commit into
mainfrom
feat-171-ext-overrides-builtins
Open

feat: make --ext override PAPI builtin extensions#271
peetzweg wants to merge 1 commit into
mainfrom
feat-171-ext-overrides-builtins

Conversation

@peetzweg

@peetzweg peetzweg commented Jul 7, 2026

Copy link
Copy Markdown
Member

Closes #171.

Makes --ext a generic override that applies to every signed extension a chain declares, including polkadot-api builtins.

Why: --asset worked on the ChargeAssetTxPayment builtin, but naming any other builtin (e.g. ChargeTransactionPayment) in --ext was silently ignored — the two flags were inconsistent and --ext (the more generic one) couldn't reach builtins at all.

How: in buildCustomSignedExtensions an explicit --ext entry now takes priority over the builtin skip, so a named builtin is passed to polkadot-api's customSignedExtensions; un-named builtins are still auto-filled. --asset is now just sugar over an --ext override of ChargeAssetTxPayment (the bespoke skip-set juggling is gone). One judgment call: overriding builtins is a power-user escape hatch — the ergonomic flags (--nonce/--tip/--mortality/--asset) remain the normal path.

Example (real, executable — the detail view now advertises the override for builtins):

$ dot polkadot.extensions.CheckMortality

CheckMortality (Transaction Extension)

  Value type:       enum(256 variants)
  AdditionalSigned: [u8; 32]
  Handled by:       polkadot-api (builtin) — filled in automatically, override with --ext

Usage:
  dot polkadot.tx.<Pallet>.<Call> --from <acc> --ext '{"CheckMortality":{"value":<v>}}'
  Builtin: polkadot-api sets a value by default; pass --ext only to override it.

Force an immortal era on any call by overriding the builtin:

dot polkadot.tx.System.remark 0xdeadbeef --from alice \
  --ext '{"CheckMortality":{"value":{"type":"Immortal","value":null}}}'

Tests + changeset added; docs, skill and README updated. Full suite (1742 tests), lint, typecheck and build all green.

--ext now applies to every signed extension a chain declares, including
polkadot-api builtins. Naming a builtin (e.g. CheckMortality,
ChargeTransactionPayment) in --ext overrides the value PAPI would fill in
automatically; previously such entries were silently dropped.

--asset is now just sugar over an --ext override of ChargeAssetTxPayment,
so both paths share one mechanism. The extensions detail view advertises
the --ext override for builtins too.

Closes #171
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check handling of PAPI_BUILTIN_EXTENSIONS

1 participant