cli icon indicating copy to clipboard operation
cli copied to clipboard

`cosmosclient`: improve account prefix management for txs

Open lumtis opened this issue 3 years ago • 3 comments

We are currently updating the SDK global config for the address prefix everytime before sending a transaction: cli/ignite/pkg/cosmosclient/cosmosclient.go Or also when the client is created in https://github.com/ignite/cli/pull/2743

This method is a bit unclean as we must interact with global vars...

This method is kind of impose by the current structure of the SDK since it relies on the global config to parse the prefix when determining the address of an account.

The first step of this issue is to design and propose an issue in the SDK repo more flexibility to manage account prefix without relying on a global configuration. For example: Adding accountPrefix as attribute of transaction factory type: https://github.com/cosmos/cosmos-sdk/blob/1932ef175da024cf4abb5d91e03a590625320eee/client/tx/factory.go#L23

lumtis avatar Aug 12 '22 09:08 lumtis

Couldn't agree more, dealing with the sdkconfig for prefix changes is painful in cosmosclient.

tbruyelle avatar Aug 12 '22 10:08 tbruyelle