mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-13 13:21:20 +00:00
linting: apply 'gofmt -s -w' throughout
This commit is contained in:
committed by
Ethan Buchman
parent
fc33576bac
commit
46ccbcbff6
@ -4,9 +4,9 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/tendermint/go-crypto"
|
"github.com/tendermint/go-crypto"
|
||||||
"github.com/tendermint/tendermint/p2p"
|
|
||||||
"github.com/tendermint/go-wire"
|
"github.com/tendermint/go-wire"
|
||||||
proto "github.com/tendermint/tendermint/benchmarks/proto"
|
proto "github.com/tendermint/tendermint/benchmarks/proto"
|
||||||
|
"github.com/tendermint/tendermint/p2p"
|
||||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ func (bcR *BlockchainReactor) OnStop() {
|
|||||||
// GetChannels implements Reactor
|
// GetChannels implements Reactor
|
||||||
func (bcR *BlockchainReactor) GetChannels() []*p2p.ChannelDescriptor {
|
func (bcR *BlockchainReactor) GetChannels() []*p2p.ChannelDescriptor {
|
||||||
return []*p2p.ChannelDescriptor{
|
return []*p2p.ChannelDescriptor{
|
||||||
&p2p.ChannelDescriptor{
|
{
|
||||||
ID: BlockchainChannel,
|
ID: BlockchainChannel,
|
||||||
Priority: 10,
|
Priority: 10,
|
||||||
SendQueueCapacity: 1000,
|
SendQueueCapacity: 1000,
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
wire "github.com/tendermint/go-wire"
|
"github.com/tendermint/go-wire"
|
||||||
"github.com/tendermint/tendermint/types"
|
"github.com/tendermint/tendermint/types"
|
||||||
. "github.com/tendermint/tmlibs/common"
|
. "github.com/tendermint/tmlibs/common"
|
||||||
dbm "github.com/tendermint/tmlibs/db"
|
dbm "github.com/tendermint/tmlibs/db"
|
||||||
|
@ -28,7 +28,7 @@ func initFiles(cmd *cobra.Command, args []string) {
|
|||||||
genDoc := types.GenesisDoc{
|
genDoc := types.GenesisDoc{
|
||||||
ChainID: cmn.Fmt("test-chain-%v", cmn.RandStr(6)),
|
ChainID: cmn.Fmt("test-chain-%v", cmn.RandStr(6)),
|
||||||
}
|
}
|
||||||
genDoc.Validators = []types.GenesisValidator{types.GenesisValidator{
|
genDoc.Validators = []types.GenesisValidator{{
|
||||||
PubKey: privValidator.GetPubKey(),
|
PubKey: privValidator.GetPubKey(),
|
||||||
Power: 10,
|
Power: 10,
|
||||||
}}
|
}}
|
||||||
|
@ -102,24 +102,24 @@ func (conR *ConsensusReactor) SwitchToConsensus(state *sm.State, blocksSynced in
|
|||||||
func (conR *ConsensusReactor) GetChannels() []*p2p.ChannelDescriptor {
|
func (conR *ConsensusReactor) GetChannels() []*p2p.ChannelDescriptor {
|
||||||
// TODO optimize
|
// TODO optimize
|
||||||
return []*p2p.ChannelDescriptor{
|
return []*p2p.ChannelDescriptor{
|
||||||
&p2p.ChannelDescriptor{
|
{
|
||||||
ID: StateChannel,
|
ID: StateChannel,
|
||||||
Priority: 5,
|
Priority: 5,
|
||||||
SendQueueCapacity: 100,
|
SendQueueCapacity: 100,
|
||||||
},
|
},
|
||||||
&p2p.ChannelDescriptor{
|
{
|
||||||
ID: DataChannel, // maybe split between gossiping current block and catchup stuff
|
ID: DataChannel, // maybe split between gossiping current block and catchup stuff
|
||||||
Priority: 10, // once we gossip the whole block there's nothing left to send until next height or round
|
Priority: 10, // once we gossip the whole block there's nothing left to send until next height or round
|
||||||
SendQueueCapacity: 100,
|
SendQueueCapacity: 100,
|
||||||
RecvBufferCapacity: 50 * 4096,
|
RecvBufferCapacity: 50 * 4096,
|
||||||
},
|
},
|
||||||
&p2p.ChannelDescriptor{
|
{
|
||||||
ID: VoteChannel,
|
ID: VoteChannel,
|
||||||
Priority: 5,
|
Priority: 5,
|
||||||
SendQueueCapacity: 100,
|
SendQueueCapacity: 100,
|
||||||
RecvBufferCapacity: 100 * 100,
|
RecvBufferCapacity: 100 * 100,
|
||||||
},
|
},
|
||||||
&p2p.ChannelDescriptor{
|
{
|
||||||
ID: VoteSetBitsChannel,
|
ID: VoteSetBitsChannel,
|
||||||
Priority: 1,
|
Priority: 1,
|
||||||
SendQueueCapacity: 2,
|
SendQueueCapacity: 2,
|
||||||
|
@ -50,7 +50,7 @@ func (memR *MempoolReactor) SetLogger(l log.Logger) {
|
|||||||
// It returns the list of channels for this reactor.
|
// It returns the list of channels for this reactor.
|
||||||
func (memR *MempoolReactor) GetChannels() []*p2p.ChannelDescriptor {
|
func (memR *MempoolReactor) GetChannels() []*p2p.ChannelDescriptor {
|
||||||
return []*p2p.ChannelDescriptor{
|
return []*p2p.ChannelDescriptor{
|
||||||
&p2p.ChannelDescriptor{
|
{
|
||||||
ID: MempoolChannel,
|
ID: MempoolChannel,
|
||||||
Priority: 5,
|
Priority: 5,
|
||||||
},
|
},
|
||||||
|
@ -78,7 +78,7 @@ func TestPeerSend(t *testing.T) {
|
|||||||
|
|
||||||
func createOutboundPeerAndPerformHandshake(addr *NetAddress, config *PeerConfig) (*peer, error) {
|
func createOutboundPeerAndPerformHandshake(addr *NetAddress, config *PeerConfig) (*peer, error) {
|
||||||
chDescs := []*ChannelDescriptor{
|
chDescs := []*ChannelDescriptor{
|
||||||
&ChannelDescriptor{ID: 0x01, Priority: 1},
|
{ID: 0x01, Priority: 1},
|
||||||
}
|
}
|
||||||
reactorsByCh := map[byte]Reactor{0x01: NewTestReactor(chDescs, true)}
|
reactorsByCh := map[byte]Reactor{0x01: NewTestReactor(chDescs, true)}
|
||||||
pk := crypto.GenPrivKeyEd25519()
|
pk := crypto.GenPrivKeyEd25519()
|
||||||
|
@ -82,7 +82,7 @@ func (r *PEXReactor) OnStop() {
|
|||||||
// GetChannels implements Reactor
|
// GetChannels implements Reactor
|
||||||
func (r *PEXReactor) GetChannels() []*ChannelDescriptor {
|
func (r *PEXReactor) GetChannels() []*ChannelDescriptor {
|
||||||
return []*ChannelDescriptor{
|
return []*ChannelDescriptor{
|
||||||
&ChannelDescriptor{
|
{
|
||||||
ID: PexChannel,
|
ID: PexChannel,
|
||||||
Priority: 1,
|
Priority: 1,
|
||||||
SendQueueCapacity: 10,
|
SendQueueCapacity: 10,
|
||||||
|
@ -100,12 +100,12 @@ func makeSwitchPair(t testing.TB, initSwitch func(int, *Switch) *Switch) (*Switc
|
|||||||
func initSwitchFunc(i int, sw *Switch) *Switch {
|
func initSwitchFunc(i int, sw *Switch) *Switch {
|
||||||
// Make two reactors of two channels each
|
// Make two reactors of two channels each
|
||||||
sw.AddReactor("foo", NewTestReactor([]*ChannelDescriptor{
|
sw.AddReactor("foo", NewTestReactor([]*ChannelDescriptor{
|
||||||
&ChannelDescriptor{ID: byte(0x00), Priority: 10},
|
{ID: byte(0x00), Priority: 10},
|
||||||
&ChannelDescriptor{ID: byte(0x01), Priority: 10},
|
{ID: byte(0x01), Priority: 10},
|
||||||
}, true))
|
}, true))
|
||||||
sw.AddReactor("bar", NewTestReactor([]*ChannelDescriptor{
|
sw.AddReactor("bar", NewTestReactor([]*ChannelDescriptor{
|
||||||
&ChannelDescriptor{ID: byte(0x02), Priority: 10},
|
{ID: byte(0x02), Priority: 10},
|
||||||
&ChannelDescriptor{ID: byte(0x03), Priority: 10},
|
{ID: byte(0x03), Priority: 10},
|
||||||
}, true))
|
}, true))
|
||||||
return sw
|
return sw
|
||||||
}
|
}
|
||||||
@ -295,12 +295,12 @@ func BenchmarkSwitches(b *testing.B) {
|
|||||||
s1, s2 := makeSwitchPair(b, func(i int, sw *Switch) *Switch {
|
s1, s2 := makeSwitchPair(b, func(i int, sw *Switch) *Switch {
|
||||||
// Make bar reactors of bar channels each
|
// Make bar reactors of bar channels each
|
||||||
sw.AddReactor("foo", NewTestReactor([]*ChannelDescriptor{
|
sw.AddReactor("foo", NewTestReactor([]*ChannelDescriptor{
|
||||||
&ChannelDescriptor{ID: byte(0x00), Priority: 10},
|
{ID: byte(0x00), Priority: 10},
|
||||||
&ChannelDescriptor{ID: byte(0x01), Priority: 10},
|
{ID: byte(0x01), Priority: 10},
|
||||||
}, false))
|
}, false))
|
||||||
sw.AddReactor("bar", NewTestReactor([]*ChannelDescriptor{
|
sw.AddReactor("bar", NewTestReactor([]*ChannelDescriptor{
|
||||||
&ChannelDescriptor{ID: byte(0x02), Priority: 10},
|
{ID: byte(0x02), Priority: 10},
|
||||||
&ChannelDescriptor{ID: byte(0x03), Priority: 10},
|
{ID: byte(0x03), Priority: 10},
|
||||||
}, false))
|
}, false))
|
||||||
return sw
|
return sw
|
||||||
})
|
})
|
||||||
|
@ -59,7 +59,7 @@ func state() *State {
|
|||||||
s, _ := MakeGenesisState(dbm.NewMemDB(), &types.GenesisDoc{
|
s, _ := MakeGenesisState(dbm.NewMemDB(), &types.GenesisDoc{
|
||||||
ChainID: chainID,
|
ChainID: chainID,
|
||||||
Validators: []types.GenesisValidator{
|
Validators: []types.GenesisValidator{
|
||||||
types.GenesisValidator{privKey.PubKey(), 10000, "test"},
|
{privKey.PubKey(), 10000, "test"},
|
||||||
},
|
},
|
||||||
AppHash: nil,
|
AppHash: nil,
|
||||||
})
|
})
|
||||||
|
@ -10,6 +10,7 @@ import (
|
|||||||
|
|
||||||
"github.com/tendermint/tendermint/state/txindex"
|
"github.com/tendermint/tendermint/state/txindex"
|
||||||
"github.com/tendermint/tendermint/types"
|
"github.com/tendermint/tendermint/types"
|
||||||
|
db "github.com/tendermint/tmlibs/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TxIndex is the simplest possible indexer, backed by Key-Value storage (levelDB).
|
// TxIndex is the simplest possible indexer, backed by Key-Value storage (levelDB).
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/tendermint/go-crypto"
|
"github.com/tendermint/go-crypto"
|
||||||
wire "github.com/tendermint/go-wire"
|
"github.com/tendermint/go-wire"
|
||||||
cmn "github.com/tendermint/tmlibs/common"
|
cmn "github.com/tendermint/tmlibs/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user