Skip to content

Commit

Permalink
chore: fix quorum verify result type
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek committed Jan 13, 2025
1 parent 0e37c0c commit 015ef93
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 1 addition & 4 deletions btcjson/dashevoresults.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ type QuorumSignResultWithBool struct {

// QuorumVerifyResult models the data from the quorum verify command.
// returns a boolean.
type QuorumVerifyResult struct {
// Result is the output if submit was true
Result bool `json:"result,omitempty"`
}
type QuorumVerifyResult bool

// UnmarshalJSON is a custom unmarshal because the result can be just a boolean
func (qsr *QuorumSignResultWithBool) UnmarshalJSON(data []byte) error {
Expand Down
8 changes: 6 additions & 2 deletions rpcclient/evo.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,15 @@ func (c *Client) QuorumVerifyAsync(quorumType btcjson.LLMQType, requestID string

// QuorumVerify returns a true if the signature is valid and false if not
func (c *Client) QuorumVerify(quorumType btcjson.LLMQType, requestID string, messageHash string, signature string, quorumHash string) (bool, error) {
r, err := c.QuorumVerifyAsync(quorumType, requestID, messageHash, signature, quorumHash).Receive()
result, err := c.QuorumVerifyAsync(quorumType, requestID, messageHash, signature, quorumHash).Receive()
if err != nil {
return false, err
}
return r.Result, nil
if result == nil {
return false, fmt.Errorf("no result")
}

return bool(*result), nil
}

// ----------------------------- quorum info -----------------------------
Expand Down

0 comments on commit 015ef93

Please sign in to comment.