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

Programmable Txs without enforcing input usage #8776

Closed
kchalkias opened this issue Mar 2, 2023 · 6 comments
Closed

Programmable Txs without enforcing input usage #8776

kchalkias opened this issue Mar 2, 2023 · 6 comments
Assignees

Comments

@kchalkias
Copy link
Collaborator

kchalkias commented Mar 2, 2023

Useful for registering a memo in the blockchain (retrievable from archival node)

@fum-is-chum
Copy link

Hey @kchalkias @tnowacki I've tried this feature to send memo in a transaction
https://suivision.xyz/txblock/Aj9Q49XTgAZgcSe97fD1oSrw4wVzwPFKK539PNd29scD

Current behavior is the string will be parsed as array of decimal
image

I've done some experiments and in order to parse the string as string, we need to use the input inside a movecall like this one
https://testnet.suivision.xyz/txblock/HAjFNx3rxGWdkBcSdFZM5oKgNwYroP7WTW2Dz35TYbMh
image

Is there any way to do this without using movecall?

@tnowacki
Copy link
Contributor

Are you using suivision to build your transactions? If so, it might be an issue on their end?

As far as the network is concerned, pure (non-object) arguments get passed in as an array of bytes. Those bytes are then deserialized via BCS to the specified Move value (depending on what command is used). Or they are left alone as bytes if never used.

@fum-is-chum
Copy link

Yeah, what I am trying to say is, is there any way to deserialized the input into string without using it into a movecall arguments?

@tnowacki
Copy link
Contributor

is there any way to deserialized the input into string without using it into a movecall arguments

There is not, but what is your usage for that case?

@fum-is-chum
Copy link

Just trying to provide a UI tool to allow user to send transaction with memo, and it will be great if there is a standardized way to do it

@tnowacki
Copy link
Contributor

They can just send the bytes for the memo. No issue there.

If they want to enforce it to be a utf8 string, they can call std::string::utf8. I don't see the benefit of adding a way to enforce its a utf8 string without just calling the function that does so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants