Closed m-Peter closed 3 weeks ago
The changes enhance the validation logic in the TransactionArgs
struct's Validate
method to prevent nil pointer dereferences. A new test case is added to check the handling of a nil To
field, ensuring that transactions attempting to create contracts with empty code are correctly deemed invalid. This improves the robustness and reliability of the transaction validation process.
Files | Change Summary |
---|---|
api/models.go, api/models_test.go, models/transaction_test.go | Enhanced validation logic in TransactionArgs.Validate to check for nil values before comparisons and added test cases for scenarios with nil To field. |
Objective | Addressed | Explanation |
---|---|---|
Crasher on validation of args (#525) | ✅ |
🐰 "In the code where errors did creep,
A safeguard now helps us leap!
With checks for nil, we dance with glee,
Validations strong, as strong can be!
Hooray for tests that catch the flaws,
A happy rabbit gives you applause!" 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Closes: https://github.com/onflow/flow-evm-gateway/issues/525
Description
Add
nil
check for transactionValue
field.For contributor use:
master
branchFiles changed
in the Github PR explorerSummary by CodeRabbit
New Features
Bug Fixes
Tests