fix: Fix out-of-gas logic

This commit is contained in:
sprites0
2025-04-21 06:16:32 +00:00
parent abfd8656c3
commit f9ee4a3197

View File

@ -63,7 +63,12 @@ impl<CTX: ContextTr> PrecompileProvider for ReplayPrecompile<CTX> {
result.output = bytes.clone(); result.output = bytes.clone();
Ok(Some(result)) Ok(Some(result))
} }
ReadPrecompileResult::OutOfGas => Err(PrecompileError::OutOfGas.into()), ReadPrecompileResult::OutOfGas => {
// Use all the gas passed to this precompile
result.gas.spend_all();
result.result = InstructionResult::OutOfGas;
Ok(Some(result))
}
ReadPrecompileResult::Error => { ReadPrecompileResult::Error => {
Err(PrecompileError::other("precompile failed").into()) Err(PrecompileError::other("precompile failed").into())
} }