Merge bitcoin/bitcoin#34867: wallet: document importdescriptors error object fields

445143bfc6 wallet: document structured importdescriptors errors (Renato Britto)

Pull request description:

  Related to #29912 and the machine-readable OpenRPC generated from `RPCHelpMan` metadata work discussed in #34683. Split out from #34764 per review feedback that this change is conceptually separate from the broader elision work there.

  The `importdescriptors` RPC help currently documents the optional `error` field using an elided `JSONRPC error` placeholder. This PR replaces that with explicit `code` and `message` fields.

  `importdescriptors` already returns a structured JSON-RPC error object in practice, so this makes the documented result schema match the existing response shape more closely.

  This PR changes `importdescriptors` help text, and the runtime checks on the returned json to be more strict.

ACKs for top commit:
  nervana21:
    tACK 445143bfc6
  maflcko:
    lgtm ACK 445143bfc6

Tree-SHA512: 3bda1cc7dd222c1d2e4dfbb2ee4a3f0201914c8b6bed5efb7fe7866227867c43235a9c5f5ec6f56e7ba286db0a43962c782d7ff29eec9aef4e70dc2c3daa6a0e
This commit is contained in:
merge-script
2026-03-30 20:11:06 +08:00

View File

@@ -343,7 +343,8 @@ RPCHelpMan importdescriptors()
}},
{RPCResult::Type::OBJ, "error", /*optional=*/true, "",
{
{RPCResult::Type::ELISION, "", "JSONRPC error"},
{RPCResult::Type::NUM, "code", "JSONRPC error code"},
{RPCResult::Type::STR, "message", "JSONRPC error message"},
}},
}},
}