Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickhuie19 committed Sep 18, 2024
1 parent 5666f17 commit 4aeb68c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 45 deletions.
3 changes: 1 addition & 2 deletions core/services/ocr2/plugins/ccip/internal/pricegetter/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ func (d *DynamicPriceGetter) performBatchCall(ctx context.Context, chainID uint6

// Perform call
var decimalsReq uint8
var batchGetLatestValuesRequest types.BatchGetLatestValuesRequest
batchGetLatestValuesRequest = make(map[string]types.ContractBatch)
batchGetLatestValuesRequest := make(map[string]types.ContractBatch)
for i, call := range batchCalls.decimalCalls {
contractName := fmt.Sprintf("%v_%v", OFFCHAIN_AGGREGATOR, i)
batchGetLatestValuesRequest[contractName] = append(batchGetLatestValuesRequest[contractName], types.BatchRead{
Expand Down
44 changes: 1 addition & 43 deletions core/services/ocr2/plugins/ccip/internal/pricegetter/evm_test.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
package pricegetter

import (
"context"
"fmt"
"math/big"
"testing"

"github.com/smartcontractkit/chainlink/v2/core/capabilities/targets/mocks"

"github.com/smartcontractkit/chainlink-common/pkg/types/query"
"github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives"

"github.com/smartcontractkit/chainlink-common/pkg/types"

"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -831,6 +827,7 @@ func mockCR(t *testing.T, decimals []uint8, rounds []aggregator_v3_interface.Lat

// Mock batch calls per chain: all decimals calls then all latestRoundData calls.
// bGLVR = batchGetLatestValueResult
//nolint:all
var bGLVR types.BatchGetLatestValuesResult
bGLVR = make(map[string]types.ContractBatchResults, 1)

Expand Down Expand Up @@ -877,42 +874,3 @@ func mockErrCR(t *testing.T) *mocks.ChainReader {
func multExp(x *big.Int, e int64) *big.Int {
return big.NewInt(0).Mul(x, big.NewInt(0).Exp(big.NewInt(10), big.NewInt(e), nil))
}

type MockChainReader struct {
}

func (m MockChainReader) Start(ctx context.Context) error {
return nil
}

func (m MockChainReader) Close() error {
return nil
}

func (m MockChainReader) Ready() error {
return nil
}

func (m MockChainReader) HealthReport() map[string]error {
return map[string]error{}
}

func (m MockChainReader) Name() string {
return "MockChainReader"
}

func (m MockChainReader) GetLatestValue(ctx context.Context, contractName, method string, confidenceLevel primitives.ConfidenceLevel, params, returnVal any) error {
return nil
}

func (m MockChainReader) BatchGetLatestValues(ctx context.Context, request types.BatchGetLatestValuesRequest) (types.BatchGetLatestValuesResult, error) {
return nil, nil
}

func (m MockChainReader) Bind(ctx context.Context, bindings []types.BoundContract) error {
return nil
}

func (m MockChainReader) QueryKey(ctx context.Context, contractName string, filter query.KeyFilter, limitAndSort query.LimitAndSort, sequenceDataType any) ([]types.Sequence, error) {
return nil, nil
}

0 comments on commit 4aeb68c

Please sign in to comment.