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

fix(sdkclient): acc sequence setting #2375

Merged
merged 3 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ Ref: https://keepachangelog.com/en/1.0.0/

- [2358](https://github.com/umee-network/umee/pull/2358) metoken endblocker should be before oracle.
- [2368](https://github.com/umee-network/umee/pull/2368) Add inflow amount to registered token. Previously, the inflow amount of the token was being overridden by the new inflow amount.
- [2375](https://github.com/umee-network/umee/pull/2375) Ensure Umee and SDK account sequence setting changes the calling client.

robert-zaremba marked this conversation as resolved.
Show resolved Hide resolved
### API Breaking

- [2375](https://github.com/umee-network/umee/pull/2375) Rename Umee and SDK client `WithAccSeq` to `SetAccSeq`.

## v6.2.0 - 2023-12-01

Expand Down
4 changes: 2 additions & 2 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ func NewClient(
}, nil
}

func (c Client) WithAccSeq(seq uint64) {
c.Client.Tx = c.Client.Tx.WithAccSeq(seq)
func (c Client) SetAccSeq(seq uint64) {
c.Client.Tx.SetAccSeq(seq)
}

func (c Client) NewQCtx() (context.Context, context.CancelFunc) {
Expand Down
5 changes: 2 additions & 3 deletions sdkclient/tx/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,8 @@ func (c *Client) BroadcastTx(idx int, msgs ...sdk.Msg) (*sdk.TxResponse, error)
return BroadcastTx(cctx, f, msgs...)
}

func (c *Client) WithAccSeq(seq uint64) *Client {
c.txFactory.WithSequence(seq)
return c
func (c *Client) SetAccSeq(seq uint64) {
*c.txFactory = c.txFactory.WithSequence(seq)
}

func (c *Client) WithAsyncBlock() *Client {
Expand Down
2 changes: 1 addition & 1 deletion sdkclient/tx/wasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (c *Client) WasmExecContractWithAccSeq(contractAddr string, execMsg []byte,
Msg: execMsg,
}
if accSeq != 0 {
return c.WithAccSeq(accSeq).BroadcastTx(fromIdx, &msg)
c.SetAccSeq(accSeq)
}
return c.BroadcastTx(fromIdx, &msg)
}
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/setup/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ func (s *E2ETestSuite) BroadcastTxWithRetry(msg sdk.Msg, cli client.Client) erro
if err != nil {
return err
}
cli.WithAccSeq(uint64(n))
cli.SetAccSeq(uint64(n))

time.Sleep(time.Millisecond * 300)
}
Expand Down
Loading