use crate::{
interpreter_types::{InterpreterTypes as ITy, RuntimeFlag, StackTr},
Host, InstructionContext as Ictx, InstructionExecResult as Result,
};
pub fn gasprice<IT: ITy, H: Host + ?Sized>(context: Ictx<'_, H, IT>) -> Result {
push!(context.interpreter, context.host.effective_gas_price());
Ok(())
}
pub fn origin<IT: ITy, H: Host + ?Sized>(context: Ictx<'_, H, IT>) -> Result {
push!(
context.interpreter,
context.host.caller().into_word().into()
);
Ok(())
}
pub fn blob_hash<IT: ITy, H: Host + ?Sized>(context: Ictx<'_, H, IT>) -> Result {
check!(context.interpreter, CANCUN);
popn_top!([], index, context.interpreter);
let i = as_usize_saturated!(*index);
*index = context.host.blob_hash(i).unwrap_or_default();
Ok(())
}