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!: use injected encoding params in simapp #12717

Merged
merged 5 commits into from
Jul 27, 2022

Conversation

julienrbrt
Copy link
Member

@julienrbrt julienrbrt commented Jul 25, 2022

Description

Closes: #XXXX

Investigating the possibility of using injected encoding params in NewSimApp and simplify NewSimApp constructor arguments.


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...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

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 the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • 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)

@julienrbrt julienrbrt changed the title refactor: use injected legacyAmino in simapp refactor: use injected encoding params in simapp Jul 25, 2022
@julienrbrt julienrbrt marked this pull request as ready for review July 25, 2022 23:55
@julienrbrt julienrbrt requested a review from a team as a code owner July 25, 2022 23:55
@julienrbrt julienrbrt force-pushed the julien/use-injected-legacyamino-simapp branch from 7226c70 to dd98b4a Compare July 26, 2022 09:59
@julienrbrt julienrbrt changed the title refactor: use injected encoding params in simapp refactor!: use injected encoding params in simapp Jul 26, 2022
encodingConfig := simapp.MakeTestEncodingConfig()
func NewRootCmd() *cobra.Command {
// we "pre"-instantiate the application for getting the injected/configured encoding configuration
tempApp := simapp.NewSimApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, simutil.EmptyAppOptions{})
Copy link
Member Author

@julienrbrt julienrbrt Jul 26, 2022

Choose a reason for hiding this comment

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

Actually, with the previous behavior we were never certain that the InterfaceRegistry, AppCodec or TxConfig were identical with the encoding config when using app wiring (as these were injected). This fixes it and as well ensures that we use the same params for the legacy app.

@github-actions github-actions bot removed the C:Cosmovisor Issues and PR related to Cosmovisor label Jul 27, 2022
@julienrbrt julienrbrt force-pushed the julien/use-injected-legacyamino-simapp branch from 2b885cb to 46613ad Compare July 27, 2022 10:37
Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

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

utACK. the clean makes seperation better

@codecov
Copy link

codecov bot commented Jul 27, 2022

Codecov Report

❗ No coverage uploaded for pull request base (main@a1777a8). Click here to learn what that means.
The diff coverage is 84.37%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #12717   +/-   ##
=======================================
  Coverage        ?   56.36%           
=======================================
  Files           ?      648           
  Lines           ?    55340           
  Branches        ?        0           
=======================================
  Hits            ?    31190           
  Misses          ?    21631           
  Partials        ?     2519           
Impacted Files Coverage Δ
simapp/simd/cmd/root.go 70.56% <80.00%> (ø)
simapp/test_helpers.go 22.86% <84.61%> (ø)
simapp/app.go 79.24% <100.00%> (ø)

@julienrbrt julienrbrt merged commit 9c51d9a into main Jul 27, 2022
@julienrbrt julienrbrt deleted the julien/use-injected-legacyamino-simapp branch July 27, 2022 13:21
larry0x pushed a commit to larry0x/cosmos-sdk that referenced this pull request May 22, 2023
* refactor!: use injected encoding params in simapp

* add upgrading.md entry
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.

4 participants