Skip to content

Commit

Permalink
node/test: fix incorrect control flow in governed assets test
Browse files Browse the repository at this point in the history
The control flow for this function should be `continue` rather than
`return`, otherwise the entire test will exit early when evaluating an
ignored chain rather than skip the current iteration as intended.

In practice, this test just so happened to work OK because:
- the only ignored chain is Wormchain with ID 3104
- 3104 is the last entry in the slice
- iteration over slices is deterministic
And so the test always returned early when hitting Wormchain, but
Wormchain is the last item in the list.
  • Loading branch information
johnsaigle authored and evan-gray committed Aug 16, 2024
1 parent 8b9f9b5 commit 31a9a3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion node/pkg/governor/mainnet_tokens_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestGovernedChainHasGovernedAssets(t *testing.T) {
for _, chainConfigEntry := range chainList() {
e := chainConfigEntry.emitterChainID
if _, ignored := ignoredChains[e]; ignored {
return
continue
}
t.Run(e.String(), func(t *testing.T) {
found := false
Expand Down

0 comments on commit 31a9a3e

Please sign in to comment.