Skip to content

Commit

Permalink
Remove old reporters
Browse files Browse the repository at this point in the history
  • Loading branch information
kalverra committed Jul 11, 2023
1 parent f762335 commit a6c2cf2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 35 deletions.
2 changes: 1 addition & 1 deletion integration-tests/actions/ocr2_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ func StartNewOCR2Round(
if err != nil {
return fmt.Errorf("requesting new OCR round %d have failed: %w", i+1, err)
}
ocrRound := contracts.NewOffchainAggregatorV2RoundConfirmer(ocrInstances[i], big.NewInt(roundNumber), timeout, nil)
ocrRound := contracts.NewOffchainAggregatorV2RoundConfirmer(ocrInstances[i], big.NewInt(roundNumber), timeout)
client.AddHeaderEventSubscription(ocrInstances[i].Address(), ocrRound)
err = client.WaitForEvents()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/actions/ocr_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ func StartNewRound(
if err != nil {
return fmt.Errorf("requesting new OCR round %d have failed: %w", i+1, err)
}
ocrRound := contracts.NewOffchainAggregatorRoundConfirmer(ocrInstances[i], big.NewInt(roundNumber), client.GetNetworkConfig().Timeout.Duration, nil)
ocrRound := contracts.NewOffchainAggregatorRoundConfirmer(ocrInstances[i], big.NewInt(roundNumber), client.GetNetworkConfig().Timeout.Duration)
client.AddHeaderEventSubscription(ocrInstances[i].Address(), ocrRound)
err = client.WaitForEvents()
if err != nil {
Expand Down
59 changes: 26 additions & 33 deletions integration-tests/contracts/ethereum_contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import (

"github.com/smartcontractkit/chainlink/integration-tests/client"
eth_contracts "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum"
"github.com/smartcontractkit/chainlink/integration-tests/testreporters"
)

// EthereumOracle oracle for "directrequest" job tests
Expand Down Expand Up @@ -1006,32 +1005,29 @@ func (o *RunlogRoundConfirmer) Wait() error {

// OffchainAggregatorRoundConfirmer is a header subscription that awaits for a certain OCR round to be completed
type OffchainAggregatorRoundConfirmer struct {
ocrInstance OffchainAggregator
roundID *big.Int
doneChan chan struct{}
context context.Context
cancel context.CancelFunc
optionalTestReport *testreporters.OCRSoakTestReport
blocksSinceAnswer uint
complete bool
ocrInstance OffchainAggregator
roundID *big.Int
doneChan chan struct{}
context context.Context
cancel context.CancelFunc
blocksSinceAnswer uint
complete bool
}

// NewOffchainAggregatorRoundConfirmer provides a new instance of a OffchainAggregatorRoundConfirmer
func NewOffchainAggregatorRoundConfirmer(
contract OffchainAggregator,
roundID *big.Int,
timeout time.Duration,
optionalTestReport *testreporters.OCRSoakTestReport,
) *OffchainAggregatorRoundConfirmer {
ctx, ctxCancel := context.WithTimeout(context.Background(), timeout)
return &OffchainAggregatorRoundConfirmer{
ocrInstance: contract,
roundID: roundID,
doneChan: make(chan struct{}),
context: ctx,
cancel: ctxCancel,
optionalTestReport: optionalTestReport,
complete: false,
ocrInstance: contract,
roundID: roundID,
doneChan: make(chan struct{}),
context: ctx,
cancel: ctxCancel,
complete: false,
}
}

Expand Down Expand Up @@ -1083,32 +1079,29 @@ func (o *OffchainAggregatorRoundConfirmer) Complete() bool {

// OffchainAggregatorRoundConfirmer is a header subscription that awaits for a certain OCR round to be completed
type OffchainAggregatorV2RoundConfirmer struct {
ocrInstance OffchainAggregatorV2
roundID *big.Int
doneChan chan struct{}
context context.Context
cancel context.CancelFunc
optionalTestReport *testreporters.OCRSoakTestReport
blocksSinceAnswer uint
complete bool
ocrInstance OffchainAggregatorV2
roundID *big.Int
doneChan chan struct{}
context context.Context
cancel context.CancelFunc
blocksSinceAnswer uint
complete bool
}

// NewOffchainAggregatorRoundConfirmer provides a new instance of a OffchainAggregatorRoundConfirmer
func NewOffchainAggregatorV2RoundConfirmer(
contract OffchainAggregatorV2,
roundID *big.Int,
timeout time.Duration,
optionalTestReport *testreporters.OCRSoakTestReport,
) *OffchainAggregatorV2RoundConfirmer {
ctx, ctxCancel := context.WithTimeout(context.Background(), timeout)
return &OffchainAggregatorV2RoundConfirmer{
ocrInstance: contract,
roundID: roundID,
doneChan: make(chan struct{}),
context: ctx,
cancel: ctxCancel,
optionalTestReport: optionalTestReport,
complete: false,
ocrInstance: contract,
roundID: roundID,
doneChan: make(chan struct{}),
context: ctx,
cancel: ctxCancel,
complete: false,
}
}

Expand Down

0 comments on commit a6c2cf2

Please sign in to comment.