mirror of
https://github.com/aljazceru/nutshell.git
synced 2026-02-10 11:14:20 +01:00
[WIP] [NUTs] NUT-06 update: deprecate amount field in /split (#263)
* mint upgraded and still backwards compatible * cleanup * fix tests * fix things * add deprecated message to new struct * fix test * fix typo * readd endpoint that got lost during merge * version bump in pyproject.toml * remove wallet backwards compatibility because it makes no sense * comment for backwards compat * fix comment
This commit is contained in:
@@ -27,6 +27,13 @@ def test_tokenv3_deserialize_serialize():
|
||||
assert token.serialize() == token_str
|
||||
|
||||
|
||||
def test_tokenv3_deserialize_with_memo():
|
||||
token_str = "cashuAeyJ0b2tlbiI6IFt7InByb29mcyI6IFt7ImlkIjogIkplaFpMVTZuQ3BSZCIsICJhbW91bnQiOiAyLCAic2VjcmV0IjogIjBFN2lDazRkVmxSZjVQRjFnNFpWMnciLCAiQyI6ICIwM2FiNTgwYWQ5NTc3OGVkNTI5NmY4YmVlNjU1ZGJkN2Q2NDJmNWQzMmRlOGUyNDg0NzdlMGI0ZDZhYTg2M2ZjZDUifSwgeyJpZCI6ICJKZWhaTFU2bkNwUmQiLCAiYW1vdW50IjogOCwgInNlY3JldCI6ICJzNklwZXh3SGNxcXVLZDZYbW9qTDJnIiwgIkMiOiAiMDIyZDAwNGY5ZWMxNmE1OGFkOTAxNGMyNTliNmQ2MTRlZDM2ODgyOWYwMmMzODc3M2M0NzIyMWY0OTYxY2UzZjIzIn1dLCAibWludCI6ICJodHRwOi8vbG9jYWxob3N0OjMzMzgifV0sICJtZW1vIjogIlRlc3QgbWVtbyJ9"
|
||||
token = TokenV3.deserialize(token_str)
|
||||
assert token.serialize() == token_str
|
||||
assert token.memo == "Test memo"
|
||||
|
||||
|
||||
def test_calculate_number_of_blank_outputs():
|
||||
# Example from NUT-08 specification.
|
||||
fee_reserve_sat = 1000
|
||||
|
||||
@@ -198,7 +198,8 @@ async def test_split_more_than_balance(wallet1: Wallet):
|
||||
await wallet1.mint(64)
|
||||
await assert_err(
|
||||
wallet1.split(wallet1.proofs, 128),
|
||||
"Mint Error: split amount is higher than the total sum.",
|
||||
# "Mint Error: inputs do not have same amount as outputs",
|
||||
"amount too large.",
|
||||
)
|
||||
assert wallet1.balance == 64
|
||||
|
||||
@@ -274,7 +275,7 @@ async def test_split_invalid_amount(wallet1: Wallet):
|
||||
await wallet1.mint(64)
|
||||
await assert_err(
|
||||
wallet1.split(wallet1.proofs, -1),
|
||||
"Mint Error: invalid split amount: -1",
|
||||
"amount must be positive.",
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user