Skip to main content

neo_runtime/
contract.rs

1use neo_types::*;
2
3/// Minimal representation of contract management utilities used in tests.
4pub struct NeoContractRuntime;
5
6impl NeoContractRuntime {
7    pub fn create(
8        script: &NeoByteString,
9        _manifest: &NeoContractManifest,
10    ) -> NeoResult<NeoByteString> {
11        let mut data = script.as_slice().to_vec();
12        data.extend_from_slice(&[0x01, 0x02, 0x03]);
13        Ok(NeoByteString::new(data))
14    }
15
16    pub fn update(
17        _script_hash: &NeoByteString,
18        _script: &NeoByteString,
19        _manifest: &NeoContractManifest,
20    ) -> NeoResult<()> {
21        Ok(())
22    }
23
24    pub fn destroy(_script_hash: &NeoByteString) -> NeoResult<()> {
25        Ok(())
26    }
27
28    pub fn call(
29        _script_hash: &NeoByteString,
30        _method: &NeoString,
31        _args: &NeoArray<NeoValue>,
32    ) -> NeoResult<NeoValue> {
33        Ok(NeoValue::Null)
34    }
35}