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
ink! ABI #104
Conversation
Codecov Report
@@ Coverage Diff @@
## master #104 +/- ##
==========================================
- Coverage 85.83% 79.67% -6.16%
==========================================
Files 61 67 +6
Lines 4899 4975 +76
==========================================
- Hits 4205 3964 -241
- Misses 694 1011 +317
Continue to review full report at Codecov.
|
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.
WIP review: done the abi
crate so far.
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.
First pass done. Looks good overall, just a few minor things. And the examples failing to build.
unreachable!("invalid arg name encountered") | ||
} | ||
} | ||
_ => unreachable!("encountered invalid argument syntax: the only allowed is `ident : type`"), |
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.
Identical code block to above in generate_abi_deploy_handler
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 examples still not building (on my machine) with:
error[E0412]: cannot find type `Vec` in this scope
--> /home/andrew/code/paritytech/ink/abi/src/specs.rs:457:28
|
457 | .collect::<Vec<_>>(),
| ^^^ not found in this scope
help: possible candidates are found in other modules, you can import them into scope
|
17 | use alloc::prelude::v1::Vec;
|
17 | use alloc::vec::Vec;
|
17 | use serde::export::Vec;
|
…ink-generate-abi feature
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.
LGTM! 🌮
🍰 |
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.
🥇
Prototype implementation of ink! meta data.
This will eventually replace the current system of API description generation.
ink_abi
will be the library behind the two-phase ABI file generation and provides the data structures and serialization routines that are going to be constructed byink_lang
during compilation of a smart contract.It can handle type aliases, differentiate types with the same name.
Future plans are to also integrate storage layout description as well as custom type layout description into it.
TODO
type-metadata
crate for handling runtime type information.ink_abi
sub-crate providing traits and mechanics for ABI generation.ink_abi
trait implementations intoink_core
.ink_cli
template for ink! smart contract generation.ink_lang
Implement 2-phase ABI generation procedure in(not needed with chosen design)cargo-contract
generate-api-description
crate feature)HasLayout
ink_abi
project structureink_lang
testsink_abi
.tool
directory to.ink
? (same as.git
)= \"
and\"
as start and end respectively.ExecEnv<State>
instead of directly takingState
test-env
crate feature has to be enabled forink-generate-abi
Code currently generated for Flipper example contract:
Metadata created for the Flipper example contract: