Skip to content

Commit

Permalink
Fix is leader lane logic
Browse files Browse the repository at this point in the history
  • Loading branch information
b-gopalswami committed Jul 9, 2024
1 parent 993eece commit 7ba8113
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions integration-tests/ccip-tests/testsetups/ccip.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,6 @@ func (c *CCIPTestConfig) DefineLeaderLanes() {
}

func (c *CCIPTestConfig) isLeaderLane(lane *actions.CCIPLane) bool {
if len(c.LeaderLanes) == 0 {
return false
}
for _, leader := range c.LeaderLanes {
if leader.source == lane.SourceNetworkName && leader.dest == lane.DestNetworkName {
return true
Expand Down Expand Up @@ -658,7 +655,7 @@ func (o *CCIPTestSetUpOutputs) AddLanesForNetworkPair(
Context: testcontext.Get(t),
}
// if it non leader lane, disable the price reporting
if !o.Cfg.isLeaderLane(ccipLaneA2B) {
if len(o.Cfg.LeaderLanes) > 0 && !o.Cfg.isLeaderLane(ccipLaneA2B) {
ccipLaneA2B.PriceReportingDisabled = true
}
contractsA, ok := o.LaneContractsByNetwork.Load(networkA.Name)
Expand Down Expand Up @@ -703,7 +700,7 @@ func (o *CCIPTestSetUpOutputs) AddLanesForNetworkPair(

ccipLaneB2A = &actions.CCIPLane{
Test: t,
SourceNetworkName: actions.NetworkName(networkB.Name),
SourceNetworkName: actions.NetworkName(networkB.Name),t
DestNetworkName: actions.NetworkName(networkA.Name),
SourceChain: sourceChainClientB2A,
DestChain: destChainClientB2A,
Expand All @@ -716,7 +713,7 @@ func (o *CCIPTestSetUpOutputs) AddLanesForNetworkPair(
DstNetworkLaneCfg: ccipLaneA2B.SrcNetworkLaneCfg,
}
// if it non leader lane, disable the price reporting
if !o.Cfg.isLeaderLane(ccipLaneB2A) {
if len(o.Cfg.LeaderLanes) > 0 && !o.Cfg.isLeaderLane(ccipLaneB2A) {
ccipLaneB2A.PriceReportingDisabled = true
}
b2aLogger := lggr.With().Str("env", namespace).Str("Lane",
Expand Down

0 comments on commit 7ba8113

Please sign in to comment.