Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
millken committed Jul 12, 2022
1 parent 94ffd1c commit ed50c87
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
7 changes: 3 additions & 4 deletions action/protocol/poll/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ import (
)

const (
_protocolID = "poll"
// RollDPoSScheme means randomized delegated proof of stake
RollDPoSScheme = "ROLLDPOS"
_protocolID = "poll"
_rollDPoSScheme = "ROLLDPOS"
)

const (
Expand Down Expand Up @@ -139,7 +138,7 @@ func NewProtocol(
productivity Productivity,
getBlockHash evm.GetBlockHash,
) (Protocol, error) {
if scheme != RollDPoSScheme {
if scheme != _rollDPoSScheme {
return nil, nil
}

Expand Down
2 changes: 1 addition & 1 deletion action/protocol/poll/protocol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestNewProtocol(t *testing.T) {
g := genesis.Default
g.ScoreThreshold = "1200000"
p, err := NewProtocol(
RollDPoSScheme,
_rollDPoSScheme,
blockchain.DefaultConfig,
g,
nil,
Expand Down
3 changes: 1 addition & 2 deletions action/protocol/rewarding/reward_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions actpool/actpool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
9 changes: 0 additions & 9 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package config

import (
"fmt"
"math/big"
"os"
"path/filepath"
"strings"
Expand All @@ -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"
)

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit ed50c87

Please sign in to comment.