mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-03 03:35:19 +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:
@@ -16,8 +16,8 @@ import (
|
||||
cfg "github.com/tendermint/tendermint/config"
|
||||
"github.com/tendermint/tendermint/crypto/ed25519"
|
||||
"github.com/tendermint/tendermint/evidence"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
"github.com/tendermint/tendermint/libs/rand"
|
||||
mempl "github.com/tendermint/tendermint/mempool"
|
||||
"github.com/tendermint/tendermint/p2p"
|
||||
p2pmock "github.com/tendermint/tendermint/p2p/mock"
|
||||
@@ -174,7 +174,7 @@ func TestPrivValidatorListenAddrNoProtocol(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestNodeSetPrivValIPC(t *testing.T) {
|
||||
tmpfile := "/tmp/kms." + cmn.RandStr(6) + ".sock"
|
||||
tmpfile := "/tmp/kms." + rand.RandStr(6) + ".sock"
|
||||
defer os.Remove(tmpfile) // clean up
|
||||
|
||||
config := cfg.ResetTestRoot("node_priv_val_tcp_test")
|
||||
@@ -257,7 +257,7 @@ func TestCreateProposalBlock(t *testing.T) {
|
||||
minEvSize := 12
|
||||
numEv := (maxBytes / types.MaxEvidenceBytesDenominator) / minEvSize
|
||||
for i := 0; i < numEv; i++ {
|
||||
ev := types.NewMockRandomGoodEvidence(1, proposerAddr, cmn.RandBytes(minEvSize))
|
||||
ev := types.NewMockRandomGoodEvidence(1, proposerAddr, rand.RandBytes(minEvSize))
|
||||
err := evidencePool.AddEvidence(ev)
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
@@ -266,7 +266,7 @@ func TestCreateProposalBlock(t *testing.T) {
|
||||
// than can fit in a block
|
||||
txLength := 1000
|
||||
for i := 0; i < maxBytes/txLength; i++ {
|
||||
tx := cmn.RandBytes(txLength)
|
||||
tx := rand.RandBytes(txLength)
|
||||
err := mempool.CheckTx(tx, nil, mempl.TxInfo{})
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user