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());
16}
17
18pub fn origin<WIRE: InterpreterTypes, H: Host + ?Sized>(context: InstructionContext<'_, H, WIRE>) {
22    push!(
24        context.interpreter,
25        context.host.caller().into_word().into()
26    );
27}
28
29pub fn blob_hash<WIRE: InterpreterTypes, H: Host + ?Sized>(
33    context: InstructionContext<'_, H, WIRE>,
34) {
35    check!(context.interpreter, CANCUN);
36    popn_top!([], index, context.interpreter);
38    let i = as_usize_saturated!(index);
39    *index = context.host.blob_hash(i).unwrap_or_default();
40}