Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
george-dorin committed Nov 13, 2024
1 parent c6693a8 commit 6d5008a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions core/services/ocrcommon/transmitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ type ocr2FeedsDualTransmission struct {
}

func (t *ocr2FeedsDualTransmission) CreateEthTransaction(ctx context.Context, toAddress common.Address, payload []byte, txMeta *txmgr.TxMeta) error {
//Primary transmission
// Primary transmission
err := t.transmitter.CreateEthTransaction(ctx, toAddress, payload, txMeta)
if err != nil {
return err
Expand All @@ -239,7 +239,7 @@ func (t *ocr2FeedsDualTransmission) CreateEthTransaction(ctx context.Context, to
txMeta.DualBroadcast = true
txMeta.DualBroadcastParams = t.urlParams()

//Secondary transmission
// Secondary transmission
_, err = t.transmitter.txm.CreateTransaction(ctx, txmgr.TxRequest{
FromAddress: t.secondaryFromAddress,
ToAddress: t.secondaryContractAddress,
Expand Down
22 changes: 11 additions & 11 deletions core/services/ocrcommon/transmitter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,23 +217,23 @@ func Test_DualTransmitter(t *testing.T) {
require.NoError(t, err)

primaryTxConfirmed := false
seconryTxConfirmed := false
secondaryTxConfirmed := false

txm.On("CreateTransaction", mock.Anything, mock.MatchedBy(func(tx txmgr.TxRequest) bool {
if tx.FromAddress == fromAddress {
//Primary transmission
switch tx.FromAddress {
case fromAddress:
// Primary transmission
assert.Equal(t, tx.ToAddress, toAddress, "unexpected primary toAddress")
assert.Nil(t, tx.Meta, "Meta should be empty")
primaryTxConfirmed = true
} else if tx.FromAddress == secondaryFromAddress {
//Secondary transmission
case secondaryFromAddress:
// Secondary transmission
assert.Equal(t, tx.ToAddress, secondaryContractAddress, "unexpected secondary toAddress")
assert.True(t, tx.Meta.DualBroadcast, "DualBroadcast should be true")
assert.Equal(t, tx.Meta.DualBroadcastParams, "key1=value1&key2=value2&key2=value3&key3=value4&key3=value5&key3=value6", "DualBroadcastParams not equal")
seconryTxConfirmed = true

} else {
//Should never be reached
assert.Equal(t, "key1=value1&key2=value2&key2=value3&key3=value4&key3=value5&key3=value6", tx.Meta.DualBroadcastParams, "DualBroadcastParams not equal")
secondaryTxConfirmed = true
default:
// Should never be reached
return false
}

Expand All @@ -243,5 +243,5 @@ func Test_DualTransmitter(t *testing.T) {
require.NoError(t, transmitter.CreateEthTransaction(testutils.Context(t), toAddress, payload, nil))

require.True(t, primaryTxConfirmed)
require.True(t, seconryTxConfirmed)
require.True(t, secondaryTxConfirmed)
}

0 comments on commit 6d5008a

Please sign in to comment.