-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(runtime): add metadata signed-extension
Add a new signed extension that enables the metadata hash verification feature approved under [RFC 0078](https://polkadot-fellows.github.io/RFCs/approved/0078-merkleized-metadata.html#rfc-0078-merkleized-metadata). This enhancement will support the new generic ledger hardware wallet app and future hardware wallets within the Polkadot ecosystem.
- Loading branch information
Showing
7 changed files
with
94 additions
and
8 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
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
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,26 @@ | ||
use substrate_wasm_builder::WasmBuilder; | ||
#[cfg(all(feature = "std", feature = "metadata-hash"))] | ||
fn main() { | ||
substrate_wasm_builder::WasmBuilder::init_with_defaults() | ||
.enable_metadata_hash("FRQCY", 8) | ||
.build(); | ||
|
||
substrate_wasm_builder::WasmBuilder::init_with_defaults() | ||
.set_file_name("fast_runtime_binary.rs") | ||
.enable_feature("fast-runtime") | ||
.enable_metadata_hash("FRQCY", 8) | ||
.build(); | ||
} | ||
|
||
#[cfg(all(feature = "std", not(feature = "metadata-hash")))] | ||
fn main() { | ||
// VSCode Users: Uncomment the following line to disable the ANSI color codes. | ||
// The OUTPUT pane does not understand ANSI color codes and will show garbage without this. | ||
// std::env::set_var("WASM_BUILD_NO_COLOR", "1"); | ||
WasmBuilder::new() | ||
substrate_wasm_builder::WasmBuilder::new() | ||
.with_current_project() | ||
.export_heap_base() | ||
.import_memory() | ||
.build() | ||
.build(); | ||
} | ||
|
||
/// The wasm builder is deactivated when compiling | ||
/// this crate for wasm to speed up the compilation. | ||
#[cfg(not(feature = "std"))] | ||
fn main() {} |
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