Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
fc3343b
first commit
rigelrozanski Apr 3, 2019
2ed7ec3
gaia cleanup
rigelrozanski Apr 4, 2019
fa8d51b
...
rigelrozanski Apr 4, 2019
78beb8b
Merge 'origin/develop' and working on module manager
rigelrozanski Apr 4, 2019
f3c84d2
Merge remote-tracking branch 'origin/develop' into rigel/genesis-gene…
rigelrozanski Apr 8, 2019
31e268a
staking multihooks
rigelrozanski Apr 8, 2019
f04fd65
missing module function return args
rigelrozanski Apr 8, 2019
b9fea80
bank module name constant
rigelrozanski Apr 8, 2019
53096ec
working, module interface for x/
rigelrozanski Apr 9, 2019
f89b67b
got this thing compiling
rigelrozanski Apr 9, 2019
fc2c20a
Merge remote-tracking branch 'origin/develop' into rigel/genesis-gene…
rigelrozanski Apr 9, 2019
f026bec
make test compiles and passes
rigelrozanski Apr 9, 2019
45d82f9
remove expanded simulation invariants
rigelrozanski Apr 9, 2019
3f4d0cf
genesis issue
rigelrozanski Apr 10, 2019
050317d
continued
rigelrozanski Apr 10, 2019
69a543e
continued
rigelrozanski Apr 10, 2019
95236c4
Merge remote-tracking branch 'origin/develop' into rigel/genesis-gene…
rigelrozanski Apr 10, 2019
03328ee
Merge remote-tracking branch 'origin/develop' into rigel/genesis-gene…
rigelrozanski Apr 10, 2019
9031e9d
register crisis routes thought mm
rigelrozanski Apr 10, 2019
480c10e
begin blocker to mm
rigelrozanski Apr 10, 2019
ef5ec28
end blocker to mm
rigelrozanski Apr 10, 2019
3c681a6
empty routes not initialized
rigelrozanski Apr 10, 2019
4ad51d2
move gaia initChainer sanity check to baseapp
rigelrozanski Apr 10, 2019
3620b2e
remove codecs from module manager
rigelrozanski Apr 10, 2019
62342b2
reorging genesis stuff
rigelrozanski Apr 10, 2019
6ce6260
Merge remote-tracking branch 'origin/develop' into rigel/genesis-gene…
rigelrozanski Apr 15, 2019
c8c3a08
module manager passed by reference/bugfixes from working last commit
rigelrozanski Apr 15, 2019
cd4d68f
move invariant checks from gaia to crisis
rigelrozanski Apr 15, 2019
2d95c57
typo
rigelrozanski Apr 15, 2019
a22a9f7
basic refactors cmd/gaia/init
rigelrozanski Apr 16, 2019
75a9a15
working
rigelrozanski Apr 16, 2019
631298e
MultiStakingHooks from types to x/staking/types
rigelrozanski Apr 17, 2019
a2cd3dc
default module manager order of operations from input modules
rigelrozanski Apr 17, 2019
26dae66
Merge branch 'rigel/genesis-generalization' into rigel/genesis-genera…
rigelrozanski Apr 17, 2019
1b805dd
working
rigelrozanski Apr 17, 2019
022498e
typo
rigelrozanski Apr 17, 2019
8e8345c
Merge branch 'rigel/genesis-generalization' into rigel/genesis-genera…
rigelrozanski Apr 17, 2019
2573df8
add AppModuleBasic
rigelrozanski Apr 17, 2019
9386263
moduleBasicManager / non-test code compiles
rigelrozanski Apr 17, 2019
a21406e
working attempting to get tests passing
rigelrozanski Apr 17, 2019
cf671d4
make test passes
rigelrozanski Apr 17, 2019
a2c8c28
sim random genesis fix
rigelrozanski Apr 18, 2019
c8a86bd
export bug
rigelrozanski Apr 18, 2019
cceb887
...
rigelrozanski Apr 18, 2019
a93c56a
genutil module
rigelrozanski Apr 19, 2019
da0a5f9
genutil working
rigelrozanski Apr 19, 2019
092aab3
Merge remote-tracking branch 'origin/develop' into rigel/genesis-gene…
rigelrozanski Apr 22, 2019
d2de398
Merge branch 'rigel/genesis-generalization' into rigel/genesis-genera…
rigelrozanski Apr 22, 2019
ec35f4d
Merge branch 'rigel/genesis-generalization2' into rigel/genesis-gener…
rigelrozanski Apr 22, 2019
4d36066
refactored - happy with non-testing code in cmd/
rigelrozanski Apr 23, 2019
add17c4
...
rigelrozanski Apr 23, 2019
93fa001
lint fixes
rigelrozanski Apr 23, 2019
c7fcefd
Merge branch 'rigel/genesis-generalization2' into rigel/genesis-gener…
rigelrozanski Apr 23, 2019
7977e7e
Merge remote-tracking branch 'origin/develop' into rigel/genesis-gene…
rigelrozanski Apr 26, 2019
62a2b69
Merge branch 'rigel/genesis-generalization' into rigel/genesis-genera…
rigelrozanski Apr 26, 2019
e2b257d
Merge branch 'rigel/genesis-generalization2' into rigel/genesis-gener…
rigelrozanski Apr 26, 2019
87ed491
comment improvement
rigelrozanski Apr 26, 2019
84a0167
Merge branch 'rigel/genesis-generalization' into rigel/genesis-genera…
rigelrozanski Apr 26, 2019
8054543
Merge branch 'rigel/genesis-generalization2' into rigel/genesis-gener…
rigelrozanski Apr 26, 2019
988da1b
cli test fix
rigelrozanski Apr 26, 2019
8fafc42
Merge branch 'rigel/genesis-generalization2' into rigel/genesis-gener…
rigelrozanski Apr 26, 2019
c8ed8ca
compile housing
rigelrozanski Apr 26, 2019
7e7fc06
working through compile errors
rigelrozanski Apr 27, 2019
b15175f
working gettin' compilin'
rigelrozanski Apr 28, 2019
1806ce1
non-test code compiles
rigelrozanski Apr 28, 2019
13840bd
Merge branch 'origin/master' into rigel/genesis-generalization
rigelrozanski Apr 29, 2019
f387889
Merge branch 'rigel/genesis-generalization' into rigel/genesis-genera…
rigelrozanski Apr 29, 2019
0c6d7e4
Merge branch 'rigel/genesis-generalization2' into rigel/genesis-gener…
rigelrozanski Apr 29, 2019
dca8f25
move testnet to its own module
rigelrozanski Apr 30, 2019
7e52f2d
reworking tests
rigelrozanski Apr 30, 2019
8008e48
bez staging PR 1 comments
rigelrozanski May 1, 2019
19e9edb
Merge branch 'rigel/genesis-generalization' into rigel/genesis-genera…
rigelrozanski May 1, 2019
d58b14d
Merge branch 'rigel/genesis-generalization2' into rigel/genesis-gener…
rigelrozanski May 1, 2019
1bd95b5
concise module function-of names
rigelrozanski May 1, 2019
bad6c13
Merge remote-tracking branch 'origin/master' into rigel/genesis-gener…
rigelrozanski May 1, 2019
62c7941
Merge remote-tracking branch 'origin/master' into rigel/genesis-gener…
rigelrozanski May 2, 2019
bfdc03a
moved all tests from genesis_test.go to other genutil tests
rigelrozanski May 2, 2019
5dc633b
genaccounts package, add genutil and genaccounts to app.go
rigelrozanski May 2, 2019
2b94f53
docs for genutil genaccounts
rigelrozanski May 2, 2019
b5bb13a
genaccounts iterate fn
rigelrozanski May 2, 2019
5a4cadf
non-test code with genaccounts/ now compiles
rigelrozanski May 2, 2019
0784d6a
working test compiling
rigelrozanski May 2, 2019
bc53079
Merge remote-tracking branch 'origin/master' into rigel/genesis-gener…
rigelrozanski May 3, 2019
56316cc
debugging tests
rigelrozanski May 4, 2019
b86f595
resolved all make test compile errors
rigelrozanski May 4, 2019
94fd81e
test debuggin
rigelrozanski May 6, 2019
1c4f39f
resolved all unit tests, introduced param module
rigelrozanski May 6, 2019
0f934a4
Merge remote-tracking branch 'origin/master' into rigel/genesis-gener…
rigelrozanski May 6, 2019
54b1dd3
cli-test compile fixes
rigelrozanski May 6, 2019
e051eca
staking initialization bug
rigelrozanski May 6, 2019
f760f46
Merge remote-tracking branch 'origin/master' into rigel/genesis-gener…
rigelrozanski May 8, 2019
1a8340b
code comment improvements, changelog entries
rigelrozanski May 8, 2019
8948d80
BasicGaiaApp -> ModuleBasics
rigelrozanski May 8, 2019
2053b83
highlevel explanation in types/module.go
rigelrozanski May 8, 2019
ebc7af9
Merge remote-tracking branch 'origin/master' into rigel/genesis-gener…
rigelrozanski May 8, 2019
44ff940
@alexanderbez comment revisions
rigelrozanski May 9, 2019
47d4817
@fedekunze PR comments
rigelrozanski May 9, 2019
aaed9ac
@alexanderbez PR comments (x2)
rigelrozanski May 9, 2019
1c2c4df
@cwgoes comments (minor updates)
rigelrozanski May 10, 2019
5a622b5
@fedekunze suggestions
rigelrozanski May 10, 2019
4196712
Merge remote-tracking branch 'origin/master' into rigel/genesis-gener…
rigelrozanski May 10, 2019
7e2b0d8
Merge remote-tracking branch 'origin/master' into rigel/genesis-gener…
rigelrozanski May 13, 2019
eb5f7a5
panic on init with multiple validator updates from different modules
rigelrozanski May 13, 2019
5c0aa05
initchain panic makes validate genesis fail
rigelrozanski May 13, 2019
a45a6f3
AppModuleGenesis seperation
rigelrozanski May 13, 2019
7563a16
test
rigelrozanski May 13, 2019
36a37a8
remove init panic logic in validate genesis replaced with TODO
rigelrozanski May 14, 2019
5c428b8
Merge remote-tracking branch 'origin/master' into rigel/genesis-gener…
rigelrozanski May 15, 2019
4528cf3
set maxprocs to match system's GOMAXPROCS
May 15, 2019
5349379
Update circleci
May 15, 2019
50dde98
Cap maxprocs in CI to 4
May 15, 2019
2bc901b
@alexanderbez recent comments addressed
rigelrozanski May 15, 2019
dc320a3
less blocks in twouble sims
rigelrozanski May 15, 2019
9bea7ee
runsim error output flag
rigelrozanski May 15, 2019
74a0042
-e on import_export as well
rigelrozanski May 15, 2019
e7f9c5a
error out
rigelrozanski May 15, 2019
6d9ddf1
Try to fix failures
May 15, 2019
9187c71
runsim
rigelrozanski May 16, 2019
7cee51a
Merge remote-tracking branch 'origin/alessio/runsim-default-maxprocs'…
rigelrozanski May 16, 2019
85be41a
Merge remote-tracking branch 'origin/master' into rigel/genesis-gener…
rigelrozanski May 16, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs for genutil genaccounts
  • Loading branch information
rigelrozanski committed May 2, 2019
commit 2b94f534a0951bea2a1305c53c67fa3a8cf4261a
9 changes: 9 additions & 0 deletions x/genaccounts/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What is the motivation for having this as a module? Is it solely to be able to call ExportGenesis? I guess I'm not directly opposed to this, but it always made sense in my mind to have any genesis logic close to the application definition (ie. gaia).

If we can keep this general and modular enough, then I suppose it's fine. But it's not really atm because of vesting logic.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If we can keep this general and modular enough, then I suppose it's fine. But it's not really atm because of vesting logic.

Yeah I'd like to abstract this module further to achieve this level of generalization, having it in a separate module is just the first step. Even as is though it's really nice to have all the account functionality packaged up so that if you do want to change the genesis account type, its very clear what needs to be forked and modified as it's all packaged in one place.

But basically the everything fits into the module convention quite nicely for set of genesis accounts. Here we use the module pattern to call ExportGenesis - but also InitGenesis and ValidateGenesis. Previously all this stuff was just tangled as a part of gaia/init/... and gaia/app/genesis.go

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Even as is though it's really nice to have all the account functionality packaged up so that if you do want to change the genesis account type, its very clear what needs to be forked and modified as it's all packaged in one place.

++

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

See comment below - I agree with these goals, but they would seem to me to be better fulfilled by making this a submodule of x/auth instead.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That was my initial thinking too @cwgoes.

Package genaccounts contains specialized functionality for initializing
accounts from genesis including:
- genesis account validation,
- initchain processing of genesis accounts,
- export processing (to genesis) of accounts,
- server command for adding accounts to the genesis file.
*/
package genaccounts
1 change: 0 additions & 1 deletion x/genaccounts/genesis_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ func TestGenesisAccountValidate(t *testing.T) {
}
}

// XXX cleanup
func TestToAccount(t *testing.T) {
priv := ed25519.GenPrivKey()
addr := sdk.AccAddress(priv.PubKey().Address())
Expand Down
3 changes: 2 additions & 1 deletion x/genaccounts/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ func (am AppModule) NewQuerierHandler() sdk.Querier { return nil }
func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate {
var genesisState GenesisState
moduleCdc.MustUnmarshalJSON(data, &genesisState)
return InitGenesis(ctx, moduleCdc, am.accountKeeper, genesisState)
InitGenesis(ctx, moduleCdc, am.accountKeeper, genesisState)
return []abci.ValidatorUpdate{}
}

// module export genesis
Expand Down
10 changes: 10 additions & 0 deletions x/genutil/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
Package genutil contains a variety of genesis utility functionality
for usage within a blockchain application. Namely:
- Genesis transactions related (gentx)
- commands for collection and creation of gentxs
- initchain processing of gentxs
- Genesis file validation
- Tendermint related initialization
*/
package genutil
27 changes: 0 additions & 27 deletions x/genutil/export.go

This file was deleted.

126 changes: 0 additions & 126 deletions x/genutil/genesis_account.go

This file was deleted.

69 changes: 0 additions & 69 deletions x/genutil/genesis_account_test.go

This file was deleted.

9 changes: 0 additions & 9 deletions x/genutil/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@ func InitGenesis(ctx sdk.Context, cdc *codec.Codec,
accountKeeper AccountKeeper, stakingKeeper StakingKeeper,
deliverTx deliverTxfn, genesisState GenesisState) []abci.ValidatorUpdate {

genesisState.Sanitize()

// load the accounts
for _, gacc := range genesisState.Accounts {
acc := gacc.ToAccount()
acc = accountKeeper.NewAccount(ctx, acc) // set account number
accountKeeper.SetAccount(ctx, acc)
}

var validators []abci.ValidatorUpdate
if len(genesisState.GenTxs) > 0 {
validators = DeliverGenTxs(ctx, cdc, genesisState.GenTxs, stakingKeeper, deliverTx)
Expand Down
3 changes: 1 addition & 2 deletions x/genutil/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.Va

// module export genesis
func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage {
gs := ExportGenesis(ctx, am.accountKeeper)
return moduleCdc.MustMarshalJSON(gs)
return nil
}

// module begin-block
Expand Down
92 changes: 0 additions & 92 deletions x/genutil/server/cli/genesis_accts.go

This file was deleted.