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

Unable to use hex literals in call #522

Closed
HCastano opened this issue Apr 22, 2022 · 0 comments · Fixed by #547
Closed

Unable to use hex literals in call #522

HCastano opened this issue Apr 22, 2022 · 0 comments · Fixed by #547
Labels
enhancement New feature or request

Comments

@HCastano
Copy link
Contributor

I have an ink! method with the following signature:

type Foo {
    selector: [u8; 4],
}

fn bar(&mut self, f: Foo)

When using cargo-contract to supply the argument I have to use the decimal
representation for the bytes:

cargo contract call \
     --contract ... \
     --message bar \
     --args "Foo { selector: [123, 456, 789, 987] }" \
     --suri ... \

I'd like the option to use hex literals as well:

cargo contract call \
     --contract ... \
     --message bar \
     --args "Foo { selector: [0xAB, 0xCD, 0xEF, 0xGH] }" \
     --suri ... \

This is how ink! mainly deals with selectors, so it would make it more consistent for
users.

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

Successfully merging a pull request may close this issue.

1 participant