walletrpc: return meaningful responses instead of empty

This commit is contained in:
Oliver Gugger 2024-11-06 15:30:26 +01:00
parent 26216f749a
commit d89ea2d335
No known key found for this signature in database
GPG Key ID: 8E4256593F177720
4 changed files with 562 additions and 496 deletions

File diff suppressed because it is too large Load Diff

View File

@ -414,6 +414,8 @@ message ReleaseOutputRequest {
}
message ReleaseOutputResponse {
// The status of the release operation.
string status = 1;
}
message KeyReq {
@ -699,6 +701,8 @@ message ImportPublicKeyRequest {
AddressType address_type = 2;
}
message ImportPublicKeyResponse {
// The status of the import operation.
string status = 1;
}
message ImportTapscriptRequest {
@ -1318,6 +1322,8 @@ message LabelTransactionRequest {
}
message LabelTransactionResponse {
// The status of the label operation.
string status = 1;
}
// The possible change address types for default accounts and single imported

View File

@ -1692,7 +1692,13 @@
}
},
"walletrpcImportPublicKeyResponse": {
"type": "object"
"type": "object",
"properties": {
"status": {
"type": "string",
"description": "The status of the import operation."
}
}
},
"walletrpcImportTapscriptRequest": {
"type": "object",
@ -1764,7 +1770,13 @@
}
},
"walletrpcLabelTransactionResponse": {
"type": "object"
"type": "object",
"properties": {
"status": {
"type": "string",
"description": "The status of the label operation."
}
}
},
"walletrpcLeaseOutputRequest": {
"type": "object",
@ -2002,7 +2014,13 @@
}
},
"walletrpcReleaseOutputResponse": {
"type": "object"
"type": "object",
"properties": {
"status": {
"type": "string",
"description": "The status of the release operation."
}
}
},
"walletrpcRemoveTransactionResponse": {
"type": "object",

View File

@ -536,7 +536,9 @@ func (w *WalletKit) ReleaseOutput(ctx context.Context,
return nil, err
}
return &ReleaseOutputResponse{}, nil
return &ReleaseOutputResponse{
Status: fmt.Sprintf("output %v released", op.String()),
}, nil
}
// ListLeases returns a list of all currently locked utxos.
@ -1443,7 +1445,10 @@ func (w *WalletKit) LabelTransaction(ctx context.Context,
}
err = w.cfg.Wallet.LabelTransaction(*hash, req.Label, req.Overwrite)
return &LabelTransactionResponse{}, err
return &LabelTransactionResponse{
Status: fmt.Sprintf("transaction label '%s' added", req.Label),
}, err
}
// FundPsbt creates a fully populated PSBT that contains enough inputs to fund
@ -2896,7 +2901,10 @@ func (w *WalletKit) ImportPublicKey(_ context.Context,
return nil, err
}
return &ImportPublicKeyResponse{}, nil
return &ImportPublicKeyResponse{
Status: fmt.Sprintf("public key %x imported",
pubKey.SerializeCompressed()),
}, nil
}
// ImportTapscript imports a Taproot script and internal key and adds the