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

Helper binary for viewing function selectors #141

Merged
merged 3 commits into from
Aug 17, 2021
Merged

Helper binary for viewing function selectors #141

merged 3 commits into from
Aug 17, 2021

Conversation

sezna
Copy link
Contributor

@sezna sezna commented Aug 16, 2021

This is a small tool I just wrote to help validate @digorithm's spec. It is a bin package attached to core_lang which will parse a function declaration and return its function selector. Be gentle to it and don't be too fancy, the namespace is instantiated to be empty, so custom types and stuff don't work. Instead of stashing it or whatever, I thought it might be handy in the future, so here it is.

Usage

(in core_lang)

$ cargo run --features=selector-debug --bin selector-debug "fn entry_one(a: u64)"
selector string:         entry_one(u64)
untruncated hash:        0x0c36cb9cb766ff60422db243c4fff06d342949da3c64a3c6ac564941f84b6f06
truncated/padded hash:   0x000000000c36cb9c

@sezna sezna self-assigned this Aug 16, 2021
@sezna sezna changed the title Selector debug Helper binary for viewing function selectors Aug 17, 2021
@sezna sezna merged commit 233b6ed into master Aug 17, 2021
@sezna sezna deleted the selector_debug branch August 17, 2021 20:17
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

Successfully merging this pull request may close these issues.

4 participants