mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-02 20:36:44 +00:00
upgrade to whirlpool 1.0.0-beta10
This commit is contained in:
parent
249a01c208
commit
da74089969
6 changed files with 32 additions and 30 deletions
|
@ -124,7 +124,7 @@ dependencies {
|
|||
exclude group: 'org.slf4j'
|
||||
}
|
||||
implementation('com.sparrowwallet.bokmakierie:bokmakierie:1.0')
|
||||
implementation('io.samourai.code.whirlpool:whirlpool-client:1.0.0-beta4')
|
||||
implementation('io.samourai.code.whirlpool:whirlpool-client:1.0.0-beta10')
|
||||
implementation('io.samourai.code.wallet:java-http-client:2.0.0-beta3')
|
||||
implementation('io.reactivex.rxjava2:rxjava:2.2.15')
|
||||
implementation('io.reactivex.rxjava2:rxjavafx:2.2.2')
|
||||
|
|
|
@ -330,12 +330,10 @@ public class CounterpartyController extends SorobanController {
|
|||
}
|
||||
}
|
||||
};
|
||||
sorobanWalletCounterparty.counterparty(cahootsContext, initiatorPaymentCode, onProgress)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(JavaFxScheduler.platform())
|
||||
.subscribe(cahoots -> {
|
||||
// cahoots success
|
||||
}, error -> {
|
||||
try {
|
||||
// TODO run in background thread?
|
||||
Cahoots result = sorobanWalletCounterparty.counterparty(cahootsContext, initiatorPaymentCode, onProgress);
|
||||
} catch (Exception error) {
|
||||
log.error("Error creating mix transaction", error);
|
||||
String cutFrom = "Exception: ";
|
||||
int index = error.getMessage().lastIndexOf(cutFrom);
|
||||
|
@ -343,7 +341,7 @@ public class CounterpartyController extends SorobanController {
|
|||
msg = msg.replace("#Cahoots", "mix transaction");
|
||||
step3Desc.setText(msg);
|
||||
sorobanProgressLabel.setVisible(false);
|
||||
});
|
||||
}
|
||||
} catch(Exception e) {
|
||||
log.error("Error creating mix transaction", e);
|
||||
sorobanProgressLabel.setText(e.getMessage());
|
||||
|
|
|
@ -494,17 +494,16 @@ public class InitiatorController extends SorobanController {
|
|||
};
|
||||
SorobanWalletService sorobanWalletService = soroban.getSorobanWalletService();
|
||||
sorobanProgressLabel.setText("Waiting for mix partner...");
|
||||
sorobanWalletService.getSorobanWalletInitiator(cahootsWallet).meetAndInitiate(cahootsContext, paymentCodeCounterparty, listener)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(JavaFxScheduler.platform())
|
||||
.subscribe(sorobanResponse -> {
|
||||
}, error -> {
|
||||
try {
|
||||
// TODO run in background thread?
|
||||
Cahoots result = sorobanWalletService.getSorobanWalletInitiator(cahootsWallet).meetAndInitiate(cahootsContext, paymentCodeCounterparty, listener);
|
||||
} catch (Exception error){
|
||||
log.error("Error receiving meeting response", error);
|
||||
step2Desc.setText(getErrorMessage(error));
|
||||
sorobanProgressLabel.setVisible(false);
|
||||
meetingFail.setVisible(true);
|
||||
requestUserAttention();
|
||||
});
|
||||
}
|
||||
}, error -> {
|
||||
log.error("Could not retrieve payment code", error);
|
||||
if(error.getMessage().endsWith("404")) {
|
||||
|
|
|
@ -52,7 +52,7 @@ public class SparrowDataSource extends AbstractDataSource {
|
|||
super(whirlpoolWallet, bip44w, walletStateSupplier, dataSourceConfig);
|
||||
this.seenBackend = computeSeenBackend(whirlpoolWallet.getConfig());
|
||||
this.pushTx = computePushTx();
|
||||
this.utxoSupplier = new SparrowUtxoSupplier(whirlpoolWallet, walletSupplier, utxoConfigSupplier, dataSourceConfig);
|
||||
this.utxoSupplier = new SparrowUtxoSupplier(walletSupplier, utxoConfigSupplier, dataSourceConfig);
|
||||
}
|
||||
|
||||
private ISeenBackend computeSeenBackend(WhirlpoolWalletConfig whirlpoolWalletConfig) {
|
||||
|
|
|
@ -5,6 +5,8 @@ import com.samourai.wallet.api.backend.seenBackend.SeenResponse;
|
|||
import com.samourai.wallet.httpClient.IHttpClient;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class SparrowSeenBackend implements ISeenBackend {
|
||||
private IHttpClient httpClient;
|
||||
|
@ -15,7 +17,11 @@ public class SparrowSeenBackend implements ISeenBackend {
|
|||
|
||||
@Override
|
||||
public SeenResponse seen(Collection<String> addresses) throws Exception {
|
||||
return null; // TODO implement: check if each address already received funds
|
||||
Map<String,Boolean> map = new LinkedHashMap<>();
|
||||
for (String address : addresses) {
|
||||
map.put(address, seen(address));
|
||||
}
|
||||
return new SeenResponse(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -26,11 +26,10 @@ public class SparrowUtxoSupplier extends BasicUtxoSupplier {
|
|||
private static final Logger log = LoggerFactory.getLogger(SparrowUtxoSupplier.class);
|
||||
|
||||
public SparrowUtxoSupplier(
|
||||
WhirlpoolWallet whirlpoolWallet,
|
||||
WalletSupplier walletSupplier,
|
||||
UtxoConfigSupplier utxoConfigSupplier,
|
||||
DataSourceConfig dataSourceConfig) {
|
||||
super(whirlpoolWallet, walletSupplier, utxoConfigSupplier, dataSourceConfig);
|
||||
super(walletSupplier, utxoConfigSupplier, dataSourceConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue