mirror of
https://github.com/tendermint/tendermint.git
synced 2026-07-28 02:52:48 +00:00
everything but binary, common, and blocks are explicitly imported.
This commit is contained in:
+4
-4
@@ -9,7 +9,7 @@ import (
|
||||
. "github.com/tendermint/tendermint/binary"
|
||||
. "github.com/tendermint/tendermint/blocks"
|
||||
. "github.com/tendermint/tendermint/common"
|
||||
. "github.com/tendermint/tendermint/db"
|
||||
db_ "github.com/tendermint/tendermint/db"
|
||||
"github.com/tendermint/tendermint/merkle"
|
||||
)
|
||||
|
||||
@@ -42,7 +42,7 @@ func (txErr InvalidTxError) Error() string {
|
||||
|
||||
// NOTE: not goroutine-safe.
|
||||
type State struct {
|
||||
DB DB
|
||||
DB db_.DB
|
||||
Height uint32 // Last known block height
|
||||
BlockHash []byte // Last known block hash
|
||||
CommitTime time.Time
|
||||
@@ -51,7 +51,7 @@ type State struct {
|
||||
UnbondingValidators *ValidatorSet
|
||||
}
|
||||
|
||||
func GenesisState(db DB, genesisTime time.Time, accDets []*AccountDetail) *State {
|
||||
func GenesisState(db db_.DB, genesisTime time.Time, accDets []*AccountDetail) *State {
|
||||
|
||||
// TODO: Use "uint64Codec" instead of BasicCodec
|
||||
accountDetails := merkle.NewIAVLTree(BasicCodec, AccountDetailCodec, defaultAccountDetailsCacheCapacity, db)
|
||||
@@ -84,7 +84,7 @@ func GenesisState(db DB, genesisTime time.Time, accDets []*AccountDetail) *State
|
||||
}
|
||||
}
|
||||
|
||||
func LoadState(db DB) *State {
|
||||
func LoadState(db db_.DB) *State {
|
||||
s := &State{DB: db}
|
||||
buf := db.Get(stateKey)
|
||||
if len(buf) == 0 {
|
||||
|
||||
+3
-3
@@ -4,7 +4,7 @@ import (
|
||||
. "github.com/tendermint/tendermint/blocks"
|
||||
. "github.com/tendermint/tendermint/common"
|
||||
. "github.com/tendermint/tendermint/config"
|
||||
. "github.com/tendermint/tendermint/db"
|
||||
db_ "github.com/tendermint/tendermint/db"
|
||||
|
||||
"bytes"
|
||||
"testing"
|
||||
@@ -25,7 +25,7 @@ func randAccountDetail(id uint64, status byte) (*AccountDetail, *PrivAccount) {
|
||||
|
||||
// The first numValidators accounts are validators.
|
||||
func randGenesisState(numAccounts int, numValidators int) (*State, []*PrivAccount) {
|
||||
db := NewMemDB()
|
||||
db := db_.NewMemDB()
|
||||
accountDetails := make([]*AccountDetail, numAccounts)
|
||||
privAccounts := make([]*PrivAccount, numAccounts)
|
||||
for i := 0; i < numAccounts; i++ {
|
||||
@@ -114,7 +114,7 @@ func TestGenesisSaveLoad(t *testing.T) {
|
||||
s0.Save(commitTime)
|
||||
|
||||
// Sanity check s0
|
||||
//s0.DB.(*MemDB).Print()
|
||||
//s0.DB.(*db_.MemDB).Print()
|
||||
if s0.BondedValidators.TotalVotingPower() == 0 {
|
||||
t.Error("s0 BondedValidators TotalVotingPower should not be 0")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user