wormhole-explorer/fly/notifier/vaa_last_sequence_test.go

38 lines
811 B
Go
Raw Normal View History

package notifier
import (
"os"
"testing"
"github.com/test-go/testify/assert"
"github.com/wormhole-foundation/wormhole-explorer/fly/config"
)
func TestNewLastSequenceNotifier(t *testing.T) {
l := NewLastSequenceNotifier(nil, "mainnet-staging")
2023-07-03 11:58:34 -07:00
assert.Equal(t, "mainnet-staging:wormscan:vaa-max-sequence", l.prefix)
}
func TestNewLastSequenceNotifierBackwardsCompat(t *testing.T) {
prefix := config.GetPrefix()
l := NewLastSequenceNotifier(nil, prefix)
assert.Equal(t, "wormscan:vaa-max-sequence", l.prefix)
}
func TestNewLastSequenceNotifierWithPrefix(t *testing.T) {
os.Setenv("P2P_NETWORK", "mainnet")
2023-06-29 11:07:07 -07:00
os.Setenv("ENVIRONMENT", "staging")
prefix := config.GetPrefix()
l := NewLastSequenceNotifier(nil, prefix)
2023-07-03 11:58:34 -07:00
assert.Equal(t, "mainnet-staging:wormscan:vaa-max-sequence", l.prefix)
}