From aad8ccf36fd7a83013bac2323f439d5fc1604faf Mon Sep 17 00:00:00 2001 From: Bruce Riley Date: Thu, 15 Aug 2024 14:00:38 -0500 Subject: [PATCH] Fix governor test for Snax --- node/pkg/governor/mainnet_tokens_test.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/node/pkg/governor/mainnet_tokens_test.go b/node/pkg/governor/mainnet_tokens_test.go index b4a1d351f6..5ff00511a6 100644 --- a/node/pkg/governor/mainnet_tokens_test.go +++ b/node/pkg/governor/mainnet_tokens_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/wormhole-foundation/wormhole/sdk/vaa" ) @@ -38,9 +39,11 @@ func TestTokenListAddressSize(t *testing.T) { // populated.) While this is not a hard requirement, it may represent that a developer has forgotten to take the step // of configuring tokens when deploying the chain. This test helps to remind them. func TestGovernedChainHasGovernedAssets(t *testing.T) { - // Add a chain ID to this set if it genuinely has no native assets that should be governed. ignoredChains := map[vaa.ChainID]bool{ + // TODO: Remove this once we have governed tokens for Snax. + vaa.ChainIDSnaxchain: true, + // Wormchain is an abstraction over IBC-connected chains so no assets are "native" to it vaa.ChainIDWormchain: true, } @@ -71,6 +74,13 @@ func TestGovernedChainHasGovernedAssets(t *testing.T) { assert.True(t, found, "Chain is governed but has no governed native assets configured") }) } + + // Make sure we're not ignoring any chains with governed tokens. + for _, tokenEntry := range tokenList() { + if _, exists := ignoredChains[vaa.ChainID(tokenEntry.chain)]; exists { + require.Equal(t, "", fmt.Sprintf("Chain %s is in ignoredChains but it has governed tokens", vaa.ChainID(tokenEntry.chain))) + } + } } func TestTokenListTokenAddressDuplicates(t *testing.T) {