-
Notifications
You must be signed in to change notification settings - Fork 109
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
Revamping the transaction and signature tests for better readability, usability and extensibility #427
base: p/transaction-testing-framework
Are you sure you want to change the base?
Conversation
Validates totalInput, spendAmount, changeAmount, fees and error result computed from chain.AddInputsAndChangeToTransaction
@AeonSw4n : I'm revamping the entire transaction testing framework to make it simple to use and extend. I should be able to submit it in another day or two for review. Post-revamp it'll become much faster to add any kind of test. |
Creating test for mempool transaction errors to simplify TestBasicTransferSignatures
Simplifying TestBasicTransferSignatures tests by separating the derived key transaction error cases.
- Making TestBasicTransferSignatures table-driven - The goal is to improve the readability of the program - Creating new data structures to simplify the generation of test transactions.
- `doDerivedKeyTransaction` is revamped as a method on derivedKeyTestTxn - This makes the use of the test helper function much easier.
Hey @hackintoshrao, cool stuff! I particularly like the TestBlockChain struct, that's definitely cleaner than having all these random fields. I'm getting close to wrapping up access groups & group chats and was wondering if you had a chance to look at the postgres pre-connect/after-connect-disconnect state verification yet? All good if you haven't, just want to make sure we don't overlap code. Happy holidays! (Or Merry Christmas if you celebrate 😄) |
Hey @AeonSw4n , good to hear from you :) Again, it would be nicer to be able to find you on the discord channel for a more frequent Q&A discussion! I'm very close to wrapping this PR, I couldn't resist simplifying some of the tests and the structure of the suite. The test framework is an ocean, hence I'll not jump into a full-fledged revamp right away. So I'll complete this PR in a day or two and submit it for review. No holidays for me this year. I'm in a sense of urgency to learn blockchain and find a job asap 😅 |
`transactionSpendingLimitBytes` was appended to the `accessKeyBytes`a nd the verification of that signature is done via _verifyAccessSignature which doesn't take into account the appended transactionSpendingLimitBytes. Which was causing signature failure in tests.
Figure signature verification issue for derivedKeys with transactionLimitBytes.
- The number of transactions in the mempool were less than expected value. - This is because of not adding the pointer to the mempool during the call to `AddInputsAndChangeToTransaction`.
Validates total input, spend amount, change amount, fees, and error result
computed from chain.AddInputsAndChangeToTransaction.
@AeonSw4n Added tests to validate the output of AddInputsAndChangeToTransaction. Wrote this test as I was working through understanding how transactions, utxoviews, mining work in DeSo.