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: add genesis modification function to e2e #2112

Merged
merged 7 commits into from
Aug 25, 2022

Conversation

colin-axner
Copy link
Contributor

Description

Configures genesis properly for passing gov proposals. See #2071 for passing tests

closes: #2077


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

Copy link
Contributor

@chatton chatton left a comment

Choose a reason for hiding this comment

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

looks great! This will allow a lot more flexibility in our tests. I just left a few questions/suggestions 👍

// set correct minimum deposit using configured denom
govGenesisState.DepositParams.MinDeposit = sdk.NewCoins(sdk.NewCoin(denom, govv1beta1.DefaultMinDepositTokens))

// set voting period to 10s
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like comment is not in sync with the code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea, originally I had it at 10s, but that wasn't sufficient for tests passing

e2e/testconfig/testconfig.go Outdated Show resolved Hide resolved
e2e/testconfig/testconfig.go Show resolved Hide resolved
Comment on lines +178 to +180
cfg := simappparams.MakeTestEncodingConfig()
govv1beta1.RegisterInterfaces(cfg.InterfaceRegistry)
cdc := codec.NewProtoCodec(cfg.InterfaceRegistry)
Copy link
Contributor

Choose a reason for hiding this comment

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

what do you think about moving this to some separate initialization function, is there a benefit to having a new instance each time?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No benefit. Ideally this function would be exposed on ibctest. Where would you suggest we add this initialization function? Are you suggesting we keep a global variable? I think that'd be fine since it is just for testing

I'd be happy to add a generateCodec() function, but it would still recreate the instance each time

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I guess there wouldn't be much benefit either way, maybe we could consider it if we find ourselves generating the same codec in multiple places. It's probably fine for now to leave this as is

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'll leave as is. I think it'll be easier to wait for a natural place to initialize the codec than to look for one right now

Copy link
Contributor

@chatton chatton left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Contributor

@damiannolan damiannolan left a comment

Choose a reason for hiding this comment

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

🚀

@mergify mergify bot merged commit b6dd724 into main Aug 25, 2022
@mergify mergify bot deleted the colin/2077-add-e2e-modify-genesis branch August 25, 2022 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add genesis modifications for e2e tests
3 participants