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

Add METHOD_CONTENTS static const #244

Merged
merged 4 commits into from
Aug 25, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions risc0/zkvm/sdk/rust/build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,12 @@ impl Risc0Method {
let elf_path = self.elf_path.display();
let upper = self.name.to_uppercase();
let method_id = self.make_method_id(code_limit);
let elf_contents = std::fs::read(&self.elf_path).unwrap();
format!(
r##"
pub const {upper}_PATH: &'static str = r#"{elf_path}"#;
pub const {upper}_ID: &'static [u8] = &{method_id:?};
pub const {upper}_CONTENTS: &'static [u8] = &{elf_contents:?};
"##
)
}
Expand Down