Browse Source

linting: apply 'gofmt -s -w' throughout

pull/703/head
Zach Ramsay 7 years ago
committed by Ethan Buchman
parent
commit
46ccbcbff6
12 changed files with 22 additions and 21 deletions
  1. +1
    -1
      benchmarks/codec_test.go
  2. +1
    -1
      blockchain/reactor.go
  3. +1
    -1
      blockchain/store.go
  4. +1
    -1
      cmd/tendermint/commands/init.go
  5. +4
    -4
      consensus/reactor.go
  6. +1
    -1
      mempool/reactor.go
  7. +1
    -1
      p2p/peer_test.go
  8. +1
    -1
      p2p/pex_reactor.go
  9. +8
    -8
      p2p/switch_test.go
  10. +1
    -1
      state/execution_test.go
  11. +1
    -0
      state/txindex/kv/kv.go
  12. +1
    -1
      types/validator_set_test.go

+ 1
- 1
benchmarks/codec_test.go View File

@ -4,9 +4,9 @@ import (
"testing"
"github.com/tendermint/go-crypto"
"github.com/tendermint/tendermint/p2p"
"github.com/tendermint/go-wire"
proto "github.com/tendermint/tendermint/benchmarks/proto"
"github.com/tendermint/tendermint/p2p"
ctypes "github.com/tendermint/tendermint/rpc/core/types"
)


+ 1
- 1
blockchain/reactor.go View File

@ -108,7 +108,7 @@ func (bcR *BlockchainReactor) OnStop() {
// GetChannels implements Reactor
func (bcR *BlockchainReactor) GetChannels() []*p2p.ChannelDescriptor {
return []*p2p.ChannelDescriptor{
&p2p.ChannelDescriptor{
{
ID: BlockchainChannel,
Priority: 10,
SendQueueCapacity: 1000,


+ 1
- 1
blockchain/store.go View File

@ -7,7 +7,7 @@ import (
"io"
"sync"
wire "github.com/tendermint/go-wire"
"github.com/tendermint/go-wire"
"github.com/tendermint/tendermint/types"
. "github.com/tendermint/tmlibs/common"
dbm "github.com/tendermint/tmlibs/db"


+ 1
- 1
cmd/tendermint/commands/init.go View File

@ -28,7 +28,7 @@ func initFiles(cmd *cobra.Command, args []string) {
genDoc := types.GenesisDoc{
ChainID: cmn.Fmt("test-chain-%v", cmn.RandStr(6)),
}
genDoc.Validators = []types.GenesisValidator{types.GenesisValidator{
genDoc.Validators = []types.GenesisValidator{{
PubKey: privValidator.GetPubKey(),
Power: 10,
}}


+ 4
- 4
consensus/reactor.go View File

@ -102,24 +102,24 @@ func (conR *ConsensusReactor) SwitchToConsensus(state *sm.State, blocksSynced in
func (conR *ConsensusReactor) GetChannels() []*p2p.ChannelDescriptor {
// TODO optimize
return []*p2p.ChannelDescriptor{
&p2p.ChannelDescriptor{
{
ID: StateChannel,
Priority: 5,
SendQueueCapacity: 100,
},
&p2p.ChannelDescriptor{
{
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
SendQueueCapacity: 100,
RecvBufferCapacity: 50 * 4096,
},
&p2p.ChannelDescriptor{
{
ID: VoteChannel,
Priority: 5,
SendQueueCapacity: 100,
RecvBufferCapacity: 100 * 100,
},
&p2p.ChannelDescriptor{
{
ID: VoteSetBitsChannel,
Priority: 1,
SendQueueCapacity: 2,


+ 1
- 1
mempool/reactor.go View File

@ -50,7 +50,7 @@ func (memR *MempoolReactor) SetLogger(l log.Logger) {
// It returns the list of channels for this reactor.
func (memR *MempoolReactor) GetChannels() []*p2p.ChannelDescriptor {
return []*p2p.ChannelDescriptor{
&p2p.ChannelDescriptor{
{
ID: MempoolChannel,
Priority: 5,
},


+ 1
- 1
p2p/peer_test.go View File

@ -78,7 +78,7 @@ func TestPeerSend(t *testing.T) {
func createOutboundPeerAndPerformHandshake(addr *NetAddress, config *PeerConfig) (*peer, error) {
chDescs := []*ChannelDescriptor{
&ChannelDescriptor{ID: 0x01, Priority: 1},
{ID: 0x01, Priority: 1},
}
reactorsByCh := map[byte]Reactor{0x01: NewTestReactor(chDescs, true)}
pk := crypto.GenPrivKeyEd25519()


+ 1
- 1
p2p/pex_reactor.go View File

@ -82,7 +82,7 @@ func (r *PEXReactor) OnStop() {
// GetChannels implements Reactor
func (r *PEXReactor) GetChannels() []*ChannelDescriptor {
return []*ChannelDescriptor{
&ChannelDescriptor{
{
ID: PexChannel,
Priority: 1,
SendQueueCapacity: 10,


+ 8
- 8
p2p/switch_test.go View File

@ -100,12 +100,12 @@ func makeSwitchPair(t testing.TB, initSwitch func(int, *Switch) *Switch) (*Switc
func initSwitchFunc(i int, sw *Switch) *Switch {
// Make two reactors of two channels each
sw.AddReactor("foo", NewTestReactor([]*ChannelDescriptor{
&ChannelDescriptor{ID: byte(0x00), Priority: 10},
&ChannelDescriptor{ID: byte(0x01), Priority: 10},
{ID: byte(0x00), Priority: 10},
{ID: byte(0x01), Priority: 10},
}, true))
sw.AddReactor("bar", NewTestReactor([]*ChannelDescriptor{
&ChannelDescriptor{ID: byte(0x02), Priority: 10},
&ChannelDescriptor{ID: byte(0x03), Priority: 10},
{ID: byte(0x02), Priority: 10},
{ID: byte(0x03), Priority: 10},
}, true))
return sw
}
@ -295,12 +295,12 @@ func BenchmarkSwitches(b *testing.B) {
s1, s2 := makeSwitchPair(b, func(i int, sw *Switch) *Switch {
// Make bar reactors of bar channels each
sw.AddReactor("foo", NewTestReactor([]*ChannelDescriptor{
&ChannelDescriptor{ID: byte(0x00), Priority: 10},
&ChannelDescriptor{ID: byte(0x01), Priority: 10},
{ID: byte(0x00), Priority: 10},
{ID: byte(0x01), Priority: 10},
}, false))
sw.AddReactor("bar", NewTestReactor([]*ChannelDescriptor{
&ChannelDescriptor{ID: byte(0x02), Priority: 10},
&ChannelDescriptor{ID: byte(0x03), Priority: 10},
{ID: byte(0x02), Priority: 10},
{ID: byte(0x03), Priority: 10},
}, false))
return sw
})


+ 1
- 1
state/execution_test.go View File

@ -59,7 +59,7 @@ func state() *State {
s, _ := MakeGenesisState(dbm.NewMemDB(), &types.GenesisDoc{
ChainID: chainID,
Validators: []types.GenesisValidator{
types.GenesisValidator{privKey.PubKey(), 10000, "test"},
{privKey.PubKey(), 10000, "test"},
},
AppHash: nil,
})


+ 1
- 0
state/txindex/kv/kv.go View File

@ -10,6 +10,7 @@ import (
"github.com/tendermint/tendermint/state/txindex"
"github.com/tendermint/tendermint/types"
db "github.com/tendermint/tmlibs/db"
)
// TxIndex is the simplest possible indexer, backed by Key-Value storage (levelDB).


+ 1
- 1
types/validator_set_test.go View File

@ -6,7 +6,7 @@ import (
"testing"
"github.com/tendermint/go-crypto"
wire "github.com/tendermint/go-wire"
"github.com/tendermint/go-wire"
cmn "github.com/tendermint/tmlibs/common"
)


Loading…
Cancel
Save