vm ext ret function used u256 instead of u64
This commit is contained in:
@@ -48,7 +48,7 @@ pub trait Ext {
|
||||
|
||||
/// Should be called when transaction calls `RETURN` opcode.
|
||||
/// Returns gas_left if cost of returning the data is not too high.
|
||||
fn ret(&mut self, gas: u64, data: &[u8]) -> Result<u64, Error>;
|
||||
fn ret(&mut self, gas: &U256, data: &[u8]) -> Result<U256, Error>;
|
||||
|
||||
/// Should be called when contract commits suicide.
|
||||
/// Address to which funds should be refunded.
|
||||
|
||||
@@ -345,7 +345,7 @@ impl evm::Evm for JitEvm {
|
||||
|
||||
match res {
|
||||
evmjit::ReturnCode::Stop => Ok(U256::from(context.gas_left())),
|
||||
evmjit::ReturnCode::Return => ext.ret(context.gas_left(), context.output_data()).map(|gas_left| U256::from(gas_left)),
|
||||
evmjit::ReturnCode::Return => ext.ret(&U256::from(context.gas_left()), context.output_data()),
|
||||
evmjit::ReturnCode::Suicide => {
|
||||
ext.suicide(&Address::from_jit(&context.suicide_refund_address()));
|
||||
Ok(U256::from(context.gas_left()))
|
||||
|
||||
@@ -68,7 +68,7 @@ impl Ext for FakeExt {
|
||||
});
|
||||
}
|
||||
|
||||
fn ret(&mut self, _gas: u64, _data: &[u8]) -> result::Result<u64, evm::Error> {
|
||||
fn ret(&mut self, _gas: &U256, _data: &[u8]) -> result::Result<U256, evm::Error> {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user