Removing value from delegatecall function

This commit is contained in:
Tomusdrw 2016-01-20 17:01:58 +01:00
parent aa0760597b
commit 8084e1b6d7
5 changed files with 5 additions and 9 deletions

View File

@ -68,7 +68,6 @@ pub trait Ext {
/// and true if subcall was successfull.
fn delegatecall(&mut self,
gas: &U256,
value: &U256,
data: &[u8],
code_address: &Address,
output: &mut [u8]) -> MessageCallResult;

View File

@ -569,8 +569,6 @@ impl Interpreter {
let code_address = stack.pop_back();
let code_address = u256_to_address(&code_address);
let value = params.value;
let in_off = stack.pop_back();
let in_size = stack.pop_back();
let out_off = stack.pop_back();
@ -587,7 +585,7 @@ impl Interpreter {
// and we don't want to copy
let input = unsafe { ::std::mem::transmute(mem.read_slice(in_off, in_size)) };
let output = mem.writeable_slice(out_off, out_size);
ext.delegatecall(&call_gas, &value, input, &code_address, output)
ext.delegatecall(&call_gas, input, &code_address, output)
};
return match call_result {

View File

@ -71,7 +71,6 @@ impl Ext for FakeExt {
fn delegatecall(&mut self,
_gas: &U256,
_value: &U256,
_data: &[u8],
_address: &Address,
_output: &mut [u8]) -> MessageCallResult {

View File

@ -18,6 +18,7 @@ pub enum OutputPolicy<'a> {
/// Transaction properties that externalities need to know about.
pub struct OriginInfo {
sender: Address,
value: U256,
address: Address,
origin: Address,
gas_price: U256
@ -28,6 +29,7 @@ impl OriginInfo {
pub fn from(params: &ActionParams) -> Self {
OriginInfo {
sender: params.sender.clone(),
value: params.value.clone(),
address: params.address.clone(),
origin: params.origin.clone(),
gas_price: params.gas_price.clone()
@ -134,7 +136,6 @@ impl<'a> Ext for Externalities<'a> {
fn delegatecall(&mut self,
gas: &U256,
value: &U256,
data: &[u8],
code_address: &Address,
output: &mut [u8]) -> MessageCallResult {
@ -146,7 +147,7 @@ impl<'a> Ext for Externalities<'a> {
origin: self.origin_info.origin.clone(),
gas: *gas,
gas_price: self.origin_info.gas_price.clone(),
value: value.clone(),
value: self.origin_info.value.clone(),
is_value_transfer: false,
code: self.state.code(code_address),
data: Some(data.to_vec()),

View File

@ -117,7 +117,6 @@ impl<'a> Ext for TestExt<'a> {
fn delegatecall(&mut self,
gas: &U256,
value: &U256,
data: &[u8],
_code_address: &Address,
_output: &mut [u8]) -> MessageCallResult {
@ -126,7 +125,7 @@ impl<'a> Ext for TestExt<'a> {
data: data.to_vec(),
destination: None,
gas_limit: *gas,
value: *value
value: U256::zero()
});
MessageCallResult::Success(*gas)
}