mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix: Fix out-of-gas logic
This commit is contained in:
@ -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())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user