invoice: avoid negative msat amounts
This commit is contained in:
3 files changed
+17
No files matched your search
@@ -55,6 +55,10 @@ func TestDecodeAmount(t *testing.T) {
|
||||
amount: "1109p", // pBTC
|
||||
valid: false, // not divisible by 10
|
||||
},
|
||||
{
|
||||
amount: "-10p", // pBTC
|
||||
valid: false, // negative amount
|
||||
},
|
||||
{
|
||||
amount: "10p", // pBTC
|
||||
valid: true,
|
||||
@@ -145,6 +149,10 @@ func TestEncodeAmount(t *testing.T) {
|
||||
valid bool
|
||||
result string
|
||||
}{
|
||||
{
|
||||
msat: -10, // mSat
|
||||
valid: false, // negative amount
|
||||
},
|
||||
{
|
||||
msat: 1, // mSat
|
||||
valid: true,
|
||||
|
||||
Reference in new issue
Block a user