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

Use prefix store for contract history #208

Merged
merged 6 commits into from
Jul 21, 2020
Merged

Use prefix store for contract history #208

merged 6 commits into from
Jul 21, 2020

Conversation

alpe
Copy link
Contributor

@alpe alpe commented Jul 20, 2020

Resolves #196
After #199

Includes new CLI command:
wasmcli query wasm contract-history [bech32_address] to print all the code changes.

wasmcli q wasm contract-history cosmos18r5szma8hm93pvx6lwpjwyxruw27e0k5uw835c
[
  {
    "operation": "Init",
    "code_id": 1
  },
  {
    "operation": "Migrate",
    "code_id": 2
  }
]

Note: to be on the safe side sequences have their own prefix as well.

This PR also updates the codec to fix the message decoding issue.


For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@codecov
Copy link

codecov bot commented Jul 20, 2020

Codecov Report

Merging #208 into master will increase coverage by 0.07%.
The diff coverage is 55.40%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #208      +/-   ##
==========================================
+ Coverage   71.87%   71.95%   +0.07%     
==========================================
  Files          27       27              
  Lines        2610     2624      +14     
==========================================
+ Hits         1876     1888      +12     
+ Misses        624      623       -1     
- Partials      110      113       +3     
Impacted Files Coverage Δ
x/wasm/internal/keeper/genesis.go 96.55% <ø> (-0.06%) ⬇️
x/wasm/internal/keeper/test_fuzz.go 94.59% <ø> (-0.53%) ⬇️
x/wasm/internal/types/genesis.go 94.73% <ø> (-0.27%) ⬇️
x/wasm/internal/types/keys.go 0.00% <ø> (ø)
x/wasm/internal/types/test_fixtures.go 93.86% <ø> (-0.04%) ⬇️
x/wasm/internal/types/types.go 23.68% <0.00%> (+0.80%) ⬆️
x/wasm/internal/keeper/querier.go 41.35% <56.52%> (+2.51%) ⬆️
x/wasm/internal/keeper/keeper.go 91.00% <100.00%> (-0.21%) ⬇️
x/wasm/internal/types/codec.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1c4d4d8...ad520ed. Read the comment docs.

@alpe alpe mentioned this pull request Jul 20, 2020
3 tasks
@alpe alpe marked this pull request as ready for review July 20, 2020 13:25
@alpe alpe requested a review from ethanfrey as a code owner July 20, 2020 13:25
@alpe alpe mentioned this pull request Jul 20, 2020
3 tasks
Copy link
Member

@ethanfrey ethanfrey left a comment

Choose a reason for hiding this comment

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

Looks good to merge.

Can you please add a migration guide for the client-visible changes (on queries)? So they can update CosmJS easier

x/wasm/internal/keeper/genesis_test.go Show resolved Hide resolved
x/wasm/internal/keeper/keeper.go Show resolved Hide resolved
x/wasm/internal/keeper/querier_test.go Show resolved Hide resolved
Base automatically changed from json_validation to master July 20, 2020 14:45
@alpe
Copy link
Contributor Author

alpe commented Jul 20, 2020

Pushed a fix for the history query response together with a api_migration.md file

@@ -0,0 +1,36 @@
# Changes to the api
Copy link
Member

Choose a reason for hiding this comment

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

Thank you for adding this.

There is also a code -> code_id renaming from another PR I believe

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was code_id in the json before. Only the Go code was inconsistent. There are no changes for the clients

@ethanfrey ethanfrey merged commit 1f701b8 into master Jul 21, 2020
@ethanfrey ethanfrey deleted the history_store_196 branch July 21, 2020 07:09
zemyblue pushed a commit to Finschia/wasmd that referenced this pull request Jan 2, 2023
* improve lunie guide with screenshots

* Apply suggestions from code review

Co-Authored-By: Federico Kunze <[email protected]>

* code review
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.

Move history of contract code migrations to their own prefix store.
2 participants