(semi-)working wasm contract

This commit is contained in:
x
2022-10-27 14:28:37 +00:00
committed by parazyd
parent e9dc3f36e1
commit f35fd6ab96
5 changed files with 52 additions and 35 deletions

View File

@@ -37,9 +37,11 @@ pub struct Args {
// Through here, you can branch out into different functions inside
// this library.
entrypoint!(process_instruction);
fn process_instruction(_state: &[u8], ix: &[u8]) -> ContractResult {
fn process_instruction(/*_state: &[u8], */ ix: &[u8]) -> ContractResult {
msg!("Hello from the VM runtime!");
// Deserialize the payload into `Args`.
let args: Args = deserialize(ix)?;
msg!("deserializing payload worked");
if args.a < args.b {
// Returning custom errors