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

Move duplicated getIssueFee & getMintFee helpers to CoreumChain in integr-tests #581

Merged
merged 5 commits into from
Jul 26, 2023

Conversation

ysv
Copy link
Contributor

@ysv ysv commented Jul 24, 2023

Description

This PR replaces duplicated getIssueFee helper func in multiple locations with a single QueryAssetFTParams method inside CoreumChain struct.
Same refactoring applied to asset/nft params to avoid same issue in the future.
The idea is to avoid code duplication & have a single universal method to query all params for asset/ft & asset/nft modules.

This change is Reviewable

@ysv ysv marked this pull request as ready for review July 24, 2023 12:35
@ysv ysv requested a review from a team as a code owner July 24, 2023 12:35
@ysv ysv requested review from dzmitryhil, vertex451, miladz68 and wojtek-coreum and removed request for a team July 24, 2023 12:35
Copy link
Contributor

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 9 files reviewed, 1 unresolved discussion (waiting on @miladz68, @vertex451, @wojtek-coreum, and @ysv)


integration-tests/coreum.go line 186 at r1 (raw file):

// QueryAssetFTParams queries for asset/ft module params and returns them.
func (c CoreumChain) QueryAssetFTParams(ctx context.Context, t *testing.T) assetfttypes.Params {
	queryClient := assetfttypes.NewQueryClient(c.ClientContext)

You need to add t.Testing() for that func and text func, if you pass the t *testing.T as arg. This is good practice since helps the testing framework separate test and helper functions and in case of logs or errors, show proper line in the test.

miladz68
miladz68 previously approved these changes Jul 25, 2023
Copy link
Contributor

@miladz68 miladz68 left a comment

Choose a reason for hiding this comment

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

Reviewed 9 of 9 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @vertex451, @wojtek-coreum, and @ysv)

Copy link
Contributor Author

@ysv ysv left a comment

Choose a reason for hiding this comment

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

Reviewable status: 8 of 9 files reviewed, 1 unresolved discussion (waiting on @dzmitryhil, @miladz68, @vertex451, and @wojtek-coreum)


integration-tests/coreum.go line 186 at r1 (raw file):

Previously, dzmitryhil (Dzmitry Hil) wrote…

You need to add t.Testing() for that func and text func, if you pass the t *testing.T as arg. This is good practice since helps the testing framework separate test and helper functions and in case of logs or errors, show proper line in the test.

I guess you meant to add t.Helper()

Done

Copy link
Contributor

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

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

Reviewable status: 8 of 9 files reviewed, 1 unresolved discussion (waiting on @miladz68, @vertex451, @wojtek-coreum, and @ysv)


integration-tests/coreum.go line 186 at r1 (raw file):

Previously, ysv (Yaroslav Savchuk) wrote…

I guess you meant to add t.Helper()

Done

Right.

Copy link
Contributor

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

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

Reviewable status: 8 of 9 files reviewed, all discussions resolved (waiting on @miladz68, @vertex451, and @wojtek-coreum)

Copy link
Contributor

@miladz68 miladz68 left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @vertex451 and @wojtek-coreum)

@ysv ysv merged commit 2b49e30 into master Jul 26, 2023
@ysv ysv deleted the yaroslav/integration-tests-cleanup branch July 26, 2023 16:12
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.

3 participants