Skip to content

Commit

Permalink
fix(fixtures): disable counter contract build script, opcodes input path
Browse files Browse the repository at this point in the history
  • Loading branch information
rymnc committed Dec 4, 2024
1 parent e5da866 commit 9defcbd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
11 changes: 6 additions & 5 deletions fuel-zkvm-primitives-test-fixtures/build/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mod counter_contract;
// mod counter_contract;
mod opcodes;
mod utils;

Expand All @@ -9,10 +9,11 @@ pub async fn main() {
return;
}

counter_contract::generate_fixture()
.await
.expect("Failed to generate fixture");
// TODO: fix bug in abigen, uses workspace root instead of current directory for path
// counter_contract::generate_fixture()
// .await
// .expect("Failed to generate fixture for counter contract");
opcodes::generate_fixture()
.await
.expect("Failed to generate fixture");
.expect("Failed to generate fixture for opcodes");
}
2 changes: 1 addition & 1 deletion fuel-zkvm-primitives-test-fixtures/src/fixtures.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::mainnet_blocks::{get_mainnet_block_input, MainnetBlocks};
use crate::opcodes::get_opcode_input;
use clap::builder::PossibleValue;
use clap::ValueEnum;
use fuel_zkvm_primitives_utils::vm::Instruction;
use std::sync::OnceLock;
use crate::opcodes::get_opcode_input;

static FIXTURE_VARIANTS: OnceLock<Vec<Fixture>> = OnceLock::new();

Expand Down
8 changes: 6 additions & 2 deletions fuel-zkvm-primitives-test-fixtures/src/opcodes.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#![allow(unused)]

pub use fuel_zkvm_primitives_utils::vm::Instruction;
use std::env;
use std::path::Path;

pub fn get_opcode_input(instruction: Instruction) -> Vec<u8> {
let file_path = format!("src/fixtures/opcodes/{:?}.bin", instruction);
let serialized_input = std::fs::read(Path::new(&file_path)).unwrap();
let path = env::current_dir().unwrap();
path.join("fixtures")
.join("opcodes")
.join(format!("{:?}.bin", instruction));
let serialized_input = std::fs::read(path).unwrap();
serialized_input
}

Expand Down

0 comments on commit 9defcbd

Please sign in to comment.