diff --git a/action/protocol/poll/protocol.go b/action/protocol/poll/protocol.go index fe69b3e716..346daa7491 100644 --- a/action/protocol/poll/protocol.go +++ b/action/protocol/poll/protocol.go @@ -26,9 +26,8 @@ import ( ) const ( - _protocolID = "poll" - // RollDPoSScheme means randomized delegated proof of stake - RollDPoSScheme = "ROLLDPOS" + _protocolID = "poll" + _rollDPoSScheme = "ROLLDPOS" ) const ( @@ -139,7 +138,7 @@ func NewProtocol( productivity Productivity, getBlockHash evm.GetBlockHash, ) (Protocol, error) { - if scheme != RollDPoSScheme { + if scheme != _rollDPoSScheme { return nil, nil } diff --git a/action/protocol/poll/protocol_test.go b/action/protocol/poll/protocol_test.go index c30fcfabab..bbbc799f8b 100644 --- a/action/protocol/poll/protocol_test.go +++ b/action/protocol/poll/protocol_test.go @@ -29,7 +29,7 @@ func TestNewProtocol(t *testing.T) { g := genesis.Default g.ScoreThreshold = "1200000" p, err := NewProtocol( - RollDPoSScheme, + _rollDPoSScheme, blockchain.DefaultConfig, g, nil, diff --git a/action/protocol/rewarding/reward_test.go b/action/protocol/rewarding/reward_test.go index 6cad54d52a..71f554e7df 100644 --- a/action/protocol/rewarding/reward_test.go +++ b/action/protocol/rewarding/reward_test.go @@ -366,7 +366,6 @@ func TestProtocol_NoRewardAddr(t *testing.T) { }, } g := genesis.Default - bcf := blockchain.DefaultConfig committee := mock_committee.NewMockCommittee(ctrl) slasher, err := poll.NewSlasher( func(uint64, uint64) (map[string]uint64, error) { @@ -394,7 +393,7 @@ func TestProtocol_NoRewardAddr(t *testing.T) { committee, uint64(123456), func(uint64) (time.Time, error) { return time.Now(), nil }, - bcf.PollInitialCandidatesInterval, + blockchain.DefaultConfig.PollInitialCandidatesInterval, slasher, ) require.NoError(t, err) diff --git a/actpool/actpool_test.go b/actpool/actpool_test.go index 4026a0170f..2a4bea4993 100644 --- a/actpool/actpool_test.go +++ b/actpool/actpool_test.go @@ -1195,3 +1195,9 @@ func lenPendingActionMap(acts map[string][]action.SealedEnvelope) int { } return l } + +func TestValidateMinGasPrice(t *testing.T) { + ap := Config{MinGasPriceStr: DefaultConfig.MinGasPriceStr} + mgp := ap.MinGasPrice() + require.IsType(t, &big.Int{}, mgp) +} diff --git a/config/config_test.go b/config/config_test.go index db4c5b9d41..a98020861e 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -8,7 +8,6 @@ package config import ( "fmt" - "math/big" "os" "path/filepath" "strings" @@ -18,7 +17,6 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/require" - "github.com/iotexproject/iotex-core/actpool" "github.com/iotexproject/iotex-core/blockchain/genesis" ) @@ -312,13 +310,6 @@ func TestValidateActPool(t *testing.T) { ) } -func TestValidateMinGasPrice(t *testing.T) { - ap := actpool.Config{MinGasPriceStr: Default.ActPool.MinGasPriceStr} - mgp := ap.MinGasPrice() - fmt.Printf("%T,%v", mgp, mgp) - require.IsType(t, &big.Int{}, mgp) -} - func TestValidateForkHeights(t *testing.T) { r := require.New(t)