Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanTinianov committed Aug 12, 2024
1 parent dfadfc4 commit a92eb44
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions core/chains/evm/client/rpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,9 @@ func (r *RpcClient) Close() {
}()
r.cancelInflightRequests()
r.UnsubscribeAllExcept()
r.stateMu.Lock()
r.latestChainInfo = commonclient.ChainInfo{}
r.stateMu.Unlock()
}

// cancelInflightRequests closes and replaces the chStopInFlight
Expand Down
5 changes: 2 additions & 3 deletions core/chains/evm/headtracker/head_listener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,8 @@ func Test_HeadListener_SubscriptionErr(t *testing.T) {
sub2.On("Err").Return(chSubErr2)
subscribeAwaiter2 := testutils.NewAwaiter()

var headsCh2 chan<- *evmtypes.Head
ethClient.On("SubscribeNewHead", mock.Anything, mock.AnythingOfType("chan<- *types.Head")).Return(sub2, nil).Once().Run(func(args mock.Arguments) {
headsCh2 = args.Get(1).(chan<- *evmtypes.Head)
headsCh2 := make(chan *evmtypes.Head)
ethClient.On("SubscribeNewHead", mock.Anything).Return((<-chan *evmtypes.Head)(headsCh2), sub2, nil).Once().Run(func(args mock.Arguments) {
subscribeAwaiter2.ItHappened()
})

Expand Down

0 comments on commit a92eb44

Please sign in to comment.