-
Notifications
You must be signed in to change notification settings - Fork 30
fix: RPC starkNet_executeTxn
storing in-correct state data if the params calls
is not an array
#376
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
Conversation
starkNet_executeTxn
storing in-correct tx data when single calls
argument is given
starkNet_executeTxn
storing in-correct tx data when single calls
argument is givenstarkNet_executeTxn
storing in-correct state data when single calls
argument is given
starkNet_executeTxn
storing in-correct state data when single calls
argument is givenstarkNet_executeTxn
storing in-correct state data if single calls
argument was given
starkNet_executeTxn
storing in-correct state data if single calls
argument was givenstarkNet_executeTxn
storing in-correct state data if calls
argument is not an array
starkNet_executeTxn
storing in-correct state data if calls
argument is not an arraystarkNet_executeTxn
storing in-correct state data if the params calls
is not an array
78f8573
to
840ea4e
Compare
840ea4e
to
dcff7de
Compare
dcff7de
to
8051fb1
Compare
…le calls argument was given
8051fb1
to
61a35fc
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.
LGTM, thank you very much for the update
PR Description:
This PR addresses the following changes:
Fixture Update:
callsExamples.json
fixture has been updated to handle both cases wherecalls
can be either an array or a single object. This ensures that the test scenarios are consistent with the real-world behavior wherecalls
might be in different formats.Changes:
calls
were always treated as an array. The second example in the fixture now providescalls
as a single object, allowing the tests to cover this scenario.Test Enhancements:
executeTxn.test.ts
tests to useit.each
to handle both cases wherecalls
could be either an array or a single object.Call[]
andCall
), ensuring that the code is properly tested for different scenarios without duplicating test logic.Changes:
executeTxn
has been replaced with anit.each
block, covering both the array and object formats ofcalls
.calls
.Code Improvement:
executeTxn.ts
logic was updated to handle both array and non-array formats forcalls
.call
was introduced to check ifcalls
is an array and, if so, uses the first element; otherwise, it directly uses the object. This avoids potential issues whencalls
is not an array.Changes:
calls[0]
in theaddTransaction
method was replaced with the newly createdcall
variable, ensuring correct handling of both formats.Summary:
This PR ensures that both the code and tests properly handle
calls
when it is an array or a single object, improving robustness and coverage in different scenarios.BEGIN_COMMIT_OVERRIDE
fix: Fix RPC
starkNet_executeTxn
storing in-correct state data if the paramscalls
is not an array (#376)END_COMMIT_OVERRIDE