show hwi signature verification errors, display strings encoded into scripts

This commit is contained in:
Craig Raw 2023-02-13 16:36:33 +02:00
parent c360177c31
commit 38768885e2
4 changed files with 5 additions and 3 deletions

2
drongo

@ -1 +1 @@
Subproject commit 883b1c95b4e8bd961fb07ff09327d9da4a5bcb9d Subproject commit 0002d6bae69feb4a5195418ae99d520653c5e7dc

View file

@ -25,7 +25,7 @@ public abstract class BaseController {
scriptArea.setMouseOverTextDelay(Duration.ofMillis(150)); scriptArea.setMouseOverTextDelay(Duration.ofMillis(150));
scriptArea.addEventHandler(MouseOverTextEvent.MOUSE_OVER_TEXT_BEGIN, e -> { scriptArea.addEventHandler(MouseOverTextEvent.MOUSE_OVER_TEXT_BEGIN, e -> {
TwoDimensional.Position position = scriptArea.getParagraph(0).getStyleSpans().offsetToPosition(e.getCharacterIndex(), Backward); TwoDimensional.Position position = scriptArea.getParagraph(0).getStyleSpans().offsetToPosition(e.getCharacterIndex(), Backward);
if(position.getMajor() % 2 == 0) { if(position.getMajor() % 2 == 0 && scriptArea.getScript().getChunks().size() > position.getMajor() / 2) {
ScriptChunk hoverChunk = scriptArea.getScript().getChunks().get(position.getMajor()/2); ScriptChunk hoverChunk = scriptArea.getScript().getChunks().get(position.getMajor()/2);
if(!hoverChunk.isOpCode()) { if(!hoverChunk.isOpCode()) {
Point2D pos = e.getScreenPosition(); Point2D pos = e.getScreenPosition();

View file

@ -58,6 +58,8 @@ public class ScriptArea extends CodeArea {
append("<signature" + signatureCount++ + ">", "script-signature"); append("<signature" + signatureCount++ + ">", "script-signature");
} else if(chunk.isPubKey()) { } else if(chunk.isPubKey()) {
append("<pubkey" + pubKeyCount++ + ">", "script-pubkey"); append("<pubkey" + pubKeyCount++ + ">", "script-pubkey");
} else if(chunk.isString()) {
append(chunk.toString(), "script-other");
} else if(chunk.isScript()) { } else if(chunk.isScript()) {
Script nestedScript = chunk.getScript(); Script nestedScript = chunk.getScript();
if (nestedScript.equals(redeemScript)) { if (nestedScript.equals(redeemScript)) {

View file

@ -278,7 +278,7 @@ public class Hwi {
} catch(IOException e) { } catch(IOException e) {
throw new SignTransactionException("Could not sign PSBT", e); throw new SignTransactionException("Could not sign PSBT", e);
} catch(PSBTParseException e) { } catch(PSBTParseException e) {
throw new SignTransactionException("Could not parse signed PSBT", e); throw new SignTransactionException("Could not parse signed PSBT" + (e.getMessage() != null ? ": " + e.getMessage() : ""), e);
} finally { } finally {
isPromptActive = false; isPromptActive = false;
} }