Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyaoy committed Nov 26, 2024
1 parent 0eb35c8 commit 3726ba7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func TestGetMutableExchangeConfig(t *testing.T) {

mutableExchangeConfig := pf.mutableState.GetMutableExchangeConfig()

require.NotSame(t, &mutableExchangeConfig, &pf.mutableState.mutableExchangeConfig)
require.NotSame(t, mutableExchangeConfig, pf.mutableState.mutableExchangeConfig)
require.Equal(t, pf.mutableState.mutableExchangeConfig, mutableExchangeConfig)
}

Expand All @@ -110,7 +110,7 @@ func TestGetTaskLoopDefinition(t *testing.T) {
taskLoopDefinition := pf.getTaskLoopDefinition()

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

require.Equal(t, pf.mutableState.mutableExchangeConfig, taskLoopDefinition.mutableExchangeConfig)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func TestGetTaskLoopDefinition_SingleMarketExchange(t *testing.T) {
taskLoopDefinition := pf.getTaskLoopDefinition()

// Expect that the definition uses a copy of the mutableExchangeConfig for synchronization purposes.
require.NotSame(t, &pf.mutableState.mutableExchangeConfig, &taskLoopDefinition.mutableExchangeConfig)
require.NotSame(t, pf.mutableState.mutableExchangeConfig, taskLoopDefinition.mutableExchangeConfig)
require.Equal(t, expectedExchangeConfig, taskLoopDefinition.mutableExchangeConfig)
require.Equal(t, expectedMarketExponents, taskLoopDefinition.marketExponents)
require.Equal(t, []types.MarketId{constants.MarketId7, constants.MarketId8}, taskLoopDefinition.marketIds)
Expand All @@ -221,7 +221,7 @@ func TestGetTaskLoopDefinition_SingleMarketExchange(t *testing.T) {

// Sanity checks:

require.NotSame(t, &pf.mutableState.mutableExchangeConfig, &taskLoopDefinition.mutableExchangeConfig)
require.NotSame(t, pf.mutableState.mutableExchangeConfig, taskLoopDefinition.mutableExchangeConfig)
require.Equal(t, expectedExchangeConfig, taskLoopDefinition.mutableExchangeConfig)
require.Equal(t, expectedMarketExponents, taskLoopDefinition.marketExponents)

Expand Down Expand Up @@ -249,7 +249,7 @@ func TestGetTaskLoopDefinition_MultiMarketExchange(t *testing.T) {
expectedExchangeConfig := &constants.Exchange1_3Markets_MutableExchangeMarketConfig

// Expect that the definition uses a copy of the mutableExchangeConfig for synchronization purposes.
require.NotSame(t, &expectedExchangeConfig, &taskLoopDefinition.mutableExchangeConfig)
require.NotSame(t, expectedExchangeConfig, taskLoopDefinition.mutableExchangeConfig)
require.Equal(t, expectedExchangeConfig, taskLoopDefinition.mutableExchangeConfig)
require.Equal(t, expectedExponents, taskLoopDefinition.marketExponents)
require.Equal(t, expectedMarkets, taskLoopDefinition.marketIds)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestMutableExchangeMarketConfig_Copy(t *testing.T) {
},
}
mmecCopy := mutableMarketExchangeConfig.Copy()
require.NotSame(t, &mutableMarketExchangeConfig, &mmecCopy)
require.NotSame(t, mutableMarketExchangeConfig, mmecCopy)
require.True(t, mutableMarketExchangeConfig.Equal(mmecCopy))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestCopy(t *testing.T) {

mmcCopy := mmc.Copy()

require.NotSame(t, &mmc, &mmcCopy)
require.NotSame(t, mmc, mmcCopy)
require.Equal(t, mmc, mmcCopy)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func TestGetExchangeMarketConfigCopy_Mixed(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

0 comments on commit 3726ba7

Please sign in to comment.