From bf975c54d41ca5c02742c2d20f2f9723734aeb18 Mon Sep 17 00:00:00 2001 From: Angel Soto Date: Fri, 17 May 2024 13:18:40 +0200 Subject: [PATCH] fixing sonar issue --- .../StableMinGasPriceProviderFactory.java | 15 --------------- .../onchain/OnChainMinGasPriceProvider.java | 8 +++++++- 2 files changed, 7 insertions(+), 16 deletions(-) delete mode 100644 rskj-core/src/main/java/co/rsk/mine/gas/provider/StableMinGasPriceProviderFactory.java diff --git a/rskj-core/src/main/java/co/rsk/mine/gas/provider/StableMinGasPriceProviderFactory.java b/rskj-core/src/main/java/co/rsk/mine/gas/provider/StableMinGasPriceProviderFactory.java deleted file mode 100644 index 24ead01e416..00000000000 --- a/rskj-core/src/main/java/co/rsk/mine/gas/provider/StableMinGasPriceProviderFactory.java +++ /dev/null @@ -1,15 +0,0 @@ -package co.rsk.mine.gas.provider; - -import co.rsk.config.mining.StableMinGasPriceSystemConfig; - -public abstract class StableMinGasPriceProviderFactory { - private final StableMinGasPriceSystemConfig config; - private final MinGasPriceProvider fallbackProvider; - - public StableMinGasPriceProviderFactory(StableMinGasPriceSystemConfig config, MinGasPriceProvider fallbackProvider) { - this.config = config; - this.fallbackProvider = fallbackProvider; - } - - protected abstract StableMinGasPriceProvider create(); -} diff --git a/rskj-core/src/main/java/co/rsk/mine/gas/provider/onchain/OnChainMinGasPriceProvider.java b/rskj-core/src/main/java/co/rsk/mine/gas/provider/onchain/OnChainMinGasPriceProvider.java index ba35804c848..cc278ef105b 100644 --- a/rskj-core/src/main/java/co/rsk/mine/gas/provider/onchain/OnChainMinGasPriceProvider.java +++ b/rskj-core/src/main/java/co/rsk/mine/gas/provider/onchain/OnChainMinGasPriceProvider.java @@ -6,9 +6,11 @@ import co.rsk.mine.gas.provider.StableMinGasPriceProvider; public class OnChainMinGasPriceProvider extends StableMinGasPriceProvider { + private final String address; - OnChainMinGasPriceProvider(MinGasPriceProvider fallBackProvider, OnChainMinGasPriceSystemConfig config) { + protected OnChainMinGasPriceProvider(MinGasPriceProvider fallBackProvider, OnChainMinGasPriceSystemConfig config) { super(fallBackProvider); + this.address = config.getAddress(); } @Override @@ -20,4 +22,8 @@ public MinGasPriceProviderType getType() { public Long getStableMinGasPrice() { return null; } + + public String getAddress() { + return address; + } }