btcsuite / btcd

An alternative full node bitcoin implementation written in Go (golang)
https://github.com/btcsuite/btcd/blob/master/README.md
ISC License
6.1k stars 2.31k forks source link

musig2: fix early nonce gen option #2003

Closed sputn1ck closed 12 months ago

sputn1ck commented 12 months ago

Previously the early nonce generation option was not being respected when creating the context, with the WithKnownSigners option being used.

coveralls commented 12 months ago

Pull Request Test Coverage Report for Build 5519660551


Changes Missing Coverage Covered Lines Changed/Added Lines %
btcec/schnorr/musig2/context.go 7 9 77.78%
<!-- Total: 7 9 77.78% -->
Files with Coverage Reduction New Missed Lines %
peer/peer.go 10 73.2%
<!-- Total: 10 -->
Totals Coverage Status
Change from base Build 5512933726: -0.02%
Covered Lines: 26692
Relevant Lines: 48320

💛 - Coveralls
sputn1ck commented 12 months ago

Motivation makes sense, can we tack on a unit test to ensure the new code path works as expected and as a guard against regressions?

I adapted the early nonce gen test to use both ways of creating a context. Can also add a completely new unit test if preferred.