pub struct NeoContractRuntime;Expand description
Neo N3 contract management operations.
These are test/example stubs. In deployed contracts, the #[neo_contract]
macro generates Wasm imports that map to NeoVM syscalls
(System.Contract.Create, System.Contract.Update, System.Contract.Call).
The methods here allow compiling and unit-testing contract code off-chain.
create()returns a zero-filled 20-byte hash (placeholder script hash).update()anddestroy()succeed immediately with no side effects.call()always returnsNeoValue::Null.
Implementations§
Source§impl NeoContractRuntime
impl NeoContractRuntime
Sourcepub fn create(
script: &NeoByteString,
manifest: &NeoContractManifest,
) -> NeoResult<NeoByteString>
pub fn create( script: &NeoByteString, manifest: &NeoContractManifest, ) -> NeoResult<NeoByteString>
Deploy a new contract. Returns a placeholder 20-byte script hash.
Sourcepub fn update(
_script_hash: &NeoByteString,
script: &NeoByteString,
manifest: &NeoContractManifest,
) -> NeoResult<()>
pub fn update( _script_hash: &NeoByteString, script: &NeoByteString, manifest: &NeoContractManifest, ) -> NeoResult<()>
Update an existing contract’s script and manifest.
Sourcepub fn destroy(script_hash: &NeoByteString) -> NeoResult<()>
pub fn destroy(script_hash: &NeoByteString) -> NeoResult<()>
Destroy a contract.
Auto Trait Implementations§
impl Freeze for NeoContractRuntime
impl RefUnwindSafe for NeoContractRuntime
impl Send for NeoContractRuntime
impl Sync for NeoContractRuntime
impl Unpin for NeoContractRuntime
impl UnsafeUnpin for NeoContractRuntime
impl UnwindSafe for NeoContractRuntime
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more