diff --git a/bindings.h b/bindings.h index 2a285e0..279a363 100644 --- a/bindings.h +++ b/bindings.h @@ -94,23 +94,18 @@ typedef struct GoApi_vtable { int32_t (*remove_storage)(const struct api_t*, struct U8SliceView, uint64_t*); int32_t (*block_number)(const struct api_t*, uint64_t*, uint64_t*); int32_t (*block_timestamp)(const struct api_t*, uint64_t*, int64_t*); - int32_t (*send)(const struct api_t*, struct U8SliceView, struct U8SliceView, uint64_t*, struct UnmanagedVector*); int32_t (*min_fee_per_gas)(const struct api_t*, uint64_t*, struct UnmanagedVector*); int32_t (*balance)(const struct api_t*, uint64_t*, struct UnmanagedVector*); int32_t (*block_seed)(const struct api_t*, uint64_t*, struct UnmanagedVector*); int32_t (*network_size)(const struct api_t*, uint64_t*, uint64_t*); int32_t (*burn)(const struct api_t*, struct U8SliceView, uint64_t*); int32_t (*epoch)(const struct api_t*, uint64_t*, uint16_t*); - int32_t (*contract_stake)(const struct api_t*, struct U8SliceView, uint64_t*, struct UnmanagedVector*); - int32_t (*move_to_stake)(const struct api_t*, struct U8SliceView, uint64_t*, struct UnmanagedVector*); - int32_t (*delegatee)(const struct api_t*, struct U8SliceView, uint64_t*, struct UnmanagedVector*); int32_t (*identity)(const struct api_t*, struct U8SliceView, uint64_t*, struct UnmanagedVector*); int32_t (*caller)(const struct api_t*, uint64_t*, struct UnmanagedVector*); int32_t (*original_caller)(const struct api_t*, uint64_t*, struct UnmanagedVector*); int32_t (*deduct_balance)(const struct api_t*, struct U8SliceView, uint64_t*, struct UnmanagedVector*); int32_t (*add_balance)(const struct api_t*, struct U8SliceView, struct U8SliceView, uint64_t*); int32_t (*contract)(const struct api_t*, uint64_t*, struct UnmanagedVector*); - int32_t (*contract_code)(const struct api_t*, struct U8SliceView, uint64_t*, struct UnmanagedVector*); int32_t (*call)(const struct api_t*, struct U8SliceView, struct U8SliceView, struct U8SliceView, struct U8SliceView, struct U8SliceView, uint64_t, uint64_t*, struct UnmanagedVector*); int32_t (*deploy)(const struct api_t*, struct U8SliceView, struct U8SliceView, struct U8SliceView, struct U8SliceView, uint64_t, uint64_t*, struct UnmanagedVector*); int32_t (*contract_addr)(const struct api_t*, struct U8SliceView, struct U8SliceView, struct U8SliceView, uint64_t*, struct UnmanagedVector*); diff --git a/src/backend.rs b/src/backend.rs index 7bcea5a..f8cae64 100644 --- a/src/backend.rs +++ b/src/backend.rs @@ -55,7 +55,6 @@ pub trait Backend: Copy + Clone + Send { fn deduct_balance(&self, amount: IDNA) -> BackendResult<()>; fn add_balance(&self, to: Address, amount: IDNA) ->u64; fn own_addr(&self) -> BackendResult
; - fn contract_code(&self, contract: Address) -> BackendResult>; fn contract_addr(&self, code: &[u8], args: &[u8], nonce: &[u8]) -> BackendResult
; fn deploy(&self, code : &[u8], args: &[u8], nonce: &[u8], amount: &[u8], gas_limit: u64) -> BackendResult; fn contract_addr_by_hash(&self, hash: &[u8], args: &[u8], nonce: &[u8]) -> BackendResult
; @@ -162,10 +161,6 @@ impl Backend for MockBackend { todo!() } - fn contract_code(&self, contract: Address) -> BackendResult> { - todo!() - } - fn contract_addr(&self, code: &[u8], args: &[u8], nonce: &[u8]) -> BackendResult
{ todo!() } diff --git a/src/exports.rs b/src/exports.rs index c8ea773..d690a46 100644 --- a/src/exports.rs +++ b/src/exports.rs @@ -54,13 +54,6 @@ pub struct GoApi_vtable { *mut u64, *mut i64, // result output ) -> i32, - pub send: extern "C" fn( - *const api_t, - U8SliceView, // to - U8SliceView, // amount - *mut u64, - *mut UnmanagedVector, // error - ) -> i32, pub min_fee_per_gas: extern "C" fn( *const api_t, *mut u64, @@ -91,24 +84,6 @@ pub struct GoApi_vtable { *mut u64, *mut u16, ) -> i32, - pub contract_stake: extern "C" fn( - *const api_t, - U8SliceView, // addr - *mut u64, - *mut UnmanagedVector, // result - ) -> i32, - pub move_to_stake: extern "C" fn( - *const api_t, - U8SliceView, // amount - *mut u64, - *mut UnmanagedVector, // output error - ) -> i32, - pub delegatee: extern "C" fn( - *const api_t, - U8SliceView, // addr - *mut u64, - *mut UnmanagedVector, // result - ) -> i32, pub identity: extern "C" fn( *const api_t, U8SliceView, // addr @@ -142,12 +117,6 @@ pub struct GoApi_vtable { *mut u64, *mut UnmanagedVector, // result ) -> i32, - pub contract_code: extern "C" fn( - *const api_t, - U8SliceView, // addr - *mut u64, - *mut UnmanagedVector, // result - ) -> i32, pub call: extern "C" fn( *const api_t, U8SliceView, // addr @@ -578,18 +547,6 @@ impl Backend for apiWrapper { (Ok(d), used_gas) } - fn contract_code(&self, contract: Address) -> BackendResult> { - let mut used_gas = 0_u64; - let mut data = UnmanagedVector::default(); - let go_result = (self.api.vtable.contract_code)(self.api.state, U8SliceView::new(Some(&contract)), &mut used_gas as *mut u64, &mut data as *mut UnmanagedVector); - check_go_result!(go_result, used_gas, "contract_code"); - let d = match data.consume() { - Some(v) => v, - None => Vec::new() - }; - (Ok(d), used_gas) - } - fn contract_addr(&self, code: &[u8], args: &[u8], nonce: &[u8]) -> BackendResult
{ let mut used_gas = 0_u64; let mut data = UnmanagedVector::default();