Implement BFT time (#2203)

* Implement BFT time

* set LastValidators when creating state in state helper

for heights >= 2
This commit is contained in:
Zarko Milosevic
2018-09-01 01:33:51 +02:00
committed by Ethan Buchman
parent ffe91ae9e3
commit 7b88172f41
31 changed files with 306 additions and 112 deletions

View File

@@ -2,7 +2,6 @@ package commands
import (
"fmt"
"time"
"github.com/spf13/cobra"
@@ -11,6 +10,7 @@ import (
"github.com/tendermint/tendermint/p2p"
"github.com/tendermint/tendermint/privval"
"github.com/tendermint/tendermint/types"
tmtime "github.com/tendermint/tendermint/types/time"
)
// InitFilesCmd initialises a fresh Tendermint Core instance.
@@ -54,7 +54,7 @@ func initFilesWithConfig(config *cfg.Config) error {
} else {
genDoc := types.GenesisDoc{
ChainID: fmt.Sprintf("test-chain-%v", cmn.RandStr(6)),
GenesisTime: time.Now(),
GenesisTime: tmtime.Now(),
ConsensusParams: types.DefaultConsensusParams(),
}
genDoc.Validators = []types.GenesisValidator{{

View File

@@ -6,7 +6,6 @@ import (
"os"
"path/filepath"
"strings"
"time"
"github.com/spf13/cobra"
@@ -15,6 +14,7 @@ import (
"github.com/tendermint/tendermint/p2p"
"github.com/tendermint/tendermint/privval"
"github.com/tendermint/tendermint/types"
tmtime "github.com/tendermint/tendermint/types/time"
)
var (
@@ -112,7 +112,7 @@ func testnetFiles(cmd *cobra.Command, args []string) error {
// Generate genesis doc from generated validators
genDoc := &types.GenesisDoc{
GenesisTime: time.Now(),
GenesisTime: tmtime.Now(),
ChainID: "chain-" + cmn.RandStr(6),
Validators: genVals,
}