Finschia / finschia-sdk

A framework for building blockchains based Finschia Mainnet that is forked from cosmos-sdk
Apache License 2.0
63 stars 30 forks source link

fix: add init logic of module accounts just in case #1277

Closed jaeseung-bae closed 7 months ago

jaeseung-bae commented 7 months ago

Description

Motivation and context

How has this been tested?

Screenshots (if appropriate):

Checklist:

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 69.74%. Comparing base (47a5e9f) to head (feb9962).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/Finschia/finschia-sdk/pull/1277/graphs/tree.svg?width=650&height=150&src=pr&token=m16qfzIPO7&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia)](https://app.codecov.io/gh/Finschia/finschia-sdk/pull/1277?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia) ```diff @@ Coverage Diff @@ ## main #1277 +/- ## ======================================= Coverage 69.74% 69.74% ======================================= Files 643 643 Lines 67261 67266 +5 ======================================= + Hits 46909 46914 +5 Misses 18179 18179 Partials 2173 2173 ``` | [Files](https://app.codecov.io/gh/Finschia/finschia-sdk/pull/1277?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia) | Coverage Δ | | |---|---|---| | [x/foundation/keeper/internal/genesis.go](https://app.codecov.io/gh/Finschia/finschia-sdk/pull/1277?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia#diff-eC9mb3VuZGF0aW9uL2tlZXBlci9pbnRlcm5hbC9nZW5lc2lzLmdv) | `97.40% <100.00%> (+0.18%)` | :arrow_up: |
ulbqb commented 7 months ago

NOTE: This is likely to change account number state in auth module.

You mean, this may have a negative impact on mainnet?

jaeseung-bae commented 7 months ago

NOTE: This is likely to change account number state in auth module.

You mean, this may have a negative impact on mainnet?

A newly joined node that tries to sync with our operating node can never sync, because they may have different account number state. ~So i labeled state breaking change, we need to apply this to the next major version.~ -> (note, InitGenesis runs only once)

GetModuleAccount will create a new account if not exists.