vm ext ret function used u256 instead of u64

This commit is contained in:
debris
2016-01-13 22:16:24 +01:00
parent 360e667a64
commit 48e74e5874
5 changed files with 11 additions and 11 deletions

View File

@@ -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.

View File

@@ -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()))

View File

@@ -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!();
}