mirror of
https://github.com/aljazceru/nutshell.git
synced 2026-01-08 11:14:20 +01:00
clarify variable names (#279)
This commit is contained in:
@@ -635,15 +635,16 @@ class Wallet(LedgerAPI):
|
||||
if split:
|
||||
logger.trace(f"Mint with split: {split}")
|
||||
assert sum(split) == amount, "split must sum to amount"
|
||||
allowed_amounts = [2**i for i in range(settings.max_order)]
|
||||
for a in split:
|
||||
if a not in [2**i for i in range(settings.max_order)]:
|
||||
if a not in allowed_amounts:
|
||||
raise Exception(
|
||||
f"Can only mint amounts with 2^n up to {2**settings.max_order}."
|
||||
)
|
||||
|
||||
# if no split was specified, we use the canonical split
|
||||
split = split or amount_split(amount)
|
||||
proofs = await super().mint(split, hash)
|
||||
amounts = split or amount_split(amount)
|
||||
proofs = await super().mint(amounts, hash)
|
||||
if proofs == []:
|
||||
raise Exception("received no proofs.")
|
||||
await self._store_proofs(proofs)
|
||||
|
||||
Reference in New Issue
Block a user