left-curve / grug

Grug
https://leftcurve.software/grug
44 stars 5 forks source link

Better IBC client entry points #13

Closed larry0x closed 2 weeks ago

larry0x commented 3 months ago

Currently, the IBC client entry point looks like this:

#[entry_point]
fn ibc_client_create(
    ctx: MutableCtx,
    client_state: Json,
    consensus_state: Json,
) -> Result<Response>;

Inside the function the developer needs to manually deserialize the Jsons. Ideally we do this in the #[entry_point] macro, so that the function signature becomes:

#[entry_point]
fn ibc_client_create(
    ctx: MutableCtx,
    client_state: ClientState,
    consensus_state: ConsensusState,
) -> Result<Response>;

where ClientState and ConsensusState are arbitrary types defined by the developer.

larry0x commented 2 weeks ago

Not planned any more. There won't be an ibc_client_create method. Just use instantiate.