Fix: Smart Contract Invoke excludes arguments after a Vec#1686
Fix: Smart Contract Invoke excludes arguments after a Vec#1686jeesunikim merged 2 commits intostellar:mainfrom
Vec#1686Conversation
When invoking a smart contract function that has heterogeneous argument types, line 531 of the `sorobanUtils.ts iterates through each argument, parses it, but mistakenly returns the parse value - ending the for loop before iterating through every argument. This results in function arguments being excluded from execution and the invocation/simulation therefore failing. This commit replaces these `return` statements with `continue` so the for loop can complete iteration through all passed arguments.
|
Thanks for the PR, @jblewnormal ! 🎉 @jeesunikim will review it next week when she's back. |
|
@quietbits @jeesunikim There's another bug I've found where contract function arguments are added in the order they are entered by the user. So if you don't enter them sequentially, the simulation will fail. I'll have a PR for this soon. |
|
@jblewnormal, thanks for digging into this. Really appreciate the help. ❤️ |
|
thank you so much! @jblewnormal LGTM |
@jblewnormal Did you have a chance to look into this issue or need any help? |
Hey hey, I have not had the time yet. When I do, I will get a new issue/PR created. Basically, if smart contract function arguments are not entered in chronological order, their correct order is not maintained and the function call fails. |
|
good afternoon, I will work on this tomorrow! Thanks! |
fix(sorobanUtils): replace
returnstatements withcontinueingetScValsFromArgs()When invoking a smart contract function that has heterogeneous argument types, line 531 of the
sorobanUtils.tsiterates through each argument, parses it, but mistakenly returns the parsed value - ending the for loop before iterating through every argument.You can recreate the original bug that prompted this PR by using
CCPHUHQYFOJJ6WQUGUYHHPJYQGFLRQHJJTRJNWQG54MHCHPRFLWQI7SEand calling theset_privileged_addrsfunction. Pass in any assortment of addresses and you'll notice you receive this error:The arguments logged at the end of this error do not include the final argument
system_fee_admin. This is because of this bug.This results in function arguments being excluded from execution and the invocation/simulation therefore failing.
This commit replaces these
returnstatements withcontinueso the for loop can complete iteration through all passed arguments.