CoinAmt: improvements
- do strict type checking in initializer, forbid double initialization - add dynamic decimal precision based on protocol - dunder method fixes, cleanups - JSON-RPC library now returns floats (i.e. amounts) as strings instead of Decimal, eliminating an extra conversion step
This commit is contained in:
parent
0924928ef3
commit
50fc415282
27 changed files with 220 additions and 109 deletions
|
|
@ -74,7 +74,7 @@ async def main():
|
|||
|
||||
bdr = (cur['time'] - old['time']) / sample_size
|
||||
t_rem = remaining * int(bdr)
|
||||
sub = cur['subsidy'] * proto.coin_amt.satoshi
|
||||
sub = proto.coin_amt(cur['subsidy'], from_unit='satoshi' if isinstance(cur['subsidy'], int) else None)
|
||||
|
||||
print(
|
||||
f'Current block: {tip}\n'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue