mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-30 19:55:42 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user