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 param usage issue in genesis import #338

Merged
merged 1 commit into from
Dec 14, 2020
Merged

Fix param usage issue in genesis import #338

merged 1 commit into from
Dec 14, 2020

Conversation

alpe
Copy link
Contributor

@alpe alpe commented Dec 11, 2020

Resolves #335 (first point only)

The genesis test setup was modified in setupKeeper to not have params set there. The reported issue was confirmed by the tests then.

@alpe alpe requested a review from ethanfrey December 11, 2020 13:12
@codecov
Copy link

codecov bot commented Dec 11, 2020

Codecov Report

Merging #338 (b63a149) into master (576f620) will decrease coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #338      +/-   ##
==========================================
- Coverage   69.86%   69.76%   -0.10%     
==========================================
  Files          28       28              
  Lines        2389     2421      +32     
==========================================
+ Hits         1669     1689      +20     
- Misses        605      615      +10     
- Partials      115      117       +2     
Impacted Files Coverage Δ
x/wasm/internal/keeper/genesis.go 92.59% <100.00%> (ø)
x/wasm/internal/types/params.go 61.44% <0.00%> (+0.66%) ⬆️

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.

ack

t.Helper()
tempDir, err := ioutil.TempDir("", "wasm")
require.NoError(t, err)
cleanup := func() { os.RemoveAll(tempDir) }
//t.Cleanup(cleanup) todo: add with Go 1.14
t.Cleanup(func() { os.RemoveAll(tempDir) })
Copy link
Member

Choose a reason for hiding this comment

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

Such a nice trick, cleaning up a lot

@@ -12,6 +12,8 @@ import (
//
// CONTRACT: all types of accounts must have been already initialized/created
func InitGenesis(ctx sdk.Context, keeper *Keeper, data types.GenesisState) error {
keeper.setParams(ctx, data.Params)
Copy link
Member

Choose a reason for hiding this comment

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

Much better

@alpe alpe merged commit ae169ce into master Dec 14, 2020
@alpe alpe deleted the fix_genesis_335 branch December 14, 2020 07:17
@alpe alpe mentioned this pull request Dec 14, 2020
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.

Errors in InitGenesis
2 participants