mirror of
https://github.com/tendermint/tendermint.git
synced 2025-12-23 14:25:19 +00:00
33 lines
633 B
Go
33 lines
633 B
Go
package test
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/tendermint/tendermint/types"
|
|
)
|
|
|
|
func GenesisDoc(
|
|
time time.Time,
|
|
validators []*types.Validator,
|
|
consensusParams *types.ConsensusParams,
|
|
chainID string,
|
|
) *types.GenesisDoc {
|
|
|
|
genesisValidators := make([]types.GenesisValidator, len(validators))
|
|
|
|
for i := range validators {
|
|
genesisValidators[i] = types.GenesisValidator{
|
|
Power: validators[i].VotingPower,
|
|
PubKey: validators[i].PubKey,
|
|
}
|
|
}
|
|
|
|
return &types.GenesisDoc{
|
|
GenesisTime: time,
|
|
InitialHeight: 1,
|
|
ChainID: chainID,
|
|
Validators: genesisValidators,
|
|
ConsensusParams: consensusParams,
|
|
}
|
|
}
|