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

feat: mapped account query #443

Merged
merged 11 commits into from
Jun 2, 2023
Merged

Conversation

ajansari95
Copy link
Contributor

@ajansari95 ajansari95 commented Jun 2, 2023

1. Summary

Fixes QCK-477
Adds Mapped Account query for xcclookup

2.Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

3. Implementation details

4. How to test/use

5. Checklist

  • Does the Readme need to be updated?

6. Limitations (optional)

7. Future Work (optional)

@ajansari95 ajansari95 mentioned this pull request Jun 2, 2023
5 tasks
@ajansari95 ajansari95 changed the title add mapped account query feat: mapped account query Jun 2, 2023
@aljo242
Copy link

aljo242 commented Jun 2, 2023

@ajansari95 lint fail.

I think you just need to run formatting

@codecov-commenter
Copy link

codecov-commenter commented Jun 2, 2023

Codecov Report

Merging #443 (2f1c666) into feat/keytypes (0cf0ecc) will decrease coverage by 0.03%.
The diff coverage is 41.93%.

Impacted file tree graph

@@                Coverage Diff                @@
##           feat/keytypes     #443      +/-   ##
=================================================
- Coverage          54.22%   54.20%   -0.03%     
=================================================
  Files                164      164              
  Lines              12179    12241      +62     
=================================================
+ Hits                6604     6635      +31     
- Misses              5070     5099      +29     
- Partials             505      507       +2     
Flag Coverage Δ
unittests 54.20% <41.93%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
x/interchainstaking/client/cli/query.go 52.71% <0.00%> (-13.31%) ⬇️
x/interchainstaking/types/keys.go 40.74% <0.00%> (-1.57%) ⬇️
x/interchainstaking/keeper/address_map.go 87.80% <72.22%> (-12.20%) ⬇️
x/interchainstaking/keeper/grpc_query.go 80.50% <81.25%> (+0.06%) ⬆️

... and 1 file with indirect coverage changes

Copy link

@aljo242 aljo242 left a comment

Choose a reason for hiding this comment

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

lgtm

x/interchainstaking/client/cli/query.go Outdated Show resolved Hide resolved
x/interchainstaking/keeper/grpc_query.go Outdated Show resolved Hide resolved
Comment on lines +2902 to +2920
for k := range m.RemoteAddressMap {
v := m.RemoteAddressMap[k]
baseI := i
if len(v) > 0 {
i -= len(v)
copy(dAtA[i:], v)
i = encodeVarintQuery(dAtA, i, uint64(len(v)))
i--
dAtA[i] = 0x12
}
i -= len(k)
copy(dAtA[i:], k)
i = encodeVarintQuery(dAtA, i, uint64(len(k)))
i--
dAtA[i] = 0xa
i = encodeVarintQuery(dAtA, i, uint64(baseI-i))
i--
dAtA[i] = 0xa
}

Check warning

Code scanning / CodeQL

Iteration over map

Iteration over map may be a possible source of non-determinism
x/interchainstaking/types/query.pb.go Show resolved Hide resolved
@joe-bowman joe-bowman merged commit 84f6d97 into feat/keytypes Jun 2, 2023
@joe-bowman joe-bowman deleted the feat/mapped-account-query branch June 2, 2023 21:09
joe-bowman pushed a commit that referenced this pull request Jun 7, 2023
* add to proto

* generate

* populate field

* Update proto/quicksilver/interchainstaking/v1/interchainstaking.proto

Co-authored-by: Ajaz Ahmed Ansari <[email protected]>

* decode basic implementation

* decodememo

* fix

* decode Field

* lint fix

* parse memo fields

* stub out logic

* address map

* address map

* refactor

* lint fix

* validate memo fields

* add logic

* refactor

* feat: mapped account query (#443)

* add mapped account query

* format

* rebase

* return map instead of struct

* Update x/interchainstaking/client/cli/query.go

Co-authored-by: Alex Johnson <[email protected]>

* Update x/interchainstaking/keeper/grpc_query.go

* Update x/interchainstaking/keeper/grpc_query_test.go

* fix lint

* use sdkConfig

---------

Co-authored-by: Alex Johnson <[email protected]>

* refactor to cover more cases

* update

* send on remote zone

* add condition

* Update x/interchainstaking/types/zones_test.go

* Update x/interchainstaking/types/zones_test.go

* Update x/interchainstaking/types/zones_test.go

remove unused import

* Update x/interchainstaking/types/zones_test.go

---------

Co-authored-by: Ajaz Ahmed Ansari <[email protected]>
Co-authored-by: Joe Bowman <[email protected]>
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

Successfully merging this pull request may close these issues.

4 participants