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 custom address prefix within feature files / unit tests #1243

Closed
4 tasks
ryanchristo opened this issue Jul 7, 2022 · 4 comments · Fixed by #1253
Closed
4 tasks

Use custom address prefix within feature files / unit tests #1243

ryanchristo opened this issue Jul 7, 2022 · 4 comments · Fixed by #1253
Assignees
Labels

Comments

@ryanchristo
Copy link
Member

ryanchristo commented Jul 7, 2022

Summary

The account address prefix regen is initialized at runtime and therefore the default cosmos account address prefix is used within our unit tests. Given we are writing feature files that act as a specification for the intended behavior of Regen Ledger features, it would be nice to use regen within our unit tests. It does not look like this is possible with the current version of the sdk.

The following can be added to base suite setup for unit tests:

	cfg := sdk.GetConfig()
	cfg.SetBech32PrefixForAccount("regen", "regenpub")

Problem Definition

The use of the cosmos prefix does not accurately reflect the expected behavior of Regen Ledger features.

Proposal

Configure base suite setup for unit tests to use custom regen prefix and update address values as needed.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@ryanchristo
Copy link
Member Author

Might make more sense to just do this once within an init function in the root of each module. Maybe add a config.go file with the init function that includes the two lines mentioned above.

@clevinson clevinson added the good first issue Good for newcomers label Jul 8, 2022
@wgwz
Copy link
Contributor

wgwz commented Jul 9, 2022

hey @ryanchristo i'm interested in working on this one!

@wgwz
Copy link
Contributor

wgwz commented Jul 9, 2022

@ryanchristo made a naive attempt in the PR above, but i need some guidance to learn how to run the tests correctly. didn't actually check that my changes are working, just was aiming to get sorta close on it.

@ryanchristo
Copy link
Member Author

hey @ryanchristo i'm interested in working on this one!

Great! I've assigned you.

@ryanchristo made a naive attempt in the PR above, but i need some guidance to learn how to run the tests correctly. didn't actually check that my changes are working, just was aiming to get sorta close on it.

Left a comment in the pull request: #1253 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants