invoice: avoid negative msat amounts

This commit is contained in:
Wilmer Paulino committed 2018-01-23 14:38:20 -05:00
1 parent dd08662c87
commit cfb19b8d51
3 files changed
+17

No files matched your search

+8
View File
@@ -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,