diff --git a/src/lib.rs b/src/lib.rs index 566e678..d4ce679 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -109,7 +109,6 @@ type StorageKey = Bytes32; type StorageValue = Bytes32; type Topic = Bytes32; type Hash = Bytes32; -// TODO: is this a number of a bytestring? type Difficulty = Bytes32; /// Enum representing an error code for EEI calls. Currently used by `codeCopy`, `callDataCopy`, @@ -411,19 +410,19 @@ pub fn call_static(gas_limit: u64, address: &Address, data: &[u8]) -> CallResult /// Creates a contract with the the given code, sending the specified ether value to its address. pub fn create(value: &EtherValue, data: &[u8]) -> CreateResult { - let mut result: Address = Address::default(); + let mut address: Address = Address::default(); let ret = unsafe { native::ethereum_create( value.bytes.as_ptr() as *const u32, data.as_ptr() as *const u32, data.len() as u32, - result.bytes.as_mut_ptr() as *const u32, + address.bytes.as_mut_ptr() as *const u32, ) }; match ret { - 0 => CreateResult::Successful(result), + 0 => CreateResult::Successful(address), 1 => CreateResult::Failure, 2 => CreateResult::Revert, _ => panic!(), @@ -619,7 +618,7 @@ pub fn storage_load(key: &StorageKey) -> StorageValue { unsafe { native::ethereum_storageLoad( - key.bytes.as_ptr() as *const u32, + key.bytes.as_mut_ptr() as *const u32, ret.bytes.as_mut_ptr() as *const u32, ); }