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

Specify function selector string format and create a test suite for it #242

Open
digorithm opened this issue Dec 10, 2021 · 0 comments
Open
Labels
documentation Improvements or additions to documentation

Comments

@digorithm
Copy link
Member

As discussed FuelLabs/fuels-rs#17, we need to make sure every artifact that implements some sort of function selector string builder will follow the same specs and test their implementation against the same test suite.

For instance, a method called do_something that takes a custom type:

struct InputStruct {
    field_1: bool,
    field_2: u8
}

Should have the following function selector represented as string: do_something(s(bool,u8)). Which will then be 256-hashed and its first 4 bytes will be the final function selector.

We need a test suite/test vector with a decent coverage for this, so that whoever is implementing the same functionality can test against it.

@digorithm digorithm added the documentation Improvements or additions to documentation label Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant