cryptocoinjs / coininfo

JavaScript component for crypto currency specific information.
116 stars 112 forks source link

empty messagePrefix causes captureStackTrace error #67

Closed imerkle closed 5 years ago

imerkle commented 6 years ago

Most coins don't have messagePrefix which causes error in bitcoinjslib

More here https://github.com/bitcoinjs/bitcoinjs-lib/issues/1205#issuecomment-418797999

dbolser commented 5 years ago

I'm seeing this problem too. Is it enough just to add the message prefix field?

dbolser commented 5 years ago

From bitcoinjs, I see that it wants...

    messagePrefix: '\x18Bitcoin Signed Message:\n',
    messagePrefix: '\x19Litecoin Signed Message:\n',
    messagePrefix: '\x19DarkCoin Signed Message:\n',
imerkle commented 5 years ago

I don't think it does anything special so you can just write messagePrefix: "\x18Bitcoin Signed Message:\n", for all the coins or fork and comment this line https://github.com/bitcoinjs/bitcoinjs-lib/blob/74f492b786bae22c391440edf22369d1471b9770/src/types.js#L23

dbolser commented 5 years ago

Seems the devs are already on top of this: https://github.com/cryptocoinjs/coininfo/blob/master/lib/coininfo.js#L70

So we can probably close this issue (or close pending a new release?)

Many thanks