mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-04 06:44:24 +01:00
pytest: check millisatoshi by float raises
This only adds a test that currently makes sure its not possible to init a Millisatoshi by a floating number. Discussion: As @gallizoltan points out, initialization with a float should be possible: https://github.com/ElementsProject/lightning/pull/4273#discussion_r540369093 > Millisatoshi(5) / 2 currently works, and removes the half msat. > So, I think Millisatoshi(5 / 2) should be the same.
This commit is contained in:
committed by
Christian Decker
parent
bd13726db7
commit
0a01111395
@@ -68,6 +68,10 @@ class Millisatoshi:
|
||||
|
||||
elif int(v) == v:
|
||||
self.millisatoshis = int(v)
|
||||
|
||||
elif isinstance(v, float):
|
||||
raise TypeError("Millisatoshi by float is currently not supported")
|
||||
|
||||
else:
|
||||
raise TypeError(
|
||||
"Millisatoshi must be string with msat/sat/btc suffix or int"
|
||||
|
||||
Reference in New Issue
Block a user