Skip to content

Support for custom tx payload builder#46

Merged
michalkucharczyk merged 8 commits into
masterfrom
mku-payload-builder
Dec 8, 2025
Merged

Support for custom tx payload builder#46
michalkucharczyk merged 8 commits into
masterfrom
mku-payload-builder

Conversation

@michalkucharczyk

Copy link
Copy Markdown
Owner

Added with_tx_payload_builder_sub and with_tx_payload_builder_eth methods to ScenarioBuilder, allowing users to provide custom transaction payload builders instead of using the built-in transfer/remark recipes. The custom builder receives a TxBuildContext with account
info and nonce, enabling arbitrary extrinsic calls.

An example (examples/kill_dev_entry.rs) demonstrates how to use new feature to build custom CLI sender. It uses by sending TestPallet::kill_dev_entry transactions across a range of accounts.

@iulianbarbu iulianbarbu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks very nice, thanks!

@iulianbarbu

Copy link
Copy Markdown
Collaborator

Hmm, we have a clippy error in relation to too many args for a fn. Probably fixable with some effort.

@michalkucharczyk

Copy link
Copy Markdown
Owner Author

It is a bit clumsy that we have two methods, but for now I don't have better idea how to handle this. Probably entire scenario builder should be generic over the config - the thing I wanted to avoid at the beginning. Something to think about as a side project maybe...

@iulianbarbu iulianbarbu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm!

@iulianbarbu

Copy link
Copy Markdown
Collaborator

It is a bit clumsy that we have two methods,

You mean the two methods for tx builder payload, on the scenario builder?

@iulianbarbu

Copy link
Copy Markdown
Collaborator

Probably entire scenario builder should be generic over the config - the thing I wanted to avoid at the beginning. Something to think about as a side project maybe...

It is not necessarily a bad idea, it is a single generic type for now, unless you tried in the past and it turned out to be a mess.

@michalkucharczyk michalkucharczyk merged commit 2bcc624 into master Dec 8, 2025
1 check passed
@michalkucharczyk michalkucharczyk deleted the mku-payload-builder branch December 8, 2025 08:35
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.

2 participants