-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
types.go
45 lines (36 loc) · 1.06 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package types
import (
"encoding/json"
"github.com/cosmos/cosmos-sdk/client"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
)
// DONTCOVER
type (
// AppMap map modules names with their json raw representation.
AppMap map[string]json.RawMessage
// MigrationCallback converts a genesis map from the previous version to the
// targeted one.
//
// TODO: MigrationCallback should also return an error upon failure.
MigrationCallback func(AppMap, client.Context) AppMap
// MigrationMap defines a mapping from a version to a MigrationCallback.
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 cryptotypes.PubKey
}
// NewInitConfig creates a new InitConfig object
func NewInitConfig(chainID, genTxsDir, nodeID string, valPubKey cryptotypes.PubKey) InitConfig {
return InitConfig{
ChainID: chainID,
GenTxsDir: genTxsDir,
NodeID: nodeID,
ValPubKey: valPubKey,
}
}