feat(soroban): support bytesN as function parameters and return values#1908
Open
aryanbaranwal001 wants to merge 6 commits into
Open
feat(soroban): support bytesN as function parameters and return values#1908aryanbaranwal001 wants to merge 6 commits into
aryanbaranwal001 wants to merge 6 commits into
Conversation
… and codec Signed-off-by: Aryan Baranwal <aryanbaranwal131214@gmail.com>
Signed-off-by: Aryan Baranwal <aryanbaranwal131214@gmail.com>
…alues Signed-off-by: Aryan Baranwal <aryanbaranwal131214@gmail.com>
Signed-off-by: Aryan Baranwal <aryanbaranwal131214@gmail.com>
Signed-off-by: Aryan Baranwal <aryanbaranwal131214@gmail.com>
…, bytes32 Signed-off-by: Aryan Baranwal <aryanbaranwal131214@gmail.com>
Author
|
This PR is continuation of the work in #1904 and depends on it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds support for
bytesN(bytes1–bytes32) solidity function parameters or return types for the Soroban target. The following now compiles to valid WASM and round trips through the host.Key Changes
codegen/encoding/soroban_encoding.rs: addedType::Bytes(n)arms tosoroban_decode_argandsoroban_encode_arg. All1 ≤ n ≤ 32route throughBytesObjectviabytes_copy_to_linear_memory(decode) andbytes_new_from_linear_memory(encode), matchingsoroban-sdk'sBytesN<N>wire format.Tests
tests/soroban_testcases/bytes_n_codec.rscovering narrow, non-natural, and wide LLVM integer widths.