-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
SDK fails when Contract returns String
in a Struct
or Tuple
#1385
Comments
Relates to FuelLabs/sway#5044 |
Hey @pedronauck after debugging, this looks to be an issue on Sway with the new String Slice changes that have been added. Are you able to share more of the contract source code (as text, not image 😅 ). Currently, a storage map like |
This is currently blocked: |
String
in a Struct
or Tuple
@danielbate I believe this issue was solved already, right? |
Encoding wise we support all these types. This is blocked because on Sway side you can't use heap types in storage maps. Once unblocked Sway side, I expect this to just work. |
Just to add some more context on why this is blocked as per @IGI-111 Using slices in encoding still being worked on as apart of FuelLabs/sway#5110 as @danielbate mentioned But also there is a need for general support of putting types in storage, which should be solved by implementing the storage v3 RFC |
What version of fuels-ts are you using?
0.65.0
Steps to Reproduce
Hey guys, I was trying to run a small project yesterday and got into some issues related to decoding contract calls. What's happening is that it is not possible to return a Struct or a tuple that contains a String or Bytes inside. It seems it worked before 0.58.0, but things started to break since this PR.
Expected Behavior
This is the example of code in Sway
This is the example of usage on the SDK:
Actual Behavior
And that's the error I'm facing right now:
Seems that the problem is related to this part of the code:
https://github.com/FuelLabs/fuels-ts/blob/master/packages/abi-coder/src/coders/stdString.ts#L52-L58
I don't know, but I guess this
toNumber()
error when tryting to convert frombn
will break other decoders as well.The text was updated successfully, but these errors were encountered: