MetacoSA / NBitpayClient

A non official library for using bitpay's API
MIT License
19 stars 18 forks source link

token parsing bug #26

Closed mrtristan closed 4 years ago

mrtristan commented 4 years ago

in public AccessToken GetAccessToken(Facade requirement), in the case of _Tokens containing just a pos token, and if a pos token is requested, the second if here will cause the token resolution to return null.

image

i'd propose that this can be shortened to the following which will achieve what you're trying to do with this fallback/inheritance concept:

image

additionally, it should use the token that was explicitly requested if present so starting it off with a null check to make sure the initial lookup attempt failed.

sending up a PR

mrtristan commented 4 years ago

@NicolasDorier if you get a chance to merge this and bump the package, that'd be appreciated. I'll need to set up consuming my fork otherwise so hoping I don't have to. 🤞

NicolasDorier commented 4 years ago

Thank you pushed new version. 1.0.0.36

mrtristan commented 4 years ago

appreciate the quick turnaround