Skip to content

Commit

Permalink
feat: replace dash core quorum sign with quorum platformsign
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek committed Jul 22, 2024
1 parent 40266dc commit 51f82bf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
12 changes: 10 additions & 2 deletions dash/core/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,13 @@ func (rpcClient *RPCClient) QuorumSign(
if err := quorumType.Validate(); err != nil {
return nil, err
}
quorumSignResultWithBool, err := rpcClient.endpoint.QuorumSign(
quorumType,
quorumSignResultWithBool, err := rpcClient.endpoint.QuorumPlatformSign(
requestID.String(),
messageHash.String(),
quorumHash.String(),
false,
)

rpcClient.logger.Trace("core rpc call QuorumSign",
"quorumType", quorumType,
"requestID", requestID.String(),
Expand All @@ -192,7 +192,15 @@ func (rpcClient *RPCClient) QuorumSign(
if quorumSignResultWithBool == nil {
return nil, err
}

// as QuorumPlatformSign does not provide the quorum type, we need to check it manually
// to ensure we deliver what was requested by the caller
quorumSignResult := quorumSignResultWithBool.QuorumSignResult
if quorumType != btcjson.LLMQType(quorumSignResult.LLMQType) {
return nil, fmt.Errorf("possible misconfiguration: quorum platform sign uses unexpected quorum type %d, expected %d",
quorumSignResultWithBool.LLMQType, quorumType)
}

return &quorumSignResult, err
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce
github.com/containerd/continuity v0.3.0 // indirect
github.com/dashpay/bls-signatures/go-bindings v0.0.0-20230207105415-06df92693ac8
github.com/dashpay/dashd-go v0.24.1
github.com/dashpay/dashd-go v0.24.2-0.20240722114145-d91b0bbc5660
github.com/dashpay/dashd-go/btcec/v2 v2.1.0 // indirect
github.com/fortytw2/leaktest v1.3.0
github.com/fxamacker/cbor/v2 v2.4.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ github.com/daixiang0/gci v0.11.2 h1:Oji+oPsp3bQ6bNNgX30NBAVT18P4uBH4sRZnlOlTj7Y=
github.com/daixiang0/gci v0.11.2/go.mod h1:xtHP9N7AHdNvtRNfcx9gwTDfw7FRJx4bZUsiEfiNNAI=
github.com/dashpay/bls-signatures/go-bindings v0.0.0-20230207105415-06df92693ac8 h1:v4K3CiDoFY1gjcWL/scRcwzyjBwh8TVG3ek8cWolK1g=
github.com/dashpay/bls-signatures/go-bindings v0.0.0-20230207105415-06df92693ac8/go.mod h1:auvGS60NBZ+a21aCCQh366PdsjDvHinsCvl28VrYPu4=
github.com/dashpay/dashd-go v0.24.1 h1:w+F5pDt+fqud4QQM/O9sAJihbQ3oswO8DKOmDS/pcNw=
github.com/dashpay/dashd-go v0.24.1/go.mod h1:4yuk/laGME2RnQRTdqTbw87PhT+42hE1anLCnpkgls8=
github.com/dashpay/dashd-go v0.24.2-0.20240722114145-d91b0bbc5660 h1:cL7Pwgzb8zFuJ5LB9Zxr3+iB8MO668fH8M36fbky54g=
github.com/dashpay/dashd-go v0.24.2-0.20240722114145-d91b0bbc5660/go.mod h1:4yuk/laGME2RnQRTdqTbw87PhT+42hE1anLCnpkgls8=
github.com/dashpay/dashd-go/btcec/v2 v2.1.0 h1:fXwlLf5H+TtgHxjGMU74NesKzk6NisjKMPF04pBcygk=
github.com/dashpay/dashd-go/btcec/v2 v2.1.0/go.mod h1:1i8XtxdOmvK6mYEUCneVXTzFbrCUw3wq1u91j8gvsns=
github.com/dashpay/dashd-go/btcutil v1.2.0 h1:YMq7L0V0au5bbphIhpsBBc+nfOZqU+gJ4pkgRZB7Eiw=
Expand Down

0 comments on commit 51f82bf

Please sign in to comment.