Skip to content

Commit 3f44d45

Browse files
chore: use value instead of pointer
1 parent ecac4b2 commit 3f44d45

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

dot/network/notifications_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,9 @@ func TestCreateNotificationsMessageHandler_BlockAnnounceHandshake(t *testing.T)
198198
err = handler(stream, testHandshake)
199199
require.ErrorIs(t, err, errCannotValidateHandshake)
200200

201-
expectedError := fmt.Errorf("handling handshake: %w from peer %s using protocol %s: %s",
202-
errCannotValidateHandshake, testPeerID, info.protocolID, errors.New("genesis hash mismatch"))
203-
require.EqualError(t, err, expectedError.Error())
201+
expectedErrorMessage := fmt.Sprintf("handling handshake: %s from peer %s using protocol %s: genesis hash mismatch",
202+
errCannotValidateHandshake, testPeerID, info.protocolID)
203+
require.EqualError(t, err, expectedErrorMessage)
204204

205205
data := info.peersData.getInboundHandshakeData(testPeerID)
206206
require.NotNil(t, data)

dot/sync/chain_processor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ type chainProcessorConfig struct {
5757
telemetry telemetry.Client
5858
}
5959

60-
func newChainProcessor(cfg *chainProcessorConfig) *chainProcessor {
60+
func newChainProcessor(cfg chainProcessorConfig) *chainProcessor {
6161
ctx, cancel := context.WithCancel(context.Background())
6262

6363
return &chainProcessor{

dot/sync/chain_processor_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ func Test_newChainProcessor(t *testing.T) {
11481148
tt := tt
11491149
t.Run(tt.name, func(t *testing.T) {
11501150
t.Parallel()
1151-
cpCfg := &chainProcessorConfig{
1151+
cpCfg := chainProcessorConfig{
11521152
readyBlocks: tt.args.readyBlocks,
11531153
pendingBlocks: tt.args.pendingBlocks,
11541154
blockState: tt.args.blockState,

dot/sync/chain_sync.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ type chainSyncConfig struct {
176176
slotDuration time.Duration
177177
}
178178

179-
func newChainSync(cfg *chainSyncConfig) *chainSync {
179+
func newChainSync(cfg chainSyncConfig) *chainSync {
180180
ctx, cancel := context.WithCancel(context.Background())
181181
const syncSamplesToKeep = 30
182182
const logSyncPeriod = 5 * time.Second

dot/sync/chain_sync_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ func TestChainSync_validateResponse(t *testing.T) {
865865
t.Parallel()
866866
ctrl := gomock.NewController(t)
867867

868-
cfg := &chainSyncConfig{
868+
cfg := chainSyncConfig{
869869
bs: tt.blockStateBuilder(ctrl),
870870
pendingBlocks: newDisjointBlockSet(pendingBlocksLimit),
871871
readyBlocks: newBlockQueue(maxResponseSize),
@@ -1601,7 +1601,7 @@ func newTestChainSyncWithReadyBlocks(ctrl *gomock.Controller, readyBlocks *block
16011601
mockBlockState := NewMockBlockState(ctrl)
16021602
mockBlockState.EXPECT().GetFinalisedNotifierChannel().Return(make(chan *types.FinalisationInfo))
16031603

1604-
cfg := &chainSyncConfig{
1604+
cfg := chainSyncConfig{
16051605
bs: mockBlockState,
16061606
readyBlocks: readyBlocks,
16071607
pendingBlocks: newDisjointBlockSet(pendingBlocksLimit),

dot/sync/syncer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func NewService(cfg *Config) (*Service, error) {
4646
readyBlocks := newBlockQueue(maxResponseSize * 30)
4747
pendingBlocks := newDisjointBlockSet(pendingBlocksLimit)
4848

49-
csCfg := &chainSyncConfig{
49+
csCfg := chainSyncConfig{
5050
bs: cfg.BlockState,
5151
net: cfg.Network,
5252
readyBlocks: readyBlocks,
@@ -57,7 +57,7 @@ func NewService(cfg *Config) (*Service, error) {
5757
}
5858
chainSync := newChainSync(csCfg)
5959

60-
cpCfg := &chainProcessorConfig{
60+
cpCfg := chainProcessorConfig{
6161
readyBlocks: readyBlocks,
6262
pendingBlocks: pendingBlocks,
6363
syncer: chainSync,

0 commit comments

Comments
 (0)