upgrade to whirlpool-client 0.23.33

This commit is contained in:
zeroleak 2021-09-18 11:41:52 +02:00
parent dbebade3ab
commit 6939d8a06a
3 changed files with 5 additions and 18 deletions

View file

@ -158,9 +158,8 @@ public class SparrowDataSource extends WalletResponseDataSource {
walletResponse.info.latest_block.time = AppServices.getLatestBlockHeader() == null ? 1 : AppServices.getLatestBlockHeader().getTime(); walletResponse.info.latest_block.time = AppServices.getLatestBlockHeader() == null ? 1 : AppServices.getLatestBlockHeader().getTime();
walletResponse.info.fees = new LinkedHashMap<>(); walletResponse.info.fees = new LinkedHashMap<>();
MinerFee minerFee = getMinerFeeSupplier().getValue();
for(MinerFeeTarget target : MinerFeeTarget.values()) { for(MinerFeeTarget target : MinerFeeTarget.values()) {
walletResponse.info.fees.put(target.getValue(), minerFee.get(target)); walletResponse.info.fees.put(target.getValue(), getMinerFeeSupplier().getFee(target));
} }
return walletResponse; return walletResponse;

View file

@ -1,11 +1,13 @@
package com.sparrowwallet.sparrow.whirlpool.dataSource; package com.sparrowwallet.sparrow.whirlpool.dataSource;
import com.samourai.wallet.api.backend.MinerFee;
import com.samourai.wallet.api.backend.MinerFeeTarget; import com.samourai.wallet.api.backend.MinerFeeTarget;
import com.samourai.whirlpool.client.wallet.data.minerFee.MinerFeeSupplier; import com.samourai.whirlpool.client.wallet.data.minerFee.MinerFeeSupplier;
import com.sparrowwallet.sparrow.AppServices; import com.sparrowwallet.sparrow.AppServices;
import java.util.*; import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
public class SparrowMinerFeeSupplier implements MinerFeeSupplier { public class SparrowMinerFeeSupplier implements MinerFeeSupplier {
private static final int FALLBACK_FEE_RATE = 75; private static final int FALLBACK_FEE_RATE = 75;
@ -30,15 +32,6 @@ public class SparrowMinerFeeSupplier implements MinerFeeSupplier {
return getMinimumFeeForTarget(Integer.parseInt(feeTarget.getValue())); return getMinimumFeeForTarget(Integer.parseInt(feeTarget.getValue()));
} }
@Override
public MinerFee getValue() {
Map<String, Integer> fees = new LinkedHashMap<>();
for (MinerFeeTarget minerFeeTarget : MinerFeeTarget.values()) {
fees.put(minerFeeTarget.getValue(), getFee(minerFeeTarget));
}
return new MinerFee(fees);
}
private Integer getMinimumFeeForTarget(int targetBlocks) { private Integer getMinimumFeeForTarget(int targetBlocks) {
List<Map.Entry<Integer, Double>> feeRates = new ArrayList<>(AppServices.getTargetBlockFeeRates().entrySet()); List<Map.Entry<Integer, Double>> feeRates = new ArrayList<>(AppServices.getTargetBlockFeeRates().entrySet());
Collections.reverse(feeRates); Collections.reverse(feeRates);

View file

@ -89,11 +89,6 @@ public class SparrowWalletStateSupplier implements WalletStateSupplier {
// nothing required // nothing required
} }
@Override
public void setWalletIndex(WhirlpoolAccount whirlpoolAccount, AddressType addressType, Chain chain, int i) throws Exception {
// nothing required
}
@Override @Override
public void load() throws Exception { public void load() throws Exception {
// nothing required // nothing required