From ca4c48ea10d000e536e575410a765c4f35312c3e Mon Sep 17 00:00:00 2001 From: Andy Pliszka Date: Tue, 14 May 2024 15:58:54 -0400 Subject: [PATCH] fix: uses lo.ToPtr in tests --- internal/fullnode/commands/addrbook_test.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/internal/fullnode/commands/addrbook_test.go b/internal/fullnode/commands/addrbook_test.go index 8515a516..c39c769f 100644 --- a/internal/fullnode/commands/addrbook_test.go +++ b/internal/fullnode/commands/addrbook_test.go @@ -3,6 +3,7 @@ package commands import ( "testing" + "github.com/samber/lo" cosmosv1 "github.com/strangelove-ventures/cosmos-operator/api/v1" "github.com/stretchr/testify/require" ) @@ -32,9 +33,8 @@ func TestDownloadAddrbookCommand(t *testing.T) { }) t.Run("download", func(t *testing.T) { - addressBookUrl := "https://example.com/addrbook.json" cfg := cosmosv1.ChainSpec{ - AddrbookURL: &addressBookUrl, + AddrbookURL: lo.ToPtr("https://example.com/addrbook.json"), } cmd, args := DownloadAddrbookCommand(cfg) require.Equal(t, "sh", cmd) @@ -52,12 +52,10 @@ func TestDownloadAddrbookCommand(t *testing.T) { }) t.Run("custom", func(t *testing.T) { - addressBookUrl := "https://example.com/addrbook.json" - addressBookScript := "echo hi" cfg := cosmosv1.ChainSpec{ // Keeping this to assert that custom script takes precedence. - AddrbookURL: &addressBookUrl, - AddrbookScript: &addressBookScript, + AddrbookURL: lo.ToPtr("https://example.com/addrbook.json"), + AddrbookScript: lo.ToPtr("echo hi"), } cmd, args := DownloadAddrbookCommand(cfg) require.Equal(t, "sh", cmd)