You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which errors with: Error: Signing failed: private key should be a Buffer
I hypothesize this has to do with the way Webpack shims Buffers, which causes issues when using secp256k1 in Node, because the native version requires buffers, but is probably fine when used in a browser, since it falls back to using elliptic. (And since the test uses ts-jest rather than the Webpack bundle, the issue doesn't show up there.)
The native code in secp256k1 seems to complicate cross-platform compatibility. We've had a great experience using this WebAssembly alternative that's more portable (works seamlessly in Electron) and has decent performance, too. (One downside is the API might need to be async to ensure the WASM module is loaded). I'd be happy to PR that if you're interested!
The text was updated successfully, but these errors were encountered:
This is building cosmos-keys from 81917a8.
I'm running the code below, adapted from this test:
Which errors with:
Error: Signing failed: private key should be a Buffer
I hypothesize this has to do with the way Webpack shims Buffers, which causes issues when using
secp256k1
in Node, because the native version requires buffers, but is probably fine when used in a browser, since it falls back to using elliptic. (And since the test usests-jest
rather than the Webpack bundle, the issue doesn't show up there.)The native code in
secp256k1
seems to complicate cross-platform compatibility. We've had a great experience using this WebAssembly alternative that's more portable (works seamlessly in Electron) and has decent performance, too. (One downside is the API might need to be async to ensure the WASM module is loaded). I'd be happy to PR that if you're interested!The text was updated successfully, but these errors were encountered: