Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement new golang TX client #10513

Closed
amaury1093 opened this issue Nov 9, 2021 · 4 comments
Closed

Implement new golang TX client #10513

amaury1093 opened this issue Nov 9, 2021 · 4 comments

Comments

@amaury1093
Copy link
Contributor

Problem

The existing client Tx is too confusing, and too tied to the CLI (TxFactory)

Solution

A new TxClient with a well thought out API. ref: #10496 (comment)

txClient := NewTxClient(...)

txClient.StartTx()
govMsgClient := gov.NewMsgClient(txClient)
res, err := govMsgClient.SubmitProposal(...)
if err != nil { ... }
err = txClient.ExecuteBlock()
if err != nil { ... }

// now res has been unmarshaled to MsgSubmitProposalResponse because we executed in block mode
// and we can do something with the proposal ID
txClient.StartTx()
govMsgClient.Deposit(MsgDeposit{ProposalId: res.ProposalId, ...})
...
@tac0turtle
Copy link
Member

this will more or less be covered by lens. Once dynamic cosmos is completed there we should opt to push people there

@amaury1093
Copy link
Contributor Author

Do you think we can replace all instances of our own TxBuilder with lens at some point? Also, wouldn't there be a circular dep sdk<->lens?

@tac0turtle
Copy link
Member

oh I thought you meant for external client use. For internal use we can create a simple api for this

@amaury1093
Copy link
Contributor Author

Yeah the title is confusing. Let's keep this issue closed, we can track this simple API in #8138

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants