dusk-network/canonical

Automatically derive interfaces for wasm module/contract definitions.

Closed this issue · 1 comments

krl commented

Goal:

Take this definition

#[derive(Clone, Canon, Default)]
pub struct Counter {
    value: i32,
}

#[derive(WasmModule)]
impl Counter {
    pub fn new(val: i32) -> Self { ... }
		
    pub fn read_value(&self) -> i32 { ... }

    pub fn increment(&mut self) { ... }
}

And create a module with two conditionally compiled versions. Have a look at the conditional compilation in the counter example.

A: The actual wasm, with two exports, "q" and "t", for query and transaction respectively.

B: A type with the same name, with static methods to create transactions and queries for this module.

(A + B): Shared static methods and data definitons, including static methods on the module type

krl commented

Deprecated, moved to dusk-network/rusk-vm#179