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

refactor: Improve and clarify API around AccountAddressById #13460

Merged
merged 9 commits into from Oct 6, 2022

Conversation

amaury1093
Copy link
Contributor

@amaury1093 amaury1093 commented Oct 6, 2022

Description

This PR does 2 things:


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@amaury1093 amaury1093 marked this pull request as ready for review October 6, 2022 10:26
@amaury1093 amaury1093 requested a review from a team as a code owner October 6, 2022 10:26
@amaury1093 amaury1093 added the backport/0.46.x PR scheduled for inclusion in the v0.46's next stable release label Oct 6, 2022
@amaury1093 amaury1093 changed the title refactor!: Improve and clarify API around AccountAddressById refactor: Improve and clarify API around AccountAddressById Oct 6, 2022
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

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

lgtm

amaury1093 and others added 2 commits October 6, 2022 12:33
Co-authored-by: Julien Robert <julien@rbrt.fr>
Co-authored-by: Julien Robert <julien@rbrt.fr>
@julienrbrt
Copy link
Member

No clue what is happening with CI. We had the same error for the Sims. Retrying fixes it.

ctx := sdk.UnwrapSDKContext(c)
address := ak.GetAccountAddressByID(ctx, req.Id)
address := ak.GetAccountAddressByID(ctx, uint64(req.GetId()))

Check failure

Code scanning / gosec

Potential integer overflow by integer type conversion

Potential integer overflow by integer type conversion
Copy link
Contributor

@atheeshp atheeshp left a comment

Choose a reason for hiding this comment

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

lgtm

* (types) [13430](https://github.com/cosmos/cosmos-sdk/pull/13430) Remove unused code `ResponseCheckTx` and `ResponseDeliverTx`
* (x/gov) [#13160](https://github.com/cosmos/cosmos-sdk/pull/13160) Remove custom marshaling of proposl and voteoption.
* (types) [#13430](https://github.com/cosmos/cosmos-sdk/pull/13430) Remove unused code `ResponseCheckTx` and `ResponseDeliverTx`
* (auth) [#13460](https://github.com/cosmos/cosmos-sdk/pull/13460) The `q auth address-by-id` CLI command has been renamed to `q auth address-by-acc-num` to be more explicit. However, the old `address-by-id` version is still kept as an alias, for backwards compatibility.
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this go under CLI Breaking Changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I actually kept address-by-id as a CLI command alias, for backwards compat

@amaury1093 amaury1093 enabled auto-merge (squash) October 6, 2022 10:53
@codecov
Copy link

codecov bot commented Oct 6, 2022

Codecov Report

Merging #13460 (ed6a946) into main (306a9a7) will decrease coverage by 0.02%.
The diff coverage is 41.66%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #13460      +/-   ##
==========================================
- Coverage   53.89%   53.87%   -0.03%     
==========================================
  Files         657      641      -16     
  Lines       56650    55031    -1619     
==========================================
- Hits        30533    29647     -886     
+ Misses      23679    23001     -678     
+ Partials     2438     2383      -55     
Impacted Files Coverage Δ
x/auth/client/cli/query.go 1.73% <0.00%> (-0.01%) ⬇️
x/auth/keeper/grpc_query.go 59.18% <100.00%> (+0.85%) ⬆️
crypto/keys/internal/ecdsa/privkey.go 81.13% <0.00%> (-1.89%) ⬇️
simapp/genesis.go
simapp/state.go
tx/textual/valuerenderer/coins.go
tx/textual/valuerenderer/dec.go
tx/textual/valuerenderer/timestamp.go
simapp/export.go
simapp/upgrades.go
... and 9 more

@amaury1093 amaury1093 merged commit 90bd316 into main Oct 6, 2022
@amaury1093 amaury1093 deleted the am/rename-addr-by-id branch October 6, 2022 11:05
mergify bot pushed a commit that referenced this pull request Oct 6, 2022
* Revert "chore: change id to use uint64 in `AccountAddressByID` (#13411)"

This reverts commit 3d0e214.

* Add since

* Update CLI command

* make proto-gen

* id->accNum

* No API breaking changes

* improve err msg

* Update CHANGELOG.md

Co-authored-by: Julien Robert <julien@rbrt.fr>

* Update CHANGELOG.md

Co-authored-by: Julien Robert <julien@rbrt.fr>

Co-authored-by: Julien Robert <julien@rbrt.fr>
(cherry picked from commit 90bd316)

# Conflicts:
#	CHANGELOG.md
#	api/cosmos/auth/v1beta1/query.pulsar.go
#	api/cosmos/auth/v1beta1/query_grpc.pb.go
#	api/cosmos/distribution/v1beta1/query_grpc.pb.go
#	api/cosmos/group/v1/types.pulsar.go
#	proto/cosmos/auth/v1beta1/query.proto
#	x/auth/client/cli/query.go
#	x/auth/keeper/grpc_query.go
#	x/auth/keeper/grpc_query_test.go
#	x/auth/types/query.pb.go
#	x/distribution/types/query.pb.go
amaury1093 added a commit that referenced this pull request Oct 6, 2022
#13460) (#13461)

* refactor: Improve and clarify API around `AccountAddressById`  (#13460)

* Revert "chore: change id to use uint64 in `AccountAddressByID` (#13411)"

This reverts commit 3d0e214.

* Add since

* Update CLI command

* make proto-gen

* id->accNum

* No API breaking changes

* improve err msg

* Update CHANGELOG.md

Co-authored-by: Julien Robert <julien@rbrt.fr>

* Update CHANGELOG.md

Co-authored-by: Julien Robert <julien@rbrt.fr>

Co-authored-by: Julien Robert <julien@rbrt.fr>
(cherry picked from commit 90bd316)

# Conflicts:
#	CHANGELOG.md
#	api/cosmos/auth/v1beta1/query.pulsar.go
#	api/cosmos/auth/v1beta1/query_grpc.pb.go
#	api/cosmos/distribution/v1beta1/query_grpc.pb.go
#	api/cosmos/group/v1/types.pulsar.go
#	proto/cosmos/auth/v1beta1/query.proto
#	x/auth/client/cli/query.go
#	x/auth/keeper/grpc_query.go
#	x/auth/keeper/grpc_query_test.go
#	x/auth/types/query.pb.go
#	x/distribution/types/query.pb.go

* fix conflicts

* changelog

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
Wryhder pushed a commit to Wryhder/cosmos-sdk that referenced this pull request Oct 26, 2022
…#13460)

* Revert "chore: change id to use uint64 in `AccountAddressByID` (cosmos#13411)"

This reverts commit 3d0e214.

* Add since

* Update CLI command

* make proto-gen

* id->accNum

* No API breaking changes

* improve err msg

* Update CHANGELOG.md

Co-authored-by: Julien Robert <julien@rbrt.fr>

* Update CHANGELOG.md

Co-authored-by: Julien Robert <julien@rbrt.fr>

Co-authored-by: Julien Robert <julien@rbrt.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/0.46.x PR scheduled for inclusion in the v0.46's next stable release C:CLI C:Store C:x/auth C:x/distribution distribution module related C:x/gov C:x/group
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants