-
Notifications
You must be signed in to change notification settings - Fork 114
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
fix: pass arguments for the contract functions in the correct order #347
fix: pass arguments for the contract functions in the correct order #347
Conversation
API E2E Test Results207 tests 207 ✅ 19s ⏱️ Results for commit 27ed9d7. ♻️ This comment has been updated with latest results. |
Unit Test Results 4 files 263 suites 11m 43s ⏱️ Results for commit 27ed9d7. ♻️ This comment has been updated with latest results. |
7232ef9
to
fa4146d
Compare
Visit the preview URL for this PR: |
…ments-in-correct-order
…ments-in-correct-order
@tx-nikola looks good to me! I did a minor improvement and approved the PR. |
🎉 This PR is included in version 2.57.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
What ❔
This PR fixes the bug where the contract function arguments are not passed in the correct order.
Why ❔
In order to call the contract functions correctly, we need to pass the arguments in the right order.
Explanation
The issue was that we were trying to get
Object.entries(params)
without actually sorting it, so, for example, contract 0xE1D6A50E7101c8f8db77352897Ee3f1AC53f782B, therevokeRole
function asks for[role, account]
arguments to be passed.In the form object, it looks like this:
and when we run
Object.entries(params)
we always get it like this:and later after we map it, it becomes
["0x969Bb8Ae65602B4F8f9B459a11084e591c4491C7", "0x03c321230b026fb61a5a21f62c5f618751ec6d8435327f673bae5bfa570e5879"]
- swapping the arguments from their intended places.This issue was happening when someone types the account first, therefore forms become
instead of
thus messing up the order of the arguments in the function call.
Checklist