libs/common: refactor libs/common 2 (#4231)

* libs/common: refactor libs/common 2

- move random function to there own pkg

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* change imports and usage throughout repo

* fix goimports

* add changelog entry
This commit is contained in:
Marko
2019-12-10 18:38:34 +01:00
committed by GitHub
parent dfebac86f7
commit afc4d7a61f
55 changed files with 221 additions and 196 deletions

View File

@@ -9,8 +9,8 @@ import (
"github.com/tendermint/tendermint/abci/example/kvstore"
"github.com/tendermint/tendermint/abci/server"
"github.com/tendermint/tendermint/abci/types"
cmn "github.com/tendermint/tendermint/libs/common"
"github.com/tendermint/tendermint/libs/log"
"github.com/tendermint/tendermint/libs/rand"
)
//----------------------------------------
@@ -46,7 +46,7 @@ func (app *appConnTest) InfoSync(req types.RequestInfo) (*types.ResponseInfo, er
var SOCKET = "socket"
func TestEcho(t *testing.T) {
sockPath := fmt.Sprintf("unix:///tmp/echo_%v.sock", cmn.RandStr(6))
sockPath := fmt.Sprintf("unix:///tmp/echo_%v.sock", rand.RandStr(6))
clientCreator := NewRemoteClientCreator(sockPath, SOCKET, true)
// Start server
@@ -80,7 +80,7 @@ func TestEcho(t *testing.T) {
func BenchmarkEcho(b *testing.B) {
b.StopTimer() // Initialize
sockPath := fmt.Sprintf("unix:///tmp/echo_%v.sock", cmn.RandStr(6))
sockPath := fmt.Sprintf("unix:///tmp/echo_%v.sock", rand.RandStr(6))
clientCreator := NewRemoteClientCreator(sockPath, SOCKET, true)
// Start server
@@ -119,7 +119,7 @@ func BenchmarkEcho(b *testing.B) {
}
func TestInfo(t *testing.T) {
sockPath := fmt.Sprintf("unix:///tmp/echo_%v.sock", cmn.RandStr(6))
sockPath := fmt.Sprintf("unix:///tmp/echo_%v.sock", rand.RandStr(6))
clientCreator := NewRemoteClientCreator(sockPath, SOCKET, true)
// Start server