-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat!: add String
support
#1042
Conversation
2193c94
to
bcbbeee
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.
Beautifully done!!
As for the open sway issue, you can test your understanding of the encoding by leaving the SDK out and using a plain ol' sway script calling a sway contract via forc
.
Log the received data and do these assertions and see if they hold up.
Not approving yet since the issue might have to do with our encoding (albeit that seems unlikely if String really just uses Bytes
under the hood).
c61f0e4
to
49a8f42
Compare
49a8f42
to
831336d
Compare
Marking as draft until I figure out what is wrong with my encoding. |
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.
Great work!
Mostly @iqdecay, I added some tests and fixed the encoding bug.
Adding an issue now. |
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
Note: this PR is dependent on Sway
v0.42
, and therefore will need #997 before being effective (fuel-core 0.19
).This PR closes #1011 by adding support for Sway's
std::string::String
type.ParamType
introduced here is calledParamType::StdString
becauseParamType::String
represents statically-sized Sway strings. I think it would be better to useString
for the dynamic type, andStaticString
for statically-sized ones, but I think this refactoring would make the PR less clear.I need to figure out what's wrong with how I encode theString
data, this is why the test is weird.