From 6a652558ab690bc853d09ab15af26be10a6ed096 Mon Sep 17 00:00:00 2001 From: Chris Schinnerl Date: Fri, 16 Aug 2024 18:14:59 +0200 Subject: [PATCH] bus: don't pin maxrpcprice --- api/setting.go | 1 - internal/bus/pinmanager.go | 12 ------------ internal/bus/pinmanager_test.go | 3 --- 3 files changed, 16 deletions(-) diff --git a/api/setting.go b/api/setting.go index 175794432..01ad05b0f 100644 --- a/api/setting.go +++ b/api/setting.go @@ -167,7 +167,6 @@ type ( // pinned. GougingSettingsPins struct { MaxDownload Pin `json:"maxDownload"` - MaxRPCPrice Pin `json:"maxRPCPrice"` MaxStorage Pin `json:"maxStorage"` MaxUpload Pin `json:"maxUpload"` } diff --git a/internal/bus/pinmanager.go b/internal/bus/pinmanager.go index f9833c887..c128a8392 100644 --- a/internal/bus/pinmanager.go +++ b/internal/bus/pinmanager.go @@ -263,18 +263,6 @@ func (pm *pinManager) updateGougingSettings(ctx context.Context, pins api.Gougin } } - // update max RPC price - if pins.MaxRPCPrice.IsPinned() { - update, err := convertCurrencyToSC(decimal.NewFromFloat(pins.MaxRPCPrice.Value), rate) - if err != nil { - pm.logger.Warnw("failed to convert max RPC price to currency", zap.Error(err)) - } else if !gs.MaxRPCPrice.Equals(update) { - pm.logger.Infow("updating max RPC price", "old", gs.MaxRPCPrice, "new", update, "rate", rate) - gs.MaxRPCPrice = update - updated = true - } - } - // update max storage price if pins.MaxStorage.IsPinned() { maxStorageCurr, err := convertCurrencyToSC(decimal.NewFromFloat(pins.MaxStorage.Value), rate) diff --git a/internal/bus/pinmanager_test.go b/internal/bus/pinmanager_test.go index 91f59eb6d..e5158836d 100644 --- a/internal/bus/pinmanager_test.go +++ b/internal/bus/pinmanager_test.go @@ -234,7 +234,6 @@ func TestPinManager(t *testing.T) { // configure all pins but disable them for now pps.GougingSettingsPins.MaxDownload = api.Pin{Value: 3, Pinned: false} - pps.GougingSettingsPins.MaxRPCPrice = api.Pin{Value: 3, Pinned: false} pps.GougingSettingsPins.MaxStorage = api.Pin{Value: 3, Pinned: false} pps.GougingSettingsPins.MaxUpload = api.Pin{Value: 3, Pinned: false} ms.updatPinnedSettings(pps) @@ -260,14 +259,12 @@ func TestPinManager(t *testing.T) { // enable the rest of the pins pps.GougingSettingsPins.MaxDownload.Pinned = true - pps.GougingSettingsPins.MaxRPCPrice.Pinned = true pps.GougingSettingsPins.MaxStorage.Pinned = true pps.GougingSettingsPins.MaxUpload.Pinned = true ms.updatPinnedSettings(pps) // assert they're all updated if gss := ms.gougingSettings(); gss.MaxDownloadPrice.Equals(gs.MaxDownloadPrice) || - gss.MaxRPCPrice.Equals(gs.MaxRPCPrice) || gss.MaxStoragePrice.Equals(gs.MaxStoragePrice) || gss.MaxUploadPrice.Equals(gs.MaxUploadPrice) { t.Fatalf("expected gouging settings to be updated, got %v = %v", gss, gs)