-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ecclib not initalised #60
Comments
hi @DaBors The initBTCCurve function is called in the simple-staking project: https://github.com/babylonchain/simple-staking/blob/dev/src/app/page.tsx#L201. I don't think this issue is related to your tsconfig setup. The ECC library simply needs to be initialized for it to work. While it would be ideal not to expose the initialization method publicly, bitcoinjs-lib does not provide a straightforward way to check if ECC has already been initialized. We might need to introduce a workaround if we still want to initialize the BTC curve within the library. Alternatively, we could refactor the code to make it a class with a constructor. However, for now, the best approach is to call the initialization function at the application layer. |
Oh missed that initialisation, my bad. I found this method getEccLib in the In any case while the manual initialisation via |
make sense to me. but seems the priority is low atm. we will try pick it up later on |
I was getting an
"Invalid change address"
error when I tried to create astakingTransaction
, after some investigation the issue was the following:'No ECC Library provided. You must call initEccLib() with a valid TinySecp256k1Interface instance'
, I think it would be nice to show the underlying issue why the address validation failed.btc-staking-ts/src/utils/address.ts
Line 10 in 3a9858a
I fixed the issue by calling the
initEccLib()
function, but as far as I understand it shouldn't be called from external sources (I couldn't find a call in the simple-staking repo). I'm using dynamic import for the btc-staking-ts not sure if that's might be the issue why the the Ecclib init wasn't called properlyOur tsconfig:
The text was updated successfully, but these errors were encountered: