MetacoSA / NBitcoin

Comprehensive Bitcoin library for the .NET framework.
MIT License
1.88k stars 848 forks source link

Key.Parse - network -> expectedNetwork #982

Closed molnard closed 3 years ago

molnard commented 3 years ago

I was confused if this is an option or a constraint. It is cleaner in this way.

Network.Parse uses the same naming which is expectedNetwork.

lontivero commented 3 years ago

After Named Parameters were introduced in C# this kind of improvement are potential breaking changes, this means that it could break those projects that use this method as follow:

var sk = Key.Parse(wif: aliceKey, network: Network.Main);

I know that is extremely unlikely but it is something we have to have in mind.

Anyway, if you change this method then you should also change the other Parse method because after this PR they will be different.