Impl chain_id opcode for interpreter

This commit is contained in:
Robin Salen 2023-04-07 18:32:42 -04:00
parent ae8ee27eb8
commit 9e6f284b26
No known key found for this signature in database
GPG Key ID: FB87BACFB3CB2007

View File

@ -353,7 +353,7 @@ impl<'a> Interpreter<'a> {
0x43 => self.run_number(), // "NUMBER",
0x44 => self.run_difficulty(), // "DIFFICULTY",
0x45 => todo!(), // "GASLIMIT",
0x46 => todo!(), // "CHAINID",
0x46 => self.run_chainid(), // "CHAINID",
0x48 => self.run_basefee(), // "BASEFEE",
0x49 => self.run_prover_input()?, // "PROVER_INPUT",
0x50 => self.run_pop(), // "POP",
@ -679,6 +679,10 @@ impl<'a> Interpreter<'a> {
self.push(self.get_global_metadata_field(GlobalMetadata::BlockBaseFee))
}
fn run_chainid(&mut self) {
self.push(self.get_global_metadata_field(GlobalMetadata::BlockChainId))
}
fn run_prover_input(&mut self) -> anyhow::Result<()> {
let prover_input_fn = self
.prover_inputs_map