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
+2 -2
View File
@@ -8,7 +8,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/libs/common"
"github.com/tendermint/tendermint/libs/rand"
"github.com/tendermint/tendermint/types"
)
@@ -24,7 +24,7 @@ func getSignerTestCases(t *testing.T) []signerTestCase {
// Get test cases for each possible dialer (DialTCP / DialUnix / etc)
for _, dtc := range getDialerTestCases(t) {
chainID := common.RandStr(12)
chainID := rand.RandStr(12)
mockPV := types.NewMockPV()
// get a pair of signer listener, signer dialer endpoints
+3 -2
View File
@@ -11,6 +11,7 @@ import (
"github.com/tendermint/tendermint/crypto/ed25519"
cmn "github.com/tendermint/tendermint/libs/common"
"github.com/tendermint/tendermint/libs/log"
"github.com/tendermint/tendermint/libs/rand"
"github.com/tendermint/tendermint/types"
)
@@ -66,7 +67,7 @@ func TestSignerRemoteRetryTCPOnly(t *testing.T) {
SignerDialerEndpointTimeoutReadWrite(time.Millisecond)(dialerEndpoint)
SignerDialerEndpointConnRetries(retries)(dialerEndpoint)
chainID := cmn.RandStr(12)
chainID := rand.RandStr(12)
mockPV := types.NewMockPV()
signerServer := NewSignerServer(dialerEndpoint, chainID, mockPV)
@@ -86,7 +87,7 @@ func TestRetryConnToRemoteSigner(t *testing.T) {
for _, tc := range getDialerTestCases(t) {
var (
logger = log.TestingLogger()
chainID = cmn.RandStr(12)
chainID = rand.RandStr(12)
mockPV = types.NewMockPV()
endpointIsOpenCh = make(chan struct{})
thisConnTimeout = testTimeoutReadWrite