Skip to content
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

Overload + to Concat byte strings #496

Open
barnjamin opened this issue Aug 5, 2022 · 2 comments
Open

Overload + to Concat byte strings #496

barnjamin opened this issue Aug 5, 2022 · 2 comments
Labels
new-feature-request Feature request that needs triage Team Scytale

Comments

@barnjamin
Copy link
Contributor

Problem

Make it more natural to add byte strings

Solution

define the + operator on the abi.Bytes class to do concat

@barnjamin barnjamin added the new-feature-request Feature request that needs triage label Aug 5, 2022
@jasonpaulos
Copy link
Contributor

A large barrier to this is the fact that we need to know at compile time whether the types are bytes or uint64 -- if bytes, use concat; if uint64, use +. But there are situations in which we cannot know the type of a value at compile time, e.g. when reading from local/global state, when loading the scratch space from a previous transaction, or (and this is something we have the power to fix) when accepting an Expr subroutine argument.

@ahangsu
Copy link
Contributor

ahangsu commented Aug 5, 2022

Another issue I am aware of deriving from #369, how are we handling case for Bytes("bytes-a") + Bytes("bytes-b")? Do we expect resulting to be Bytes("bytes-abytes-b"), or something else? I remembered we contain quote sign in bytes tho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature-request Feature request that needs triage Team Scytale
Projects
None yet
Development

No branches or pull requests

4 participants