Skip to content

Commit

Permalink
panic on preimage oracle use
Browse files Browse the repository at this point in the history
  • Loading branch information
martyall committed Jan 14, 2025
1 parent 3a1ebb9 commit 176c9a2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions o1vm/src/preimage_oracle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::cannon::{
PREIMAGE_CLIENT_READ_FD, PREIMAGE_CLIENT_WRITE_FD,
};
use command_fds::{CommandFdExt, FdMapping};
use log::debug;
//use log::debug;
use os_pipe::{PipeReader, PipeWriter};
use std::{
io::{Read, Write},
Expand All @@ -20,7 +20,9 @@ pub struct PreImageOracle {
}

pub trait PreImageOracleT {
fn get_preimage(&mut self, key: [u8; 32]) -> Preimage;
fn get_preimage(&mut self, key: [u8; 32]) -> Preimage {
panic!("This function is not being used {}", hex::encode(key))
}

fn hint(&mut self, hint: Hint);
}
Expand Down Expand Up @@ -166,6 +168,7 @@ impl PreImageOracleT for PreImageOracle {
// +---------------------------------+
// a. a 64-bit integer indicating the length of the actual data
// b. the preimage data, with a size of <length> bits
/*
fn get_preimage(&mut self, key: [u8; 32]) -> Preimage {
let RW(ReadWrite { reader, writer }) = &mut self.oracle_client;
Expand Down Expand Up @@ -195,7 +198,7 @@ impl PreImageOracleT for PreImageOracle {
assert_eq!(preimage.len(), length as usize);
Preimage::create(preimage)
}
} */

// The hint protocol goes as follows:
// 1. Write a hint request with the following byte-stream format
Expand Down

0 comments on commit 176c9a2

Please sign in to comment.