refactor: add nonce tracking in TaskResult to index app.signer
txns
#89
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What I did
Added nonce tracking logic into
SilverbackMiddleware
, which updates a label in.post_execute
that gets stored inTaskResult
. If you know the account address, you can do additional parsing post-task (assuming that the transaction has been finalized) to obtain the transaction receipt information from this combination.fixes: #88
fixes SBK-463
How I did it
Realized that
SilverbackSettings
was already passing itself toSIlverbackMiddleware
How to verify it
I ran the example app with
--account <My wallet>
and then separately sent a transaction from that wallet address inape console
In production, it will be strongly suggested to never mix keys like this as it is not a good idea anyways (due to requirement for stateful nonce tracking), but it will also give you a false positive of what transactions occured in the task.
Checklist