2019-07-24 14:37:03 -07:00
|
|
|
package types
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
|
|
|
|
"github.com/tendermint/tendermint/crypto"
|
|
|
|
)
|
|
|
|
|
|
|
|
// DONTCOVER
|
|
|
|
|
|
|
|
type (
|
2019-09-26 09:07:15 -07:00
|
|
|
// AppMap map modules names with their json raw representation.
|
2019-07-24 14:37:03 -07:00
|
|
|
AppMap map[string]json.RawMessage
|
2019-09-26 09:07:15 -07:00
|
|
|
|
|
|
|
// MigrationCallback converts a genesis map from the previous version to the
|
|
|
|
// targeted one.
|
|
|
|
//
|
|
|
|
// TODO: MigrationCallback should also return an error upon failure.
|
2019-07-24 14:37:03 -07:00
|
|
|
MigrationCallback func(AppMap) AppMap
|
2019-09-26 09:07:15 -07:00
|
|
|
|
|
|
|
// MigrationMap defines a mapping from a version to a MigrationCallback.
|
2019-07-24 14:37:03 -07:00
|
|
|
MigrationMap map[string]MigrationCallback
|
|
|
|
)
|
|
|
|
|
|
|
|
// ModuleName is genutil
|
|
|
|
const ModuleName = "genutil"
|
|
|
|
|
|
|
|
// InitConfig common config options for init
|
|
|
|
type InitConfig struct {
|
|
|
|
ChainID string
|
|
|
|
GenTxsDir string
|
|
|
|
NodeID string
|
|
|
|
ValPubKey crypto.PubKey
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewInitConfig creates a new InitConfig object
|
2020-07-06 14:48:54 -07:00
|
|
|
func NewInitConfig(chainID, genTxsDir, nodeID string, valPubKey crypto.PubKey) InitConfig {
|
2019-07-24 14:37:03 -07:00
|
|
|
return InitConfig{
|
|
|
|
ChainID: chainID,
|
|
|
|
GenTxsDir: genTxsDir,
|
|
|
|
NodeID: nodeID,
|
|
|
|
ValPubKey: valPubKey,
|
|
|
|
}
|
|
|
|
}
|