revm_interpreter/instructions/
tx_info.rs1use crate::{
2 interpreter_types::{InterpreterTypes as ITy, RuntimeFlag, StackTr},
3 Host, InstructionContext as Ictx, InstructionExecResult as Result,
4};
5
6pub fn gasprice<IT: ITy, H: Host + ?Sized>(context: Ictx<'_, H, IT>) -> Result {
10 push!(context.interpreter, context.host.effective_gas_price());
11 Ok(())
12}
13
14pub fn origin<IT: ITy, H: Host + ?Sized>(context: Ictx<'_, H, IT>) -> Result {
18 push!(
19 context.interpreter,
20 context.host.caller().into_word().into()
21 );
22 Ok(())
23}
24
25pub fn blob_hash<IT: ITy, H: Host + ?Sized>(context: Ictx<'_, H, IT>) -> Result {
29 check!(context.interpreter, CANCUN);
30 popn_top!([], index, context.interpreter);
31 let i = as_usize_saturated!(*index);
32 *index = context.host.blob_hash(i).unwrap_or_default();
33 Ok(())
34}