BitGo / bitgo-utxo-lib

UTXO coins functions implemented in pure JavaScript
86 stars 146 forks source link

`fromBase58()` should pick the correct instead of always the last network object #36

Closed murchandamus closed 4 years ago

murchandamus commented 5 years ago

The method fromBase58() can take an array of network objects, but when it does that, it just pops the last one, in this case, the litecointest one.

Originally posted by @argjv in https://github.com/BitGo/bitgo-utxo-lib/pull/35#issuecomment-483931556

Instead it should be picking the correct network by some sort of identifier.

OttoAllmendinger commented 4 years ago

@Xekyo @argjv

to my understanding, we pick the last correct network object:

https://github.com/BitGo/bitgo-utxo-lib/blob/1da46b908f5be59dd0c84f88770d6ad0c59f189f/src/hdnode.js#L67-L72

Looks fine to me