Impl difficulty opcode for interpreter

This commit is contained in:
Robin Salen 2023-04-07 18:28:59 -04:00
parent 60fed608ef
commit 86bd055b5f
No known key found for this signature in database
GPG Key ID: FB87BACFB3CB2007

View File

@ -351,7 +351,7 @@ impl<'a> Interpreter<'a> {
0x41 => todo!(), // "COINBASE",
0x42 => self.run_timestamp(), // "TIMESTAMP",
0x43 => self.run_number(), // "NUMBER",
0x44 => todo!(), // "DIFFICULTY",
0x44 => self.run_difficulty(), // "DIFFICULTY",
0x45 => todo!(), // "GASLIMIT",
0x46 => todo!(), // "CHAINID",
0x48 => todo!(), // "BASEFEE",
@ -667,6 +667,10 @@ impl<'a> Interpreter<'a> {
self.push(self.get_global_metadata_field(GlobalMetadata::BlockNumber))
}
fn run_difficulty(&mut self) {
self.push(self.get_global_metadata_field(GlobalMetadata::BlockDifficulty))
}
fn run_prover_input(&mut self) -> anyhow::Result<()> {
let prover_input_fn = self
.prover_inputs_map