github.com/Finschia/finschia-sdk@v0.48.1/x/genutil/types/types.go (about)

     1  package types
     2  
     3  import (
     4  	"encoding/json"
     5  
     6  	"github.com/Finschia/finschia-sdk/client"
     7  	cryptotypes "github.com/Finschia/finschia-sdk/crypto/types"
     8  )
     9  
    10  // DONTCOVER
    11  
    12  type (
    13  	// AppMap map modules names with their json raw representation.
    14  	AppMap map[string]json.RawMessage
    15  
    16  	// MigrationCallback converts a genesis map from the previous version to the
    17  	// targeted one.
    18  	//
    19  	// TODO: MigrationCallback should also return an error upon failure.
    20  	MigrationCallback func(AppMap, client.Context) AppMap
    21  
    22  	// MigrationMap defines a mapping from a version to a MigrationCallback.
    23  	MigrationMap map[string]MigrationCallback
    24  )
    25  
    26  // ModuleName is genutil
    27  const ModuleName = "genutil"
    28  
    29  // InitConfig common config options for init
    30  type InitConfig struct {
    31  	ChainID   string
    32  	GenTxsDir string
    33  	NodeID    string
    34  	ValPubKey cryptotypes.PubKey
    35  }
    36  
    37  // NewInitConfig creates a new InitConfig object
    38  func NewInitConfig(chainID, genTxsDir, nodeID string, valPubKey cryptotypes.PubKey) InitConfig {
    39  	return InitConfig{
    40  		ChainID:   chainID,
    41  		GenTxsDir: genTxsDir,
    42  		NodeID:    nodeID,
    43  		ValPubKey: valPubKey,
    44  	}
    45  }