silverback
silverback copied to clipboard
refactor: add nonce tracking in TaskResult to index `app.signer` txns
What I did
Added nonce tracking logic into SilverbackMiddleware, which updates a label in .post_execute that gets stored in TaskResult. 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 to SIlverbackMiddleware
How to verify it
I ran the example app with --account <My wallet> and then separately sent a transaction from that wallet address in ape 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
- [ ] Passes all linting checks (pre-commit and CI jobs)
- [ ] New test cases have been added and are passing
- [ ] Documentation has been updated
- [ ] PR title follows Conventional Commit standard (will be automatically included in the changelog)
Turns out... not going to be as useful post #228