init refactor uses genesis transaction now

This commit is contained in:
rigelrozanski
2018-04-26 14:26:39 -04:00
parent 12f20d160a
commit b9477ecbbe
8 changed files with 237 additions and 203 deletions
+4 -5
View File
@@ -8,8 +8,6 @@ import (
"github.com/spf13/cobra"
abci "github.com/tendermint/abci/types"
crypto "github.com/tendermint/go-crypto"
tmtypes "github.com/tendermint/tendermint/types"
"github.com/tendermint/tmlibs/cli"
dbm "github.com/tendermint/tmlibs/db"
"github.com/tendermint/tmlibs/log"
@@ -21,12 +19,13 @@ import (
// init parameters
var CoolAppInit = server.AppInit{
GenAppParams: CoolGenAppParams,
AppGenState: CoolAppGenState,
AppGenTx: server.SimpleAppGenTx,
}
// coolGenAppParams sets up the app_state and appends the cool app state
func CoolGenAppParams(cdc *wire.Codec, pubKey crypto.PubKey) (chainID string, validators []tmtypes.GenesisValidator, appState, cliPrint json.RawMessage, err error) {
chainID, validators, appState, cliPrint, err = server.SimpleGenAppParams(cdc, pubKey)
func CoolAppGenState(cdc *wire.Codec, appGenTxs []json.RawMessage) (appState json.RawMessage, err error) {
appState, err = server.SimpleAppGenState(cdc, appGenTxs)
if err != nil {
return
}