Save tx at transaction submit eventHandler for nightfall-client#1370
Save tx at transaction submit eventHandler for nightfall-client#1370LijuJoseJJ wants to merge 9 commits intomasterfrom
Conversation
Westlad
left a comment
There was a problem hiding this comment.
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
Westlad
left a comment
There was a problem hiding this comment.
Please add a test for your client synchronisation code (like the optimist resync test)
added |
Westlad
left a comment
There was a problem hiding this comment.
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.mjssteps are.
TransactionSubmittedevent and expect respective transaction hash and saved in client's db.TransactionSubmittedevent also do not domakeBlock', and restart client immediatelyawait restartClient(nf3User);after client re-sync complete, check both transfer transactions in client db (this done at test by calling APIGET: /transactions`).await makeBlock();.( only three transaction should be in db, and last one should be of higher fee)