fixes from review
This commit is contained in:
+4
-2
@@ -35,8 +35,9 @@ type BaseApp struct {
|
||||
// unmarshal []byte into sdk.Tx
|
||||
txDecoder sdk.TxDecoder
|
||||
|
||||
// unmarshal rawjsonbytes to the initialize application
|
||||
InitStater sdk.InitStater // TODO make unexposed once certain refactoring from basecoin -> baseapp
|
||||
// unmarshal rawjsonbytes to initialize the application
|
||||
// TODO unexpose and call from InitChain
|
||||
InitStater sdk.InitStater
|
||||
|
||||
// ante handler for fee and auth
|
||||
defaultAnteHandler sdk.AnteHandler
|
||||
@@ -204,6 +205,7 @@ func (app *BaseApp) SetOption(req abci.RequestSetOption) (res abci.ResponseSetOp
|
||||
// Implements ABCI
|
||||
func (app *BaseApp) InitChain(req abci.RequestInitChain) (res abci.ResponseInitChain) {
|
||||
// TODO: Use req.Validators
|
||||
// TODO: Use req.AppStateJSON (?)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
+3
-42
@@ -3,53 +3,14 @@ package baseapp
|
||||
import (
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"time"
|
||||
|
||||
crypto "github.com/tendermint/go-crypto"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
)
|
||||
|
||||
// TODO this is dup code from tendermint-core to avoid dep issues
|
||||
// should probably remove from both SDK / Tendermint and move to tmlibs
|
||||
// ^^^^^^^^^^^^^ This is my preference to avoid DEP hell
|
||||
// or sync up versioning and just reference tendermint
|
||||
// TODO: remove from here and pass the AppState
|
||||
// through InitChain
|
||||
|
||||
// GenesisDoc defines the initial conditions for a tendermint blockchain, in particular its validator set.
|
||||
type GenesisDoc struct {
|
||||
GenesisTime time.Time `json:"genesis_time"`
|
||||
ChainID string `json:"chain_id"`
|
||||
ConsensusParams *ConsensusParams `json:"consensus_params,omitempty"`
|
||||
Validators []GenesisValidator `json:"validators"`
|
||||
AppHash cmn.HexBytes `json:"app_hash"`
|
||||
AppState json.RawMessage `json:"app_state,omitempty"`
|
||||
}
|
||||
|
||||
//nolint TODO remove
|
||||
type ConsensusParams struct {
|
||||
BlockSize `json:"block_size_params"`
|
||||
TxSize `json:"tx_size_params"`
|
||||
BlockGossip `json:"block_gossip_params"`
|
||||
EvidenceParams `json:"evidence_params"`
|
||||
}
|
||||
type GenesisValidator struct {
|
||||
PubKey crypto.PubKey `json:"pub_key"`
|
||||
Power int64 `json:"power"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
type BlockSize struct {
|
||||
MaxBytes int `json:"max_bytes"` // NOTE: must not be 0 nor greater than 100MB
|
||||
MaxTxs int `json:"max_txs"`
|
||||
MaxGas int64 `json:"max_gas"`
|
||||
}
|
||||
type TxSize struct {
|
||||
MaxBytes int `json:"max_bytes"`
|
||||
MaxGas int64 `json:"max_gas"`
|
||||
}
|
||||
type BlockGossip struct {
|
||||
BlockPartSizeBytes int `json:"block_part_size_bytes"` // NOTE: must not be 0
|
||||
}
|
||||
type EvidenceParams struct {
|
||||
MaxAge int64 `json:"max_age"` // only accept new evidence more recent than this
|
||||
AppState json.RawMessage `json:"app_state,omitempty"`
|
||||
}
|
||||
|
||||
// GenesisDocFromFile reads JSON data from a file and unmarshalls it into a GenesisDoc.
|
||||
|
||||
Reference in New Issue
Block a user