-
Notifications
You must be signed in to change notification settings - Fork 4.2k
R4R Module/Genesis Generalization #4159
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
Merged
+3,661
−2,307
Merged
Changes from 1 commit
Commits
Show all changes
120 commits
Select commit
Hold shift + click to select a range
fc3343b
first commit
rigelrozanski 2ed7ec3
gaia cleanup
rigelrozanski fa8d51b
...
rigelrozanski 78beb8b
Merge 'origin/develop' and working on module manager
rigelrozanski f3c84d2
Merge remote-tracking branch 'origin/develop' into rigel/genesis-gene…
rigelrozanski 31e268a
staking multihooks
rigelrozanski f04fd65
missing module function return args
rigelrozanski b9fea80
bank module name constant
rigelrozanski 53096ec
working, module interface for x/
rigelrozanski f89b67b
got this thing compiling
rigelrozanski fc2c20a
Merge remote-tracking branch 'origin/develop' into rigel/genesis-gene…
rigelrozanski f026bec
make test compiles and passes
rigelrozanski 45d82f9
remove expanded simulation invariants
rigelrozanski 3f4d0cf
genesis issue
rigelrozanski 050317d
continued
rigelrozanski 69a543e
continued
rigelrozanski 95236c4
Merge remote-tracking branch 'origin/develop' into rigel/genesis-gene…
rigelrozanski 03328ee
Merge remote-tracking branch 'origin/develop' into rigel/genesis-gene…
rigelrozanski 9031e9d
register crisis routes thought mm
rigelrozanski 480c10e
begin blocker to mm
rigelrozanski ef5ec28
end blocker to mm
rigelrozanski 3c681a6
empty routes not initialized
rigelrozanski 4ad51d2
move gaia initChainer sanity check to baseapp
rigelrozanski 3620b2e
remove codecs from module manager
rigelrozanski 62342b2
reorging genesis stuff
rigelrozanski 6ce6260
Merge remote-tracking branch 'origin/develop' into rigel/genesis-gene…
rigelrozanski c8c3a08
module manager passed by reference/bugfixes from working last commit
rigelrozanski cd4d68f
move invariant checks from gaia to crisis
rigelrozanski 2d95c57
typo
rigelrozanski a22a9f7
basic refactors cmd/gaia/init
rigelrozanski 75a9a15
working
rigelrozanski 631298e
MultiStakingHooks from types to x/staking/types
rigelrozanski a2cd3dc
default module manager order of operations from input modules
rigelrozanski 26dae66
Merge branch 'rigel/genesis-generalization' into rigel/genesis-genera…
rigelrozanski 1b805dd
working
rigelrozanski 022498e
typo
rigelrozanski 8e8345c
Merge branch 'rigel/genesis-generalization' into rigel/genesis-genera…
rigelrozanski 2573df8
add AppModuleBasic
rigelrozanski 9386263
moduleBasicManager / non-test code compiles
rigelrozanski a21406e
working attempting to get tests passing
rigelrozanski cf671d4
make test passes
rigelrozanski a2c8c28
sim random genesis fix
rigelrozanski c8a86bd
export bug
rigelrozanski cceb887
...
rigelrozanski a93c56a
genutil module
rigelrozanski da0a5f9
genutil working
rigelrozanski 092aab3
Merge remote-tracking branch 'origin/develop' into rigel/genesis-gene…
rigelrozanski d2de398
Merge branch 'rigel/genesis-generalization' into rigel/genesis-genera…
rigelrozanski ec35f4d
Merge branch 'rigel/genesis-generalization2' into rigel/genesis-gener…
rigelrozanski 4d36066
refactored - happy with non-testing code in cmd/
rigelrozanski add17c4
...
rigelrozanski 93fa001
lint fixes
rigelrozanski c7fcefd
Merge branch 'rigel/genesis-generalization2' into rigel/genesis-gener…
rigelrozanski 7977e7e
Merge remote-tracking branch 'origin/develop' into rigel/genesis-gene…
rigelrozanski 62a2b69
Merge branch 'rigel/genesis-generalization' into rigel/genesis-genera…
rigelrozanski e2b257d
Merge branch 'rigel/genesis-generalization2' into rigel/genesis-gener…
rigelrozanski 87ed491
comment improvement
rigelrozanski 84a0167
Merge branch 'rigel/genesis-generalization' into rigel/genesis-genera…
rigelrozanski 8054543
Merge branch 'rigel/genesis-generalization2' into rigel/genesis-gener…
rigelrozanski 988da1b
cli test fix
rigelrozanski 8fafc42
Merge branch 'rigel/genesis-generalization2' into rigel/genesis-gener…
rigelrozanski c8ed8ca
compile housing
rigelrozanski 7e7fc06
working through compile errors
rigelrozanski b15175f
working gettin' compilin'
rigelrozanski 1806ce1
non-test code compiles
rigelrozanski 13840bd
Merge branch 'origin/master' into rigel/genesis-generalization
rigelrozanski f387889
Merge branch 'rigel/genesis-generalization' into rigel/genesis-genera…
rigelrozanski 0c6d7e4
Merge branch 'rigel/genesis-generalization2' into rigel/genesis-gener…
rigelrozanski dca8f25
move testnet to its own module
rigelrozanski 7e52f2d
reworking tests
rigelrozanski 8008e48
bez staging PR 1 comments
rigelrozanski 19e9edb
Merge branch 'rigel/genesis-generalization' into rigel/genesis-genera…
rigelrozanski d58b14d
Merge branch 'rigel/genesis-generalization2' into rigel/genesis-gener…
rigelrozanski 1bd95b5
concise module function-of names
rigelrozanski bad6c13
Merge remote-tracking branch 'origin/master' into rigel/genesis-gener…
rigelrozanski 62c7941
Merge remote-tracking branch 'origin/master' into rigel/genesis-gener…
rigelrozanski bfdc03a
moved all tests from genesis_test.go to other genutil tests
rigelrozanski 5dc633b
genaccounts package, add genutil and genaccounts to app.go
rigelrozanski 2b94f53
docs for genutil genaccounts
rigelrozanski b5bb13a
genaccounts iterate fn
rigelrozanski 5a4cadf
non-test code with genaccounts/ now compiles
rigelrozanski 0784d6a
working test compiling
rigelrozanski bc53079
Merge remote-tracking branch 'origin/master' into rigel/genesis-gener…
rigelrozanski 56316cc
debugging tests
rigelrozanski b86f595
resolved all make test compile errors
rigelrozanski 94fd81e
test debuggin
rigelrozanski 1c4f39f
resolved all unit tests, introduced param module
rigelrozanski 0f934a4
Merge remote-tracking branch 'origin/master' into rigel/genesis-gener…
rigelrozanski 54b1dd3
cli-test compile fixes
rigelrozanski e051eca
staking initialization bug
rigelrozanski f760f46
Merge remote-tracking branch 'origin/master' into rigel/genesis-gener…
rigelrozanski 1a8340b
code comment improvements, changelog entries
rigelrozanski 8948d80
BasicGaiaApp -> ModuleBasics
rigelrozanski 2053b83
highlevel explanation in types/module.go
rigelrozanski ebc7af9
Merge remote-tracking branch 'origin/master' into rigel/genesis-gener…
rigelrozanski 44ff940
@alexanderbez comment revisions
rigelrozanski 47d4817
@fedekunze PR comments
rigelrozanski aaed9ac
@alexanderbez PR comments (x2)
rigelrozanski 1c2c4df
@cwgoes comments (minor updates)
rigelrozanski 5a622b5
@fedekunze suggestions
rigelrozanski 4196712
Merge remote-tracking branch 'origin/master' into rigel/genesis-gener…
rigelrozanski 7e2b0d8
Merge remote-tracking branch 'origin/master' into rigel/genesis-gener…
rigelrozanski eb5f7a5
panic on init with multiple validator updates from different modules
rigelrozanski 5c0aa05
initchain panic makes validate genesis fail
rigelrozanski a45a6f3
AppModuleGenesis seperation
rigelrozanski 7563a16
test
rigelrozanski 36a37a8
remove init panic logic in validate genesis replaced with TODO
rigelrozanski 5c428b8
Merge remote-tracking branch 'origin/master' into rigel/genesis-gener…
rigelrozanski 4528cf3
set maxprocs to match system's GOMAXPROCS
5349379
Update circleci
50dde98
Cap maxprocs in CI to 4
2bc901b
@alexanderbez recent comments addressed
rigelrozanski dc320a3
less blocks in twouble sims
rigelrozanski 9bea7ee
runsim error output flag
rigelrozanski 74a0042
-e on import_export as well
rigelrozanski e7f9c5a
error out
rigelrozanski 6d9ddf1
Try to fix failures
9187c71
runsim
rigelrozanski 7cee51a
Merge remote-tracking branch 'origin/alessio/runsim-default-maxprocs'…
rigelrozanski 85be41a
Merge remote-tracking branch 'origin/master' into rigel/genesis-gener…
rigelrozanski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
working through compile errors
- Loading branch information
commit 7e7fc06ab0792b008aa0e2b106fd7d722854edb9
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,27 @@ | ||
| package genutil | ||
|
|
||
| import ( | ||
| "github.com/cosmos/cosmos-sdk/cmd/gaia/app" | ||
| sdk "github.com/cosmos/cosmos-sdk/types" | ||
| "github.com/cosmos/cosmos-sdk/x/auth" | ||
| ) | ||
|
|
||
| func ExportGenesis(accountKeeper AccountKeeper) GenesisState { | ||
| // export genesis for all accounts | ||
| func ExportGenesis(ctx sdk.Context, accountKeeper AccountKeeper) GenesisState { | ||
|
|
||
| // iterate to get the accounts | ||
| accounts := []GenesisAccount{} | ||
| app.accountKeeper.IterateAccounts(ctx, | ||
| accountKeeper.IterateAccounts(ctx, | ||
| func(acc auth.Account) (stop bool) { | ||
| account := NewGenesisAccountI(acc) | ||
| account, err := NewGenesisAccountI(acc) | ||
| if err != nil { | ||
| panic(err) | ||
| } | ||
| accounts = append(accounts, account) | ||
| return false | ||
| }, | ||
| ) | ||
|
|
||
| var genesisState GenesisState | ||
| genesisState.GenesisAccounts = accounts | ||
| genesisState.Accounts = accounts | ||
| return genesisState | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although I agree that it makes sense to separate out this logic, I am not entirely convinced it should be a module, especially since it imports two other modules directly. Do we expect this to be used frequently by SDK chains other than
gaia, in exactly this form?If not, I wonder if a better structure might be to abstract out most of the common functionality into a library (subpackage of
types/maybe) and call it from Gaia - then applications could import what they need.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be a good pattern
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup see my further comment, once the further abstraction is concluded, this should be able to be used by other blockchain projects with custom genesis account types and create validator messages. Thus it's good and ought to be a module.
based on comments here: #4159 (comment) I perceive it to be unwise to move have elements outside of
x/depend on things fromx/(until the point that they are just using expected interfaces which is not yet the case) - so yeah I'm pretty fiercely certain this aint' belong intypes/- but yeah see that other threadThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#4159 (comment)