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

refactor: Replace deprecated simapp.MakeTestEncodingConfig with moduletestutil.MakeTestEncodingConfig #55

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

poorphd
Copy link

@poorphd poorphd commented Jul 1, 2024

Description

The simapp.MakeTestEncodingConfig function has been deprecated and removed. Updated the tests to use moduletestutil.MakeTestEncodingConfig instead, which requires a series of relevant AppModuleBasic as input, including the module being tested and any potential dependencies. This change ensures that the test configuration is up-to-date and compatible with the latest SDK standards.

Closes: L-3


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • included the necessary unit and integration tests
  • reviewed "Files changed" and left comments if necessary

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

…etestutil.MakeTestEncodingConfig

The simapp.MakeTestEncodingConfig function has been deprecated and removed. Updated the tests to use moduletestutil.MakeTestEncodingConfig instead, which requires a series of relevant AppModuleBasic as input, including the module being tested and any potential dependencies. This change ensures that the test configuration is up-to-date and compatible with the latest SDK standards.
@poorphd poorphd requested a review from dudong2 July 1, 2024 10:12
@poorphd poorphd self-assigned this Jul 2, 2024
@poorphd poorphd marked this pull request as ready for review July 9, 2024 07:34
@poorphd poorphd requested review from dongsam and zsystm July 9, 2024 07:34
@@ -174,7 +174,7 @@ func SimulateMsgAddLiquidity(k keeper.Keeper, ak types.AccountKeeper, bk types.B
}
}

txGen := simappparams.MakeTestEncodingConfig().TxConfig
txGen := moduletestutil.MakeTestEncodingConfig().TxConfig
Copy link
Member

Choose a reason for hiding this comment

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

Have there been any issues arising from the TestEncodingConfig not registering the interfaces of custom modules like coinswap? Please check if there are any problems, and if so, it would be good to refactor this code to use the same encoding config for tests and simulations as well.

Copy link
Author

Choose a reason for hiding this comment

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

Using TestEncodingConfig, even if we do not pass modules, the msg will be recognized and reach the msg server.
gogoProtoRegistry.FindDescriptorByName(name) already contains the custom module's proto. descriptor.

Copy link

@zsystm zsystm left a comment

Choose a reason for hiding this comment

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

LGTM.
I checked with @poorphd TestEncodingConfig works without passing modules.
BTW, It would be great to know when actual interfaces are registered at code level exactly if we have some time.

@zsystm zsystm merged commit 0a7aad4 into v8/develop Jul 11, 2024
8 checks passed
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.

QA Report
4 participants