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

PRC: Missing Currency Validation in new_invoice #221

Open
EthanYuan opened this issue Oct 9, 2024 · 1 comment
Open

PRC: Missing Currency Validation in new_invoice #221

EthanYuan opened this issue Oct 9, 2024 · 1 comment

Comments

@EthanYuan
Copy link

While testing on the testnet, I used the currency field with the value Fibb, and it worked without error:

curl -X POST http://127.0.0.1:8231 \
-H "Content-Type: application/json" \
-d '{
  "id": 42,
  "jsonrpc": "2.0",
  "method": "new_invoice",
  "params": [
    {
      "amount": "0x5e5f100",
      "currency": "Fibb",
      "description": "node3",
      "expiry": "0x258",
      "final_cltv": "0x28",
      "payment_preimage": "0xc98223f6a5691d99637e81d4bb764b4b7042f071aefec72e30923af1043e549d",
      "hash_algorithm": "sha256",
      "udt_type_script": {
        "code_hash": "0x1142755a044bf2ee358cba9f2da187ce928c91cd4dc8692ded0337efa677d21a",
        "hash_type": "type",
        "args": "0x878fcc6f1f08d48e87bb1c3b3d5083f23f8a39c5d5c764f253b55b998526439b"
      }
    }
  ]
}'

Shouldn't this field enforce Fibt or valid currencies? It seems there's no validation for currency.

@chenyukang
Copy link
Collaborator

thanks for reporting this issue, yes, we need to add configuration for different network.

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