-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for ink!'s
version
metadata field (#641)
* Format `transcode`'s `lib.rs` * Use `InkProject` directly instead of `MetadataVersioned` * Patch ink dependencies to point to development branch * Use same nightly compiler as CI to format code * Use updated ink! dependences in template * Bump lockfile * Bump expected metadata version to V4 * Bump to V4 in a couple more places * Clear cache before running tests * Add missing colon * Looks like the directory doesn't want to be cleaned * Bump to ink! 4.0 pre-release * Bump ink! version * Remove metadata version check There's only one metadata version that can be constructed, so the check doesn't totally make sense. In the future if we support both V4 and V5 metadata formats it would make sense to add such a check back. * Appease Clippy * Move away from ink!'s `hc-versioned-metadata` branch * Remove metadata version check (again) There's only one metadata version that can be constructed, so the check doesn't totally make sense. In the future if we support both V4 and V5 metadata formats it would make sense to add such a check back. * RustFmt * Remove another irrefutable `if let` * Bump ink! versions to `4.0.0-alpha.1` * Deny `unused_crate_dependencies` again
- Loading branch information
Showing
5 changed files
with
49 additions
and
55 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
extern crate contract; | ||
|
||
extern "Rust" { | ||
fn __ink_generate_metadata() -> ink_metadata::MetadataVersioned; | ||
// Note: The ink! metdata codegen generates an implementation for this function, | ||
// which is what we end up linking to here. | ||
fn __ink_generate_metadata() -> ink_metadata::InkProject; | ||
} | ||
|
||
fn main() -> Result<(), std::io::Error> { | ||
let metadata = unsafe { __ink_generate_metadata() }; | ||
let contents = serde_json::to_string_pretty(&metadata)?; | ||
print!("{}", contents); | ||
Ok(()) | ||
let metadata = unsafe { __ink_generate_metadata() }; | ||
let contents = serde_json::to_string_pretty(&metadata)?; | ||
print!("{}", contents); | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters