| 64 | } |
| 65 | |
| 66 | util::Result<void> ExternalSignerScriptPubKeyMan::DisplayAddress(const CTxDestination& dest, const ExternalSigner &signer) const |
| 67 | { |
| 68 | // TODO: avoid the need to infer a descriptor from inside a descriptor wallet |
| 69 | const CScript& scriptPubKey = GetScriptForDestination(dest); |
| 70 | auto provider = GetSolvingProvider(scriptPubKey); |
| 71 | auto descriptor = InferDescriptor(scriptPubKey, *provider); |
| 72 | |
| 73 | const UniValue& result = signer.DisplayAddress(descriptor->ToString()); |
| 74 | |
| 75 | const UniValue& error = result.find_value("error"); |
| 76 | if (error.isStr()) return util::Error{strprintf(_("Signer returned error: %s"), error.getValStr())}; |
| 77 | |
| 78 | const UniValue& ret_address = result.find_value("address"); |
| 79 | if (!ret_address.isStr()) return util::Error{_("Signer did not echo address")}; |
| 80 | |
| 81 | if (ret_address.getValStr() != EncodeDestination(dest)) { |
| 82 | return util::Error{strprintf(_("Signer echoed unexpected address %s"), ret_address.getValStr())}; |
| 83 | } |
| 84 | |
| 85 | return util::Result<void>(); |
| 86 | } |
| 87 | |
| 88 | // If sign is true, transaction must previously have been filled |
| 89 | std::optional<PSBTError> ExternalSignerScriptPubKeyMan::FillPSBT(PartiallySignedTransaction& psbt, const PrecomputedTransactionData& txdata, const common::PSBTFillOptions& options, int* n_signed) const |
nothing calls this directly
no test coverage detected