mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-02 20:36:44 +00:00
upgrade whirlpool-client 1.0.6
This commit is contained in:
parent
cc739a71e9
commit
da30d4223a
5 changed files with 7 additions and 25 deletions
|
@ -124,7 +124,7 @@ dependencies {
|
||||||
exclude group: 'org.slf4j'
|
exclude group: 'org.slf4j'
|
||||||
}
|
}
|
||||||
implementation('com.sparrowwallet.bokmakierie:bokmakierie:1.0')
|
implementation('com.sparrowwallet.bokmakierie:bokmakierie:1.0')
|
||||||
implementation('io.samourai.code.whirlpool:whirlpool-client:1.0.5')
|
implementation('io.samourai.code.whirlpool:whirlpool-client:1.0.6')
|
||||||
implementation('io.samourai.code.wallet:java-http-client:2.0.2')
|
implementation('io.samourai.code.wallet:java-http-client:2.0.2')
|
||||||
implementation('io.reactivex.rxjava2:rxjava:2.2.15')
|
implementation('io.reactivex.rxjava2:rxjava:2.2.15')
|
||||||
implementation('io.reactivex.rxjava2:rxjavafx:2.2.2')
|
implementation('io.reactivex.rxjava2:rxjavafx:2.2.2')
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.sparrowwallet.sparrow.soroban;
|
||||||
import com.samourai.soroban.client.SorobanConfig;
|
import com.samourai.soroban.client.SorobanConfig;
|
||||||
import com.samourai.soroban.client.wallet.SorobanWalletService;
|
import com.samourai.soroban.client.wallet.SorobanWalletService;
|
||||||
import com.samourai.wallet.hd.HD_Wallet;
|
import com.samourai.wallet.hd.HD_Wallet;
|
||||||
|
import com.samourai.wallet.util.ExtLibJConfig;
|
||||||
import com.sparrowwallet.drongo.Network;
|
import com.sparrowwallet.drongo.Network;
|
||||||
import com.sparrowwallet.drongo.protocol.ScriptType;
|
import com.sparrowwallet.drongo.protocol.ScriptType;
|
||||||
import com.sparrowwallet.drongo.wallet.Wallet;
|
import com.sparrowwallet.drongo.wallet.Wallet;
|
||||||
|
@ -37,7 +38,8 @@ public class Soroban {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setHDWallet(Wallet wallet) {
|
public void setHDWallet(Wallet wallet) {
|
||||||
NetworkParameters params = sorobanWalletService.getSorobanService().getParams();
|
ExtLibJConfig extLibJConfig = sorobanWalletService.getSorobanService().getSorobanConfig().getExtLibJConfig();
|
||||||
|
NetworkParameters params = extLibJConfig.getSamouraiNetwork().getParams();
|
||||||
hdWallet = Whirlpool.computeHdWallet(wallet, params);
|
hdWallet = Whirlpool.computeHdWallet(wallet, params);
|
||||||
bip47Account = wallet.isMasterWallet() ? wallet.getAccountIndex() : wallet.getMasterWallet().getAccountIndex();
|
bip47Account = wallet.isMasterWallet() ? wallet.getAccountIndex() : wallet.getMasterWallet().getAccountIndex();
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,18 +112,6 @@ public class Whirlpool {
|
||||||
return whirlpoolWalletConfig;
|
return whirlpoolWalletConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setOnion(boolean onion) {
|
|
||||||
if(config.isTorOnionCoordinator() ^ onion) {
|
|
||||||
try {
|
|
||||||
Field torField = WhirlpoolClientConfig.class.getDeclaredField("torOnionCoordinator");
|
|
||||||
torField.setAccessible(true);
|
|
||||||
torField.set(config, onion);
|
|
||||||
} catch(Exception e) {
|
|
||||||
log.warn("Error changing onion on WhirlpoolWalletConfig", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private DataSourceConfig computeDataSourceConfig(Integer storedBlockHeight) {
|
private DataSourceConfig computeDataSourceConfig(Integer storedBlockHeight) {
|
||||||
return new DataSourceConfig(SparrowMinerFeeSupplier.getInstance(), new SparrowChainSupplier(storedBlockHeight), BIP_FORMAT.PROVIDER, BIP_WALLETS.WHIRLPOOL);
|
return new DataSourceConfig(SparrowMinerFeeSupplier.getInstance(), new SparrowChainSupplier(storedBlockHeight), BIP_FORMAT.PROVIDER, BIP_WALLETS.WHIRLPOOL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,8 +110,6 @@ public class WhirlpoolServices {
|
||||||
|
|
||||||
public void startWhirlpool(Wallet wallet, Whirlpool whirlpool, boolean notifyIfMixToMissing) {
|
public void startWhirlpool(Wallet wallet, Whirlpool whirlpool, boolean notifyIfMixToMissing) {
|
||||||
if(wallet.getMasterMixConfig().getMixOnStartup() != Boolean.FALSE) {
|
if(wallet.getMasterMixConfig().getMixOnStartup() != Boolean.FALSE) {
|
||||||
whirlpool.setOnion(sorobanConfig.getExtLibJConfig().isOnion());
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String mixToWalletId = getWhirlpoolMixToWalletId(wallet.getMasterMixConfig());
|
String mixToWalletId = getWhirlpoolMixToWalletId(wallet.getMasterMixConfig());
|
||||||
whirlpool.setMixToWallet(mixToWalletId, wallet.getMasterMixConfig().getMinMixes());
|
whirlpool.setMixToWallet(mixToWalletId, wallet.getMasterMixConfig().getMinMixes());
|
||||||
|
@ -230,14 +228,6 @@ public class WhirlpoolServices {
|
||||||
extLibJConfig.setOnion(getTorProxy() != null);
|
extLibJConfig.setOnion(getTorProxy() != null);
|
||||||
getHttpClientService(); //Ensure proxy is updated
|
getHttpClientService(); //Ensure proxy is updated
|
||||||
|
|
||||||
try {
|
|
||||||
Field onionField = RpcClientService.class.getDeclaredField("onion");
|
|
||||||
onionField.setAccessible(true);
|
|
||||||
onionField.set(sorobanConfig.getRpcClientService(), getTorProxy() != null);
|
|
||||||
} catch(Exception e) {
|
|
||||||
log.warn("Error changing onion on RpcClientService", e);
|
|
||||||
}
|
|
||||||
|
|
||||||
startAllWhirlpool();
|
startAllWhirlpool();
|
||||||
bindDebugAccelerator();
|
bindDebugAccelerator();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import com.samourai.wallet.api.backend.seenBackend.SeenBackendWithFallback;
|
||||||
import com.samourai.wallet.hd.HD_Wallet;
|
import com.samourai.wallet.hd.HD_Wallet;
|
||||||
import com.samourai.wallet.httpClient.HttpUsage;
|
import com.samourai.wallet.httpClient.HttpUsage;
|
||||||
import com.samourai.wallet.httpClient.IHttpClient;
|
import com.samourai.wallet.httpClient.IHttpClient;
|
||||||
|
import com.samourai.wallet.util.ExtLibJConfig;
|
||||||
import com.samourai.whirlpool.client.wallet.WhirlpoolWallet;
|
import com.samourai.whirlpool.client.wallet.WhirlpoolWallet;
|
||||||
import com.samourai.whirlpool.client.wallet.WhirlpoolWalletConfig;
|
import com.samourai.whirlpool.client.wallet.WhirlpoolWalletConfig;
|
||||||
import com.samourai.whirlpool.client.wallet.data.coordinator.CoordinatorSupplier;
|
import com.samourai.whirlpool.client.wallet.data.coordinator.CoordinatorSupplier;
|
||||||
|
@ -57,7 +58,8 @@ public class SparrowDataSource extends AbstractDataSource {
|
||||||
}
|
}
|
||||||
|
|
||||||
private ISeenBackend computeSeenBackend(WhirlpoolWalletConfig whirlpoolWalletConfig) {
|
private ISeenBackend computeSeenBackend(WhirlpoolWalletConfig whirlpoolWalletConfig) {
|
||||||
IHttpClient httpClient = whirlpoolWalletConfig.getHttpClient(HttpUsage.BACKEND);
|
ExtLibJConfig extLibJConfig = whirlpoolWalletConfig.getSorobanConfig().getExtLibJConfig();
|
||||||
|
IHttpClient httpClient = extLibJConfig.getHttpClientService().getHttpClient(HttpUsage.BACKEND);
|
||||||
ISeenBackend sparrowSeenBackend = new SparrowSeenBackend(getWhirlpoolWallet().getWalletIdentifier(), httpClient);
|
ISeenBackend sparrowSeenBackend = new SparrowSeenBackend(getWhirlpoolWallet().getWalletIdentifier(), httpClient);
|
||||||
NetworkParameters params = whirlpoolWalletConfig.getSamouraiNetwork().getParams();
|
NetworkParameters params = whirlpoolWalletConfig.getSamouraiNetwork().getParams();
|
||||||
return SeenBackendWithFallback.withOxt(sparrowSeenBackend, params);
|
return SeenBackendWithFallback.withOxt(sparrowSeenBackend, params);
|
||||||
|
|
Loading…
Reference in a new issue