Closed patrickReiis closed 3 months ago
The test:
import { assertEquals } from '@std/assert';
import { getAmount } from '@/utils/bolt11.ts';
Deno.test('Amount is 200000', () => {
assertEquals(
getAmount(
'lnbc2u1pn8qatypp5dweqaltlry2vgpxxyc0puxnc50335yznevj2g46wrhfm2694lhgqhp576ekte7lhhtsxdk6tfvkpyp8gdk2xccmuccdxwjd0fqdh34wfseqcqzzsxqyz5vqsp5n44zva7xndawg5l2r9d85v0tszwejtfzkc7v90d6c7d3nsdt0qds9qxpqysgqx2v2artsxmnfkpapdm9f5pahjs8etlpe7kcjue2kffhjg3jrtearstjvenr6lxzhpw3es4hpchzzeet7ul88elurfmvr9v94v0655rgpy7m7r5',
),
'200000',
);
});
I have never used deno, can you make a repository and in the README explain which version of deno I should use and what command I should run to get the deno test to run?
Hi, I created a new project from scratch and it works, I don't really know what happened but it had to do with libsecp256k1
The project I just created, in case someone wants to see in the future: https://github.com/patrickReiis/deno-bolt11
The project where all of this problem happened: https://gitlab.com/soapbox-pub/ditto
To fix it, instead of using bolt11
, I ended up using a fork: https://github.com/nbd-wtf/light-bolt11-decoder
Hi, I created a new project from scratch and it works
Glad to hear that it works!
I'm trying to decode a valid invoice to get the amount and this error happens:
I am using Deno and running it as a test
Here's my code: