calimero-network / core

Calimero 2.0
https://calimero-network.github.io/
Other
57 stars 8 forks source link

Wasm to submit proposals to the blockchain #877

Open alenmestrov opened 1 week ago

alenmestrov commented 1 week ago

Needed is a mechanism to register user-defined functionality to handle proposals.

This could be done along the following lines:

Blockchain::register_proposal_function(|recipient| {
    pending_op = {
        balance,
        signature
    }
    ctx_contract.call("modify_value", contractor, pending_op)
}

In the above, modify_value is the name of a method that HAS to be defined and present so it can be used over the bridge (just like other similar methods), and pending_op is data that is already serialized to JSON – i.e. a JSON String.

This could also be achieved in other ways providing the core functionality is achievable.

MatejVukosav commented 1 week ago

@danwilliams can u update description?