Skip to content
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

Regtest doesn't work #9

Open
eNzyOfficial opened this issue Jul 4, 2023 · 2 comments
Open

Regtest doesn't work #9

eNzyOfficial opened this issue Jul 4, 2023 · 2 comments

Comments

@eNzyOfficial
Copy link

https://github.com/Jorijn/bitcoin-bolt11/blob/f339bfb531159583ea966f924c97de2f85402002/src/Encoder/PaymentRequestDecoder.php#L295

If you pass in a regtest invoice, it fails. If I add another the bcrt case, it seems to work fine:

switch ($bech32Prefix) {
    case 'bc':
    case 'bcrt':
        return new BitcoinMainnet();

    case 'tb':
        return new BitcoinTestnet();

    default:
        throw new UnknownNetworkVersionException('unknown network for invoice:' . $bech32Prefix);
}

Although there might be a need for a new BitcoinRegtest class, but that's way above my knowledge

@jorijn
Copy link
Owner

jorijn commented Jul 4, 2023

Hi @eNzyOfficial

Would you be able to create a PR and include a unit test for this case?

Jorijn

@eNzyOfficial
Copy link
Author

Sorry for the slow reply, I'm a little busy to PR a unit test at the moment, I might be able to do it in a week or 2 when I've a little more time.

In the mean time, here is an example request if you'd like to write the test yourself:

https://lightningdecoder.com/lnbcrt5u1pj2lf33pp5ahahn2u3efqj8kwk28jcwxu0j3cclvscp0d32ufrvte5emhcflrqdqqcqzpgxqyz5vqsp5wd2n6ygajvlhflk7vx0eae6jrwp58fpunzwzlndswjlv4xndjuvs9qyyssqa4pa8g47p0fp0q7t9n0v3mpq64llvwjsvad9pzwk2djm2ncdvnl9usc3hc9mshv2gl3ksrx2e68agjwvhxu30fwcz8n5tvras99yvmcq228rh5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants