revm_interpreter/instructions/
tx_info.rs1use crate::{
2 interpreter_types::{InterpreterTypes, RuntimeFlag, StackTr},
3 Host,
4};
5
6use crate::InstructionContext;
7
8pub fn gasprice<WIRE: InterpreterTypes, H: Host + ?Sized>(
12 context: InstructionContext<'_, H, WIRE>,
13) {
14 push!(context.interpreter, context.host.effective_gas_price());
15}
16
17pub fn origin<WIRE: InterpreterTypes, H: Host + ?Sized>(context: InstructionContext<'_, H, WIRE>) {
21 push!(
22 context.interpreter,
23 context.host.caller().into_word().into()
24 );
25}
26
27pub fn blob_hash<WIRE: InterpreterTypes, H: Host + ?Sized>(
31 context: InstructionContext<'_, H, WIRE>,
32) {
33 check!(context.interpreter, CANCUN);
34 popn_top!([], index, context.interpreter);
35 let i = as_usize_saturated!(index);
36 *index = context.host.blob_hash(i).unwrap_or_default();
37}