various changes to support soroban

This commit is contained in:
Craig Raw 2021-11-25 16:13:57 +02:00
parent 3a061cb73a
commit 4a4a62f239
4 changed files with 15 additions and 9 deletions

View file

@ -1,6 +1,7 @@
package com.sparrowwallet.drongo;
import com.sparrowwallet.drongo.rpc.BitcoinJSONRPCClient;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
@ -8,6 +9,7 @@ import org.zeromq.SocketType;
import org.zeromq.ZContext;
import org.zeromq.ZMQ;
import java.security.Provider;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
@ -80,4 +82,8 @@ public class Drongo {
ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger)LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
root.setLevel(ch.qos.logback.classic.Level.toLevel(level.toString()));
}
public static Provider getProvider() {
return new BouncyCastleProvider();
}
}

View file

@ -257,14 +257,6 @@ public class PSBT {
if(transaction == null) {
throw new PSBTParseException("Missing transaction");
}
if(currentState == STATE_INPUTS) {
throw new PSBTParseException("Missing inputs");
}
if(currentState == STATE_OUTPUTS) {
throw new PSBTParseException("Missing outputs");
}
}
if(log.isDebugEnabled()) {

View file

@ -62,6 +62,6 @@ public class Payment {
}
public enum Type {
DEFAULT, WHIRLPOOL_FEE, FAKE_MIX;
DEFAULT, WHIRLPOOL_FEE, FAKE_MIX, MIX;
}
}

View file

@ -164,6 +164,14 @@ public class Wallet extends Persistable implements Comparable<Wallet> {
return null;
}
public List<Wallet> getAllWallets() {
List<Wallet> allWallets = new ArrayList<>();
Wallet masterWallet = isMasterWallet() ? this : getMasterWallet();
allWallets.add(masterWallet);
allWallets.addAll(masterWallet.getChildWallets());
return allWallets;
}
public StandardAccount getStandardAccountType() {
int accountIndex = getAccountIndex();
return Arrays.stream(StandardAccount.values()).filter(standardAccount -> standardAccount.getChildNumber().num() == accountIndex).findFirst().orElse(null);