mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
common/amount: new types struct amount_msat and struct amount_sat.
They're generally used pass-by-copy (unusual for C structs, but convenient they're basically u64) and all possibly problematic operations return WARN_UNUSED_RESULT bool to make you handle the over/underflow cases. The new #include in json.h means we bolt11.c sees the amount.h definition of MSAT_PER_BTC, so delete its local version. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -45,7 +45,7 @@ class FieldType(object):
|
||||
self.name = name
|
||||
|
||||
def is_assignable(self):
|
||||
return self.name in ['u8', 'u16', 'u32', 'u64', 'bool'] or self.name.startswith('enum ')
|
||||
return self.name in ['u8', 'u16', 'u32', 'u64', 'bool', 'struct amount_msat', 'struct amount_sat'] or self.name.startswith('enum ')
|
||||
|
||||
# We only accelerate the u8 case: it's common and trivial.
|
||||
def has_array_helper(self):
|
||||
|
||||
Reference in New Issue
Block a user