diff --git a/internal/fullnode/commands/genesis_test.go b/internal/fullnode/commands/genesis_test.go index 04828ef3..4d0fa887 100644 --- a/internal/fullnode/commands/genesis_test.go +++ b/internal/fullnode/commands/genesis_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" ) @@ -34,7 +35,7 @@ func TestDownloadGenesisCommand(t *testing.T) { t.Run("download", func(t *testing.T) { cfg := cosmosv1.ChainSpec{ - GenesisURL: ptr("https://example.com/genesis.json"), + GenesisURL: lo.ToPtr("https://example.com/genesis.json"), } cmd, args := DownloadGenesisCommand(cfg) require.Equal(t, "sh", cmd) @@ -54,8 +55,8 @@ func TestDownloadGenesisCommand(t *testing.T) { t.Run("custom", func(t *testing.T) { cfg := cosmosv1.ChainSpec{ // Keeping this to assert that custom script takes precedence. - GenesisURL: ptr("https://example.com/genesis.json"), - GenesisScript: ptr("echo hi"), + GenesisURL: lo.ToPtr("https://example.com/genesis.json"), + GenesisScript: lo.ToPtr("echo hi"), } cmd, args := DownloadGenesisCommand(cfg) require.Equal(t, "sh", cmd) diff --git a/internal/fullnode/commands/snapshot_test.go b/internal/fullnode/commands/snapshot_test.go index 6c484098..132a24be 100644 --- a/internal/fullnode/commands/snapshot_test.go +++ b/internal/fullnode/commands/snapshot_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" ) @@ -19,7 +20,7 @@ fi` ) t.Run("snapshot url", func(t *testing.T) { var cfg cosmosv1.ChainSpec - cfg.SnapshotURL = ptr(testURL) + cfg.SnapshotURL = lo.ToPtr(testURL) cmd, args := DownloadSnapshotCommand(cfg) require.Equal(t, "sh", cmd) @@ -38,8 +39,8 @@ fi` t.Run("snapshot script", func(t *testing.T) { var cfg cosmosv1.ChainSpec - cfg.SnapshotURL = ptr(testURL) // Asserts SnapshotScript takes precedence. - cfg.SnapshotScript = ptr("echo hello") + cfg.SnapshotURL = lo.ToPtr(testURL) // Asserts SnapshotScript takes precedence. + cfg.SnapshotScript = lo.ToPtr("echo hello") _, args := DownloadSnapshotCommand(cfg) require.Len(t, args, 2)