add bsms model, additional taproot signing check

This commit is contained in:
Craig Raw 2023-02-23 11:59:47 +02:00
parent caed93ca6d
commit d0da764aad
2 changed files with 5 additions and 5 deletions

View file

@ -8,10 +8,7 @@ import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.math.BigInteger; import java.math.BigInteger;
import java.util.ArrayList; import java.util.*;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import static com.sparrowwallet.drongo.Utils.uint32ToByteStreamLE; import static com.sparrowwallet.drongo.Utils.uint32ToByteStreamLE;
import static com.sparrowwallet.drongo.Utils.uint64ToByteStreamLE; import static com.sparrowwallet.drongo.Utils.uint64ToByteStreamLE;
@ -634,6 +631,9 @@ public class Transaction extends ChildMessage {
if(spentUtxos.size() != getInputs().size()) { if(spentUtxos.size() != getInputs().size()) {
throw new IllegalArgumentException("Provided spent UTXOs length does not equal the number of transaction inputs"); throw new IllegalArgumentException("Provided spent UTXOs length does not equal the number of transaction inputs");
} }
if(spentUtxos.stream().anyMatch(Objects::isNull)) {
throw new IllegalArgumentException("Not all spent UTXOs are provided");
}
if(inputIndex >= getInputs().size()) { if(inputIndex >= getInputs().size()) {
throw new IllegalArgumentException("Input index is greater than the number of transaction inputs"); throw new IllegalArgumentException("Input index is greater than the number of transaction inputs");
} }

View file

@ -4,7 +4,7 @@ import java.util.Locale;
public enum WalletModel { public enum WalletModel {
SEED, SPARROW, BITCOIN_CORE, ELECTRUM, TREZOR_1, TREZOR_T, COLDCARD, LEDGER_NANO_S, LEDGER_NANO_X, DIGITALBITBOX_01, KEEPKEY, SPECTER_DESKTOP, COBO_VAULT, SEED, SPARROW, BITCOIN_CORE, ELECTRUM, TREZOR_1, TREZOR_T, COLDCARD, LEDGER_NANO_S, LEDGER_NANO_X, DIGITALBITBOX_01, KEEPKEY, SPECTER_DESKTOP, COBO_VAULT,
BITBOX_02, SPECTER_DIY, PASSPORT, BLUE_WALLET, KEYSTONE, SEEDSIGNER, CARAVAN, GORDIAN_SEED_TOOL, JADE, LEDGER_NANO_S_PLUS, EPS, TAPSIGNER, SATSCARD, LABELS; BITBOX_02, SPECTER_DIY, PASSPORT, BLUE_WALLET, KEYSTONE, SEEDSIGNER, CARAVAN, GORDIAN_SEED_TOOL, JADE, LEDGER_NANO_S_PLUS, EPS, TAPSIGNER, SATSCARD, LABELS, BSMS;
public static WalletModel getModel(String model) { public static WalletModel getModel(String model) {
return valueOf(model.toUpperCase(Locale.ROOT)); return valueOf(model.toUpperCase(Locale.ROOT));