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

WIP fix gen-tx #1824

Merged
merged 3 commits into from
Jul 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ BUG FIXES
* \#1797 Fix off-by-one error in slashing for downtime
* \#1787 Fixed bug where Tally fails due to revoked/unbonding validator
* \#1766 Fixes bad example for keybase identity
* \#1799 Fix `gaiad export`
* \#1804 Fixes gen-tx genesis generation logic temporarily until upstream updates
* \#1799 Fix `gaiad export`
17 changes: 10 additions & 7 deletions server/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ var (

// genesis piece structure for creating combined genesis
type GenesisTx struct {
NodeID string `json:"node_id"`
IP string `json:"ip"`
AppGenTx json.RawMessage `json:"app_gen_tx"`
NodeID string `json:"node_id"`
IP string `json:"ip"`
Validator tmtypes.GenesisValidator `json:"validator"`
AppGenTx json.RawMessage `json:"app_gen_tx"`
}

// Storage for init command input parameters
Expand Down Expand Up @@ -120,15 +121,16 @@ func gentxWithConfig(cdc *wire.Codec, appInit AppInit, config *cfg.Config, genTx
nodeID := string(nodeKey.ID())
pubKey := readOrCreatePrivValidator(config)

appGenTx, cliPrint, _, err := appInit.AppGenTx(cdc, pubKey, genTxConfig)
appGenTx, cliPrint, validator, err := appInit.AppGenTx(cdc, pubKey, genTxConfig)
if err != nil {
return
}

tx := GenesisTx{
NodeID: nodeID,
IP: genTxConfig.IP,
AppGenTx: appGenTx,
NodeID: nodeID,
IP: genTxConfig.IP,
Validator: validator,
AppGenTx: appGenTx,
}
bz, err := wire.MarshalJSONIndent(cdc, tx)
if err != nil {
Expand Down Expand Up @@ -310,6 +312,7 @@ func processGenTxs(genTxsDir string, cdc *wire.Codec) (
genTx := genTxs[nodeID]

// combine some stuff
validators = append(validators, genTx.Validator)
appGenTxs = append(appGenTxs, genTx.AppGenTx)

// Add a persistent peer
Expand Down