support tr script expressions in qr crypto-output

This commit is contained in:
Craig Raw 2021-11-12 17:18:24 +02:00
parent 8f04d23b3f
commit c566dea232
3 changed files with 6 additions and 2 deletions

View file

@ -65,7 +65,7 @@ dependencies {
implementation('com.github.arteam:simple-json-rpc-server:1.0') {
exclude group: 'org.slf4j'
}
implementation('com.sparrowwallet:hummingbird:1.6.2')
implementation('com.sparrowwallet:hummingbird:1.6.3')
implementation('com.nativelibs4java:bridj:0.7-20140918-3') {
exclude group: 'com.google.android.tools', module: 'dx'
}
@ -441,7 +441,7 @@ extraJavaModuleInfo {
module('kotlin-stdlib-1.5.20.jar', 'kotlin.stdlib', '1.5.20') {
exports('kotlin')
}
module('hummingbird-1.6.2.jar', 'com.sparrowwallet.hummingbird', '1.6.2') {
module('hummingbird-1.6.3.jar', 'com.sparrowwallet.hummingbird', '1.6.3') {
exports('com.sparrowwallet.hummingbird')
exports('com.sparrowwallet.hummingbird.registry')
requires('co.nstant.in.cbor')

View file

@ -515,6 +515,8 @@ public class QRScanDialog extends Dialog<QRScanDialog.Result> {
return ScriptType.P2SH_P2WSH;
} else if(List.of(ScriptExpression.WITNESS_SCRIPT_HASH).equals(expressions)) {
return ScriptType.P2WSH;
} else if(List.of(ScriptExpression.TAPROOT).equals(expressions)) {
return ScriptType.P2TR;
}
throw new IllegalArgumentException("Unknown script of " + expressions);

View file

@ -360,6 +360,8 @@ public class SettingsController extends WalletFormController implements Initiali
return List.of(ScriptExpression.SCRIPT_HASH, ScriptExpression.WITNESS_SCRIPT_HASH);
} else if(scriptType == ScriptType.P2WSH) {
return List.of(ScriptExpression.WITNESS_SCRIPT_HASH);
} else if(scriptType == ScriptType.P2TR) {
return List.of(ScriptExpression.TAPROOT);
}
throw new IllegalArgumentException("Unknown script type of " + scriptType);