Skip to content

Change the api to something that is more conducive to handling clients through dynamic dispatchย #43

@0xForerunner

Description

@0xForerunner

Currently there is no easy way to build on top of cosm-tome and generically handle different clients. I think the current method of bundling ChainConfig and a generic client T together inside CosmTome is not the best api. If I don't know which client I want to use at compile time there is no easy way to build on top. My suggestion is to completely do away with the CosmTome type and instead simply use extension traits. For every client that is CosmosClient we get all of the nice cosm_tome methods.

Here is an example of the current api

let client = CosmosgRPC::new(chain_info.grpc_endpoint.clone().unwrap());
let cosm_tome = CosmTome::new(chain_info, client);
let response = cosm_tome.wasm_execute(req, &key, &tx_options).await?;

and here is what it could look like with my suggested change

let client = CosmosgRPC::new(chain_info.grpc_endpoint.clone().unwrap());
let response = client.wasm_execute(chain_info, req, &key, &tx_options).await?;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions