From 3726ba7a8344650778679d222a575ddf8df9260f Mon Sep 17 00:00:00 2001 From: Chenyao Yu <4844716+chenyaoy@users.noreply.github.com> Date: Tue, 26 Nov 2024 12:33:27 -0500 Subject: [PATCH] fix --- .../pricefeed/client/price_fetcher/mutable_state_test.go | 4 ++-- .../pricefeed/client/price_fetcher/price_fetcher_test.go | 6 +++--- .../client/types/mutable_exchange_market_config_test.go | 2 +- .../pricefeed/client/types/mutable_market_config_test.go | 2 +- .../client/types/price_feed_mutable_market_configs_test.go | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/protocol/daemons/pricefeed/client/price_fetcher/mutable_state_test.go b/protocol/daemons/pricefeed/client/price_fetcher/mutable_state_test.go index aafcd6139d..6980f88297 100644 --- a/protocol/daemons/pricefeed/client/price_fetcher/mutable_state_test.go +++ b/protocol/daemons/pricefeed/client/price_fetcher/mutable_state_test.go @@ -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) } @@ -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) diff --git a/protocol/daemons/pricefeed/client/price_fetcher/price_fetcher_test.go b/protocol/daemons/pricefeed/client/price_fetcher/price_fetcher_test.go index 4ddd47053a..107ac4218d 100644 --- a/protocol/daemons/pricefeed/client/price_fetcher/price_fetcher_test.go +++ b/protocol/daemons/pricefeed/client/price_fetcher/price_fetcher_test.go @@ -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) @@ -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) @@ -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) diff --git a/protocol/daemons/pricefeed/client/types/mutable_exchange_market_config_test.go b/protocol/daemons/pricefeed/client/types/mutable_exchange_market_config_test.go index a9cfc2e5b3..ddceac50ed 100644 --- a/protocol/daemons/pricefeed/client/types/mutable_exchange_market_config_test.go +++ b/protocol/daemons/pricefeed/client/types/mutable_exchange_market_config_test.go @@ -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)) } diff --git a/protocol/daemons/pricefeed/client/types/mutable_market_config_test.go b/protocol/daemons/pricefeed/client/types/mutable_market_config_test.go index ca86d902bd..0d4047f759 100644 --- a/protocol/daemons/pricefeed/client/types/mutable_market_config_test.go +++ b/protocol/daemons/pricefeed/client/types/mutable_market_config_test.go @@ -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) } diff --git a/protocol/daemons/pricefeed/client/types/price_feed_mutable_market_configs_test.go b/protocol/daemons/pricefeed/client/types/price_feed_mutable_market_configs_test.go index 654da7c34e..47cba5f48a 100644 --- a/protocol/daemons/pricefeed/client/types/price_feed_mutable_market_configs_test.go +++ b/protocol/daemons/pricefeed/client/types/price_feed_mutable_market_configs_test.go @@ -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) }