Skip to content

Commit

Permalink
Upgrade connect dependency to allow market authorities to remove mark…
Browse files Browse the repository at this point in the history
…ets (#2615)
  • Loading branch information
chenyaoy authored Nov 26, 2024
1 parent 7454ced commit 5553dc8
Show file tree
Hide file tree
Showing 8 changed files with 215 additions and 211 deletions.
8 changes: 4 additions & 4 deletions protocol/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NB: This is a digest for a multi-arch manifest list, you will want to get this by running
# `docker buildx imagetools inspect golang:1.22.2-alpine`
ARG GOLANG_1_22_ALPINE_DIGEST="cdc86d9f363e8786845bea2040312b4efa321b828acdeb26f393faa864d887b0"
# `docker buildx imagetools inspect golang:1.23.1-alpine`
ARG GOLANG_1_23_ALPINE_DIGEST="ac67716dd016429be8d4c2c53a248d7bcdf06d34127d3dc451bda6aa5a87bc06"

# This Dockerfile is a stateless build of the `dydxprotocold` binary as a Docker container.
# It does not include any configuration, state, or genesis information.
Expand All @@ -9,7 +9,7 @@ ARG GOLANG_1_22_ALPINE_DIGEST="cdc86d9f363e8786845bea2040312b4efa321b828acdeb26f
# Builder
# --------------------------------------------------------

FROM golang@sha256:${GOLANG_1_22_ALPINE_DIGEST} as builder
FROM golang@sha256:${GOLANG_1_23_ALPINE_DIGEST} as builder
ARG VERSION
ARG COMMIT

Expand Down Expand Up @@ -46,7 +46,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
# Runner
# --------------------------------------------------------

FROM golang@sha256:${GOLANG_1_22_ALPINE_DIGEST}
FROM golang@sha256:${GOLANG_1_23_ALPINE_DIGEST}

RUN apk add --no-cache bash

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package price_fetcher

import (
"testing"

"cosmossdk.io/log"
"github.com/dydxprotocol/v4-chain/protocol/daemons/pricefeed/client/types"
"github.com/dydxprotocol/v4-chain/protocol/mocks"
"github.com/dydxprotocol/v4-chain/protocol/testutil/constants"
"github.com/stretchr/testify/require"
"testing"
)

func TestGetNextNMarkets(t *testing.T) {
Expand Down Expand Up @@ -70,7 +71,7 @@ func TestGetMarketExponents(t *testing.T) {
marketExponents := pf.mutableState.GetMarketExponents()
// Check that the mutableState contains the correct set of marketExponents
// and that it returns a copy of the map and not the original.
require.NotSame(t, marketExponents, pf.mutableState.marketExponents)
require.NotSame(t, &marketExponents, &pf.mutableState.marketExponents)
require.Equal(t, pf.mutableState.marketExponents, marketExponents)
}

Expand Down Expand Up @@ -110,7 +111,7 @@ func TestGetTaskLoopDefinition(t *testing.T) {

// The taskLoopDefinition should use copies of shared state
require.NotSame(t, pf.mutableState.mutableExchangeConfig, taskLoopDefinition.mutableExchangeConfig)
require.NotSame(t, pf.mutableState.marketExponents, taskLoopDefinition.marketExponents)
require.NotSame(t, &pf.mutableState.marketExponents, &taskLoopDefinition.marketExponents)

require.Equal(t, pf.mutableState.mutableExchangeConfig, taskLoopDefinition.mutableExchangeConfig)
require.Equal(t, pf.mutableState.marketExponents, taskLoopDefinition.marketExponents)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package price_fetcher

import (
"errors"
daemontypes "github.com/dydxprotocol/v4-chain/protocol/daemons/types"
"testing"

daemontypes "github.com/dydxprotocol/v4-chain/protocol/daemons/types"

"cosmossdk.io/math"
pricefeed_cosntants "github.com/dydxprotocol/v4-chain/protocol/daemons/pricefeed/client/constants"
"github.com/dydxprotocol/v4-chain/protocol/testutil/daemons/pricefeed"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package types_test

import (
"fmt"
"testing"

"github.com/dydxprotocol/v4-chain/protocol/daemons/pricefeed/client/types"
"github.com/dydxprotocol/v4-chain/protocol/testutil/daemons/pricefeed/exchange_config"
"github.com/stretchr/testify/require"
"testing"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package types_test

import (
"errors"
"testing"

"github.com/dydxprotocol/v4-chain/protocol/daemons/pricefeed/client/types"
"github.com/dydxprotocol/v4-chain/protocol/testutil/constants"
"github.com/stretchr/testify/require"
"testing"
)

func TestCopy(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func TestGetMarketConfigCopies(t *testing.T) {
require.Error(t, err, tc.ExpectedError.Error())
} else {
// Validate that this method returns a copy and not the original.
require.NotSame(t, tc.Expected, actual)
require.NotSame(t, &tc.Expected, &actual)
require.Equal(t, tc.Expected, actual)
require.NoError(t, err)
}
Expand Down
Loading

0 comments on commit 5553dc8

Please sign in to comment.