Closed mvsjes2 closed 2 years ago
Hello @mvsjes2, thanks for the report, that's a good catch. This changed in Bitcoin::Crypto 1.000, which was end of the beta phase. I replaced the custom setter subroutine with a Moo setter plus a type coercion, which works pretty much the same, minus the return value.
Since all of the setters return $self
and the documentation was not updated, I consider it Bitcoin::Crypto bug and will patch it in the following days. Before I do that, the return value of the set_network
method is pretty much whatever Moo returns from its setter, which seems to be object field's value.
I'll also replace the code you pasted with the one that will work with current as well as the next version of Bitcoin::Crypto.
Newly uploaded Bitcoin::Crypto version 1.003 has the problem with the return value fixed. The code here will stay as it is after your pull request. I'll close this ticket, thank you!
Component::MasterKey lazy initializes it's
_master_key
member, expecting aBitcoin::Crypto::Key::ExtPrivate
to be returned from the init routine:At Bitcoin-Crypto-0.997, this appeared to be working correctly, set_network returns the current Key object.
At Bitcoin-Crypto-1.002, set_network no longer returns the key object, it returns a
Bitcoin::Crypto::Network
object (seeBitcoin::Crypto::Role::Network
):The error returned from btcpaywalls is: