diff --git a/benchmarks/codec_test.go b/benchmarks/codec_test.go index 7162e63d..3650d281 100644 --- a/benchmarks/codec_test.go +++ b/benchmarks/codec_test.go @@ -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" ) diff --git a/blockchain/reactor.go b/blockchain/reactor.go index 64e5e937..4693eee5 100644 --- a/blockchain/reactor.go +++ b/blockchain/reactor.go @@ -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, diff --git a/blockchain/store.go b/blockchain/store.go index 5bf85477..7e1859f2 100644 --- a/blockchain/store.go +++ b/blockchain/store.go @@ -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" diff --git a/cmd/tendermint/commands/init.go b/cmd/tendermint/commands/init.go index cbafac3e..f823de61 100644 --- a/cmd/tendermint/commands/init.go +++ b/cmd/tendermint/commands/init.go @@ -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, }} diff --git a/consensus/reactor.go b/consensus/reactor.go index 11cd0750..cc8faf4c 100644 --- a/consensus/reactor.go +++ b/consensus/reactor.go @@ -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, diff --git a/mempool/reactor.go b/mempool/reactor.go index 6a876520..9e51d2df 100644 --- a/mempool/reactor.go +++ b/mempool/reactor.go @@ -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, }, diff --git a/p2p/peer_test.go b/p2p/peer_test.go index ba52b22a..a027a6b7 100644 --- a/p2p/peer_test.go +++ b/p2p/peer_test.go @@ -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() diff --git a/p2p/pex_reactor.go b/p2p/pex_reactor.go index fd70198f..7c799cca 100644 --- a/p2p/pex_reactor.go +++ b/p2p/pex_reactor.go @@ -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, diff --git a/p2p/switch_test.go b/p2p/switch_test.go index 1ea79efe..e82eead9 100644 --- a/p2p/switch_test.go +++ b/p2p/switch_test.go @@ -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 }) diff --git a/state/execution_test.go b/state/execution_test.go index 8fcdcf1c..626b2ecd 100644 --- a/state/execution_test.go +++ b/state/execution_test.go @@ -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, }) diff --git a/state/txindex/kv/kv.go b/state/txindex/kv/kv.go index db075e54..3d4f93a4 100644 --- a/state/txindex/kv/kv.go +++ b/state/txindex/kv/kv.go @@ -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). diff --git a/types/validator_set_test.go b/types/validator_set_test.go index a285adee..572b7b00 100644 --- a/types/validator_set_test.go +++ b/types/validator_set_test.go @@ -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" )