-
Notifications
You must be signed in to change notification settings - Fork 249
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
ABI embedding #893
ABI embedding #893
Conversation
b25a2d3
to
b833048
Compare
I have tried this flow and seems to work fine, great job @miraclx! I have a couple of questions though:
|
No reason, that's a placeholder that I hoped would be descriptive enough. But we can discuss this. I'm open to changing it.
Hm, but It's not hidden though. Unless I misunderstand. You can call the function inspite of dev console. So far you know the
Uhh, that's a good question. Well, the function signature is simple enough to not require being inspected at generation time, so it's technically possible to inject that post ABI generation. But would we have to add definitions for the return type? And have |
I am specifically referring to the UPD: On second thought it does increase the chances of someone already having a function named
It would technically be impossible to describe ABI file inside itself (unless we exclude the JSON Schema part) and the usefulness of it would be questionable at best anyway. So yeah a bunch of bytes sounds good to me. |
Yeah, exactly. Was just working on returning a neat error when someone uses the
|
Well, unlike us, they don't then go and add these schemas to their codebase, making what they originally derived invalid :) |
error: use of reserved contract method
--> src/lib.rs:43:12
|
43 | pub fn __contract_abi(&self) -> &str {
| ^^^^^^^^^^^^^^
error: could not compile `abi` due to previous error |
.to_compile_error(), | ||
); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but just noting that this would technically be a breaking change. Probably not big enough deal to warrant going into 5.x though.
Based off #889.
Implements functionality for embedding ABI into the contract.
Related: near/cargo-near#31