-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Save tx at transaction submit eventHandler for nightfall-client #1370
base: master
Are you sure you want to change the base?
Save tx at transaction submit eventHandler for nightfall-client #1370
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to include the Transaction events in the Client synchronisation routine now, otherwise it may not finish synchronisation with a consistent database?
d1ac399
to
e2d769e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a test for your client synchronisation code (like the optimist resync test)
added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explain how to test this code (including with a re-sync of the client).
Thanks @Westlad for pointing it out. |
d60303a
to
d3cb95f
Compare
What does this implement/fix? Explain your changes.
Changes in this PR includes
Does this close any currently open issues?
This PR fixes #1335
What commands can I run to test the change?
Any other comments?
This PR also implements github workflow with test file
test/client-resync.test.mjs
, where user created two transfers transaction using same set of commitments, while proposer setMakeBlock was off. Note: second transfer is with higher fee.then proposer starts making block pick second tx and make a successful block.
[to test client re-sync feature] we are restarts client and all unsaved transaction are saved at transactionSubmitEventHandler
and at blockProposedEventHandler second tx updates and first tx deleted with change commitment it created.
explanation on
test/client-resync.test.mjs
steps are.
TransactionSubmitted
event and expect respective transaction hash and saved in client's db.TransactionSubmitted
event also do not domakeBlock', and restart client immediately
await restartClient(nf3User);after client re-sync complete, check both transfer transactions in client db (this done at test by calling API
GET: /transactions`).await makeBlock();
.( only three transaction should be in db, and last one should be of higher fee)