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

test: add NodeURI for clientCtx #18930

Merged
merged 3 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (staking) [#18506](https://github.com/cosmos/cosmos-sdk/pull/18506) Detect the length of the ed25519 pubkey in CreateValidator to prevent panic.
* (tx) [#18772](https://github.com/cosmos/cosmos-sdk/pull/18772) Remove misleading gas wanted from tx simulation failure log.
* (tx) [#18852](https://github.com/cosmos/cosmos-sdk/pull/18852) Add `WithFromName` to tx factory.
* (testutil) [#18930](https://github.com/cosmos/cosmos-sdk/pull/18930) Add NodeURI for clientCtx.

### Bug Fixes

Expand Down
3 changes: 2 additions & 1 deletion testutil/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,8 @@
WithAccountRetriever(cfg.AccountRetriever).
WithAddressCodec(cfg.AddressCodec).
WithValidatorAddressCodec(cfg.ValidatorAddressCodec).
WithConsensusAddressCodec(cfg.ValidatorAddressCodec)
WithConsensusAddressCodec(cfg.ValidatorAddressCodec).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The WithConsensusAddressCodec method is incorrectly assigned cfg.ValidatorAddressCodec instead of cfg.ConsensusAddressCodec. This needs to be corrected to match the intended configuration.

- WithConsensusAddressCodec(cfg.ValidatorAddressCodec).
+ WithConsensusAddressCodec(cfg.ConsensusAddressCodec).

Committable suggestion

IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
WithConsensusAddressCodec(cfg.ValidatorAddressCodec).
WithConsensusAddressCodec(cfg.ConsensusAddressCodec).

Copy link
Member

@julienrbrt julienrbrt Jan 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bot is right about this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad, but is it ok to port back to 0.47.x as well since we have some test need it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You haven't introduced this, and it is only was an issue on main (address codecs aren't in the context in earlier versions).
Looks fine to backport this PR however.

WithNodeURI(tmCfg.RPC.ListenAddress)

Check failure on line 561 in testutil/network/network.go

View workflow job for this annotation

GitHub Actions / dependency-review

undefined: tmCfg

Check failure on line 561 in testutil/network/network.go

View workflow job for this annotation

GitHub Actions / golangci-lint

undefined: tmCfg (typecheck)

Check failure on line 561 in testutil/network/network.go

View workflow job for this annotation

GitHub Actions / golangci-lint

undefined: tmCfg) (typecheck)

Check failure on line 561 in testutil/network/network.go

View workflow job for this annotation

GitHub Actions / golangci-lint

undefined: tmCfg) (typecheck)

Check failure on line 561 in testutil/network/network.go

View workflow job for this annotation

GitHub Actions / golangci-lint

undefined: tmCfg) (typecheck)

Check failure on line 561 in testutil/network/network.go

View workflow job for this annotation

GitHub Actions / golangci-lint

undefined: tmCfg) (typecheck)

Check failure on line 561 in testutil/network/network.go

View workflow job for this annotation

GitHub Actions / tests (00)

undefined: tmCfg

Check failure on line 561 in testutil/network/network.go

View workflow job for this annotation

GitHub Actions / tests (00)

undefined: tmCfg

Check failure on line 561 in testutil/network/network.go

View workflow job for this annotation

GitHub Actions / tests (00)

undefined: tmCfg

Check failure on line 561 in testutil/network/network.go

View workflow job for this annotation

GitHub Actions / tests (01)

undefined: tmCfg

Check failure on line 561 in testutil/network/network.go

View workflow job for this annotation

GitHub Actions / tests (02)

undefined: tmCfg

Check failure on line 561 in testutil/network/network.go

View workflow job for this annotation

GitHub Actions / tests (03)

undefined: tmCfg
mmsqe marked this conversation as resolved.
Show resolved Hide resolved

// Provide ChainID here since we can't modify it in the Comet config.
ctx.Viper.Set(flags.FlagChainID, cfg.ChainID)
Expand Down
Loading