|
@@ -1,10 +1,6 @@
|
|
|
#!/usr/bin/env python3
|
|
#!/usr/bin/env python3
|
|
|
"""
|
|
"""
|
|
|
-Test suite for database transactions focusing on:
|
|
|
|
|
-- increment_keyset_counter operations
|
|
|
|
|
-- Transaction commits
|
|
|
|
|
-- Transaction reads
|
|
|
|
|
-- Implicit rollbacks on drop
|
|
|
|
|
|
|
+Test suite for CDK FFI wallet and transaction operations
|
|
|
"""
|
|
"""
|
|
|
|
|
|
|
|
import asyncio
|
|
import asyncio
|
|
@@ -33,6 +29,8 @@ sys.path.insert(0, str(bindings_path))
|
|
|
import cdk_ffi
|
|
import cdk_ffi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+# Transaction Tests (using explicit transactions)
|
|
|
|
|
+
|
|
|
async def test_increment_keyset_counter_commit():
|
|
async def test_increment_keyset_counter_commit():
|
|
|
"""Test that increment_keyset_counter works and persists after commit"""
|
|
"""Test that increment_keyset_counter works and persists after commit"""
|
|
|
print("\n=== Test: Increment Keyset Counter with Commit ===")
|
|
print("\n=== Test: Increment Keyset Counter with Commit ===")
|
|
@@ -41,14 +39,10 @@ async def test_increment_keyset_counter_commit():
|
|
|
db_path = tmp.name
|
|
db_path = tmp.name
|
|
|
|
|
|
|
|
try:
|
|
try:
|
|
|
- # Create database
|
|
|
|
|
backend = cdk_ffi.WalletDbBackend.SQLITE(path=db_path)
|
|
backend = cdk_ffi.WalletDbBackend.SQLITE(path=db_path)
|
|
|
db = cdk_ffi.create_wallet_db(backend)
|
|
db = cdk_ffi.create_wallet_db(backend)
|
|
|
|
|
|
|
|
- # Create a keyset ID (16 hex characters = 8 bytes)
|
|
|
|
|
keyset_id = cdk_ffi.Id(hex="004146bdf4a9afab")
|
|
keyset_id = cdk_ffi.Id(hex="004146bdf4a9afab")
|
|
|
-
|
|
|
|
|
- # Add keyset info first
|
|
|
|
|
mint_url = cdk_ffi.MintUrl(url="https://testmint.example.com")
|
|
mint_url = cdk_ffi.MintUrl(url="https://testmint.example.com")
|
|
|
keyset_info = cdk_ffi.KeySetInfo(
|
|
keyset_info = cdk_ffi.KeySetInfo(
|
|
|
id=keyset_id.hex,
|
|
id=keyset_id.hex,
|
|
@@ -57,43 +51,38 @@ async def test_increment_keyset_counter_commit():
|
|
|
input_fee_ppk=0
|
|
input_fee_ppk=0
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- # Begin transaction, add mint and keyset
|
|
|
|
|
|
|
+ # Setup
|
|
|
tx = await db.begin_db_transaction()
|
|
tx = await db.begin_db_transaction()
|
|
|
- await tx.add_mint(mint_url, None) # Add mint first (foreign key requirement)
|
|
|
|
|
|
|
+ await tx.add_mint(mint_url, None)
|
|
|
await tx.add_mint_keysets(mint_url, [keyset_info])
|
|
await tx.add_mint_keysets(mint_url, [keyset_info])
|
|
|
await tx.commit()
|
|
await tx.commit()
|
|
|
|
|
|
|
|
- # Begin new transaction and increment counter
|
|
|
|
|
|
|
+ # Increment counter in transaction
|
|
|
tx = await db.begin_db_transaction()
|
|
tx = await db.begin_db_transaction()
|
|
|
counter1 = await tx.increment_keyset_counter(keyset_id, 1)
|
|
counter1 = await tx.increment_keyset_counter(keyset_id, 1)
|
|
|
- print(f"First increment: {counter1}")
|
|
|
|
|
- assert counter1 == 1, f"Expected counter to be 1, got {counter1}"
|
|
|
|
|
-
|
|
|
|
|
counter2 = await tx.increment_keyset_counter(keyset_id, 5)
|
|
counter2 = await tx.increment_keyset_counter(keyset_id, 5)
|
|
|
- print(f"Second increment (+5): {counter2}")
|
|
|
|
|
- assert counter2 == 6, f"Expected counter to be 6, got {counter2}"
|
|
|
|
|
-
|
|
|
|
|
- # Commit the transaction
|
|
|
|
|
await tx.commit()
|
|
await tx.commit()
|
|
|
- print("✓ Transaction committed")
|
|
|
|
|
|
|
|
|
|
- # Verify the counter persisted by reading in a new transaction
|
|
|
|
|
|
|
+ assert counter1 == 1, f"Expected counter 1, got {counter1}"
|
|
|
|
|
+ assert counter2 == 6, f"Expected counter 6, got {counter2}"
|
|
|
|
|
+ print("✓ Counters incremented correctly")
|
|
|
|
|
+
|
|
|
|
|
+ # Verify persistence
|
|
|
tx_read = await db.begin_db_transaction()
|
|
tx_read = await db.begin_db_transaction()
|
|
|
counter3 = await tx_read.increment_keyset_counter(keyset_id, 0)
|
|
counter3 = await tx_read.increment_keyset_counter(keyset_id, 0)
|
|
|
await tx_read.rollback()
|
|
await tx_read.rollback()
|
|
|
- print(f"Counter after commit (read with +0): {counter3}")
|
|
|
|
|
- assert counter3 == 6, f"Expected counter to persist at 6, got {counter3}"
|
|
|
|
|
|
|
+ assert counter3 == 6, f"Expected persisted counter 6, got {counter3}"
|
|
|
|
|
+ print("✓ Counter persisted after commit")
|
|
|
|
|
|
|
|
- print("✓ Test passed: Counter increments and commits work correctly")
|
|
|
|
|
|
|
+ print("✓ Test passed: Counter increments and commits work")
|
|
|
|
|
|
|
|
finally:
|
|
finally:
|
|
|
- # Cleanup
|
|
|
|
|
if os.path.exists(db_path):
|
|
if os.path.exists(db_path):
|
|
|
os.unlink(db_path)
|
|
os.unlink(db_path)
|
|
|
|
|
|
|
|
|
|
|
|
|
async def test_implicit_rollback_on_drop():
|
|
async def test_implicit_rollback_on_drop():
|
|
|
- """Test that transactions are implicitly rolled back when dropped without commit"""
|
|
|
|
|
|
|
+ """Test that transactions are implicitly rolled back when dropped"""
|
|
|
print("\n=== Test: Implicit Rollback on Drop ===")
|
|
print("\n=== Test: Implicit Rollback on Drop ===")
|
|
|
|
|
|
|
|
with tempfile.NamedTemporaryFile(suffix=".db", delete=False) as tmp:
|
|
with tempfile.NamedTemporaryFile(suffix=".db", delete=False) as tmp:
|
|
@@ -106,9 +95,9 @@ async def test_implicit_rollback_on_drop():
|
|
|
keyset_id = cdk_ffi.Id(hex="004146bdf4a9afab")
|
|
keyset_id = cdk_ffi.Id(hex="004146bdf4a9afab")
|
|
|
mint_url = cdk_ffi.MintUrl(url="https://testmint.example.com")
|
|
mint_url = cdk_ffi.MintUrl(url="https://testmint.example.com")
|
|
|
|
|
|
|
|
- # Setup: Add keyset
|
|
|
|
|
|
|
+ # Setup
|
|
|
tx = await db.begin_db_transaction()
|
|
tx = await db.begin_db_transaction()
|
|
|
- await tx.add_mint(mint_url, None) # Add mint first (foreign key requirement)
|
|
|
|
|
|
|
+ await tx.add_mint(mint_url, None)
|
|
|
keyset_info = cdk_ffi.KeySetInfo(
|
|
keyset_info = cdk_ffi.KeySetInfo(
|
|
|
id=keyset_id.hex,
|
|
id=keyset_id.hex,
|
|
|
unit=cdk_ffi.CurrencyUnit.SAT(),
|
|
unit=cdk_ffi.CurrencyUnit.SAT(),
|
|
@@ -124,29 +113,25 @@ async def test_implicit_rollback_on_drop():
|
|
|
await tx_read.rollback()
|
|
await tx_read.rollback()
|
|
|
print(f"Initial counter: {initial_counter}")
|
|
print(f"Initial counter: {initial_counter}")
|
|
|
|
|
|
|
|
- # Start a transaction and increment counter but don't commit
|
|
|
|
|
- print("Starting transaction without commit...")
|
|
|
|
|
|
|
+ # Increment without commit
|
|
|
tx_no_commit = await db.begin_db_transaction()
|
|
tx_no_commit = await db.begin_db_transaction()
|
|
|
incremented = await tx_no_commit.increment_keyset_counter(keyset_id, 10)
|
|
incremented = await tx_no_commit.increment_keyset_counter(keyset_id, 10)
|
|
|
print(f"Counter incremented to {incremented} (not committed)")
|
|
print(f"Counter incremented to {incremented} (not committed)")
|
|
|
-
|
|
|
|
|
- # Let the transaction go out of scope (implicit rollback)
|
|
|
|
|
del tx_no_commit
|
|
del tx_no_commit
|
|
|
|
|
|
|
|
- # Give async cleanup time to run
|
|
|
|
|
await asyncio.sleep(0.5)
|
|
await asyncio.sleep(0.5)
|
|
|
print("Transaction dropped (should trigger implicit rollback)")
|
|
print("Transaction dropped (should trigger implicit rollback)")
|
|
|
|
|
|
|
|
- # Verify counter was rolled back
|
|
|
|
|
|
|
+ # Verify rollback
|
|
|
tx_verify = await db.begin_db_transaction()
|
|
tx_verify = await db.begin_db_transaction()
|
|
|
final_counter = await tx_verify.increment_keyset_counter(keyset_id, 0)
|
|
final_counter = await tx_verify.increment_keyset_counter(keyset_id, 0)
|
|
|
await tx_verify.rollback()
|
|
await tx_verify.rollback()
|
|
|
- print(f"Counter after implicit rollback: {final_counter}")
|
|
|
|
|
|
|
|
|
|
assert final_counter == initial_counter, \
|
|
assert final_counter == initial_counter, \
|
|
|
f"Expected counter to rollback to {initial_counter}, got {final_counter}"
|
|
f"Expected counter to rollback to {initial_counter}, got {final_counter}"
|
|
|
|
|
+ print("✓ Implicit rollback works correctly")
|
|
|
|
|
|
|
|
- print("✓ Test passed: Implicit rollback works correctly")
|
|
|
|
|
|
|
+ print("✓ Test passed: Implicit rollback on drop works")
|
|
|
|
|
|
|
|
finally:
|
|
finally:
|
|
|
if os.path.exists(db_path):
|
|
if os.path.exists(db_path):
|
|
@@ -169,7 +154,7 @@ async def test_explicit_rollback():
|
|
|
|
|
|
|
|
# Setup
|
|
# Setup
|
|
|
tx = await db.begin_db_transaction()
|
|
tx = await db.begin_db_transaction()
|
|
|
- await tx.add_mint(mint_url, None) # Add mint first (foreign key requirement)
|
|
|
|
|
|
|
+ await tx.add_mint(mint_url, None)
|
|
|
keyset_info = cdk_ffi.KeySetInfo(
|
|
keyset_info = cdk_ffi.KeySetInfo(
|
|
|
id=keyset_id.hex,
|
|
id=keyset_id.hex,
|
|
|
unit=cdk_ffi.CurrencyUnit.SAT(),
|
|
unit=cdk_ffi.CurrencyUnit.SAT(),
|
|
@@ -179,14 +164,12 @@ async def test_explicit_rollback():
|
|
|
await tx.add_mint_keysets(mint_url, [keyset_info])
|
|
await tx.add_mint_keysets(mint_url, [keyset_info])
|
|
|
counter_initial = await tx.increment_keyset_counter(keyset_id, 5)
|
|
counter_initial = await tx.increment_keyset_counter(keyset_id, 5)
|
|
|
await tx.commit()
|
|
await tx.commit()
|
|
|
- print(f"Initial counter committed: {counter_initial}")
|
|
|
|
|
|
|
+ print(f"Initial counter: {counter_initial}")
|
|
|
|
|
|
|
|
- # Start transaction, increment, then explicitly rollback
|
|
|
|
|
|
|
+ # Increment and rollback
|
|
|
tx_rollback = await db.begin_db_transaction()
|
|
tx_rollback = await db.begin_db_transaction()
|
|
|
counter_incremented = await tx_rollback.increment_keyset_counter(keyset_id, 100)
|
|
counter_incremented = await tx_rollback.increment_keyset_counter(keyset_id, 100)
|
|
|
print(f"Counter incremented to {counter_incremented} in transaction")
|
|
print(f"Counter incremented to {counter_incremented} in transaction")
|
|
|
-
|
|
|
|
|
- # Explicit rollback
|
|
|
|
|
await tx_rollback.rollback()
|
|
await tx_rollback.rollback()
|
|
|
print("Explicitly rolled back transaction")
|
|
print("Explicitly rolled back transaction")
|
|
|
|
|
|
|
@@ -194,12 +177,12 @@ async def test_explicit_rollback():
|
|
|
tx_verify = await db.begin_db_transaction()
|
|
tx_verify = await db.begin_db_transaction()
|
|
|
counter_after = await tx_verify.increment_keyset_counter(keyset_id, 0)
|
|
counter_after = await tx_verify.increment_keyset_counter(keyset_id, 0)
|
|
|
await tx_verify.rollback()
|
|
await tx_verify.rollback()
|
|
|
- print(f"Counter after explicit rollback: {counter_after}")
|
|
|
|
|
|
|
|
|
|
assert counter_after == counter_initial, \
|
|
assert counter_after == counter_initial, \
|
|
|
- f"Expected counter to be {counter_initial} after rollback, got {counter_after}"
|
|
|
|
|
|
|
+ f"Expected counter {counter_initial}, got {counter_after}"
|
|
|
|
|
+ print("✓ Explicit rollback works correctly")
|
|
|
|
|
|
|
|
- print("✓ Test passed: Explicit rollback works correctly")
|
|
|
|
|
|
|
+ print("✓ Test passed: Explicit rollback works")
|
|
|
|
|
|
|
|
finally:
|
|
finally:
|
|
|
if os.path.exists(db_path):
|
|
if os.path.exists(db_path):
|
|
@@ -220,9 +203,9 @@ async def test_transaction_reads():
|
|
|
keyset_id = cdk_ffi.Id(hex="004146bdf4a9afab")
|
|
keyset_id = cdk_ffi.Id(hex="004146bdf4a9afab")
|
|
|
mint_url = cdk_ffi.MintUrl(url="https://testmint.example.com")
|
|
mint_url = cdk_ffi.MintUrl(url="https://testmint.example.com")
|
|
|
|
|
|
|
|
- # Add keyset in transaction
|
|
|
|
|
|
|
+ # Add keyset in transaction and read within same transaction
|
|
|
tx = await db.begin_db_transaction()
|
|
tx = await db.begin_db_transaction()
|
|
|
- await tx.add_mint(mint_url, None) # Add mint first (foreign key requirement)
|
|
|
|
|
|
|
+ await tx.add_mint(mint_url, None)
|
|
|
keyset_info = cdk_ffi.KeySetInfo(
|
|
keyset_info = cdk_ffi.KeySetInfo(
|
|
|
id=keyset_id.hex,
|
|
id=keyset_id.hex,
|
|
|
unit=cdk_ffi.CurrencyUnit.SAT(),
|
|
unit=cdk_ffi.CurrencyUnit.SAT(),
|
|
@@ -231,23 +214,21 @@ async def test_transaction_reads():
|
|
|
)
|
|
)
|
|
|
await tx.add_mint_keysets(mint_url, [keyset_info])
|
|
await tx.add_mint_keysets(mint_url, [keyset_info])
|
|
|
|
|
|
|
|
- # Read within the same transaction (should see uncommitted data)
|
|
|
|
|
keyset_read = await tx.get_keyset_by_id(keyset_id)
|
|
keyset_read = await tx.get_keyset_by_id(keyset_id)
|
|
|
- assert keyset_read is not None, "Should be able to read keyset within transaction"
|
|
|
|
|
|
|
+ assert keyset_read is not None, "Should read within transaction"
|
|
|
assert keyset_read.id == keyset_id.hex, "Keyset ID should match"
|
|
assert keyset_read.id == keyset_id.hex, "Keyset ID should match"
|
|
|
- print(f"✓ Read keyset within transaction: {keyset_read.id}")
|
|
|
|
|
|
|
+ print("✓ Read keyset within transaction")
|
|
|
|
|
|
|
|
await tx.commit()
|
|
await tx.commit()
|
|
|
- print("✓ Transaction committed")
|
|
|
|
|
|
|
|
|
|
- # Read from a new transaction
|
|
|
|
|
|
|
+ # Read from new transaction
|
|
|
tx_new = await db.begin_db_transaction()
|
|
tx_new = await db.begin_db_transaction()
|
|
|
keyset_read2 = await tx_new.get_keyset_by_id(keyset_id)
|
|
keyset_read2 = await tx_new.get_keyset_by_id(keyset_id)
|
|
|
- assert keyset_read2 is not None, "Should be able to read committed keyset"
|
|
|
|
|
- print(f"✓ Read keyset in new transaction: {keyset_read2.id}")
|
|
|
|
|
|
|
+ assert keyset_read2 is not None, "Should read committed keyset"
|
|
|
await tx_new.rollback()
|
|
await tx_new.rollback()
|
|
|
|
|
+ print("✓ Read keyset in new transaction")
|
|
|
|
|
|
|
|
- print("✓ Test passed: Transaction reads work correctly")
|
|
|
|
|
|
|
+ print("✓ Test passed: Transaction reads work")
|
|
|
|
|
|
|
|
finally:
|
|
finally:
|
|
|
if os.path.exists(db_path):
|
|
if os.path.exists(db_path):
|
|
@@ -255,7 +236,7 @@ async def test_transaction_reads():
|
|
|
|
|
|
|
|
|
|
|
|
|
async def test_multiple_increments_same_transaction():
|
|
async def test_multiple_increments_same_transaction():
|
|
|
- """Test multiple increments in the same transaction"""
|
|
|
|
|
|
|
+ """Test multiple increments in same transaction"""
|
|
|
print("\n=== Test: Multiple Increments in Same Transaction ===")
|
|
print("\n=== Test: Multiple Increments in Same Transaction ===")
|
|
|
|
|
|
|
|
with tempfile.NamedTemporaryFile(suffix=".db", delete=False) as tmp:
|
|
with tempfile.NamedTemporaryFile(suffix=".db", delete=False) as tmp:
|
|
@@ -270,7 +251,7 @@ async def test_multiple_increments_same_transaction():
|
|
|
|
|
|
|
|
# Setup
|
|
# Setup
|
|
|
tx = await db.begin_db_transaction()
|
|
tx = await db.begin_db_transaction()
|
|
|
- await tx.add_mint(mint_url, None) # Add mint first (foreign key requirement)
|
|
|
|
|
|
|
+ await tx.add_mint(mint_url, None)
|
|
|
keyset_info = cdk_ffi.KeySetInfo(
|
|
keyset_info = cdk_ffi.KeySetInfo(
|
|
|
id=keyset_id.hex,
|
|
id=keyset_id.hex,
|
|
|
unit=cdk_ffi.CurrencyUnit.SAT(),
|
|
unit=cdk_ffi.CurrencyUnit.SAT(),
|
|
@@ -282,38 +263,34 @@ async def test_multiple_increments_same_transaction():
|
|
|
|
|
|
|
|
# Multiple increments in one transaction
|
|
# Multiple increments in one transaction
|
|
|
tx = await db.begin_db_transaction()
|
|
tx = await db.begin_db_transaction()
|
|
|
-
|
|
|
|
|
counters = []
|
|
counters = []
|
|
|
for i in range(1, 6):
|
|
for i in range(1, 6):
|
|
|
counter = await tx.increment_keyset_counter(keyset_id, 1)
|
|
counter = await tx.increment_keyset_counter(keyset_id, 1)
|
|
|
counters.append(counter)
|
|
counters.append(counter)
|
|
|
- print(f"Increment {i}: counter = {counter}")
|
|
|
|
|
|
|
|
|
|
- # Verify sequence
|
|
|
|
|
expected = list(range(1, 6))
|
|
expected = list(range(1, 6))
|
|
|
assert counters == expected, f"Expected {expected}, got {counters}"
|
|
assert counters == expected, f"Expected {expected}, got {counters}"
|
|
|
- print(f"✓ Counters incremented correctly: {counters}")
|
|
|
|
|
|
|
+ print(f"✓ Counters incremented: {counters}")
|
|
|
|
|
|
|
|
await tx.commit()
|
|
await tx.commit()
|
|
|
- print("✓ All increments committed")
|
|
|
|
|
|
|
|
|
|
# Verify final value
|
|
# Verify final value
|
|
|
tx_verify = await db.begin_db_transaction()
|
|
tx_verify = await db.begin_db_transaction()
|
|
|
final = await tx_verify.increment_keyset_counter(keyset_id, 0)
|
|
final = await tx_verify.increment_keyset_counter(keyset_id, 0)
|
|
|
await tx_verify.rollback()
|
|
await tx_verify.rollback()
|
|
|
- assert final == 5, f"Expected final counter to be 5, got {final}"
|
|
|
|
|
- print(f"✓ Final counter value: {final}")
|
|
|
|
|
|
|
+ assert final == 5, f"Expected final counter 5, got {final}"
|
|
|
|
|
+ print("✓ Final counter value correct")
|
|
|
|
|
|
|
|
- print("✓ Test passed: Multiple increments work correctly")
|
|
|
|
|
|
|
+ print("✓ Test passed: Multiple increments work")
|
|
|
|
|
|
|
|
finally:
|
|
finally:
|
|
|
if os.path.exists(db_path):
|
|
if os.path.exists(db_path):
|
|
|
os.unlink(db_path)
|
|
os.unlink(db_path)
|
|
|
|
|
|
|
|
|
|
|
|
|
-async def test_wallet_mint_operations():
|
|
|
|
|
- """Test adding and querying mints in transactions"""
|
|
|
|
|
- print("\n=== Test: Wallet Mint Operations ===")
|
|
|
|
|
|
|
+async def test_transaction_atomicity():
|
|
|
|
|
+ """Test that transaction rollback reverts all changes"""
|
|
|
|
|
+ print("\n=== Test: Transaction Atomicity ===")
|
|
|
|
|
|
|
|
with tempfile.NamedTemporaryFile(suffix=".db", delete=False) as tmp:
|
|
with tempfile.NamedTemporaryFile(suffix=".db", delete=False) as tmp:
|
|
|
db_path = tmp.name
|
|
db_path = tmp.name
|
|
@@ -324,32 +301,89 @@ async def test_wallet_mint_operations():
|
|
|
|
|
|
|
|
mint_url1 = cdk_ffi.MintUrl(url="https://mint1.example.com")
|
|
mint_url1 = cdk_ffi.MintUrl(url="https://mint1.example.com")
|
|
|
mint_url2 = cdk_ffi.MintUrl(url="https://mint2.example.com")
|
|
mint_url2 = cdk_ffi.MintUrl(url="https://mint2.example.com")
|
|
|
|
|
+ keyset_id = cdk_ffi.Id(hex="004146bdf4a9afab")
|
|
|
|
|
|
|
|
- # Add multiple mints in a transaction
|
|
|
|
|
|
|
+ # Transaction with multiple operations
|
|
|
tx = await db.begin_db_transaction()
|
|
tx = await db.begin_db_transaction()
|
|
|
await tx.add_mint(mint_url1, None)
|
|
await tx.add_mint(mint_url1, None)
|
|
|
await tx.add_mint(mint_url2, None)
|
|
await tx.add_mint(mint_url2, None)
|
|
|
- await tx.commit()
|
|
|
|
|
- print("✓ Added 2 mints in transaction")
|
|
|
|
|
|
|
+ keyset_info = cdk_ffi.KeySetInfo(
|
|
|
|
|
+ id=keyset_id.hex,
|
|
|
|
|
+ unit=cdk_ffi.CurrencyUnit.SAT(),
|
|
|
|
|
+ active=True,
|
|
|
|
|
+ input_fee_ppk=0
|
|
|
|
|
+ )
|
|
|
|
|
+ await tx.add_mint_keysets(mint_url1, [keyset_info])
|
|
|
|
|
+ await tx.increment_keyset_counter(keyset_id, 42)
|
|
|
|
|
+ print("✓ Performed multiple operations")
|
|
|
|
|
|
|
|
- # Test removing a mint
|
|
|
|
|
- tx = await db.begin_db_transaction()
|
|
|
|
|
- await tx.remove_mint(mint_url1)
|
|
|
|
|
- await tx.commit()
|
|
|
|
|
- print("✓ Removed mint1")
|
|
|
|
|
|
|
+ # Rollback
|
|
|
|
|
+ await tx.rollback()
|
|
|
|
|
+ print("✓ Rolled back transaction")
|
|
|
|
|
|
|
|
- print("✓ Mint operations completed successfully")
|
|
|
|
|
|
|
+ # Verify nothing persisted
|
|
|
|
|
+ tx_read = await db.begin_db_transaction()
|
|
|
|
|
+ keyset_read = await tx_read.get_keyset_by_id(keyset_id)
|
|
|
|
|
+ await tx_read.rollback()
|
|
|
|
|
+ assert keyset_read is None, "Keyset should not exist after rollback"
|
|
|
|
|
+ print("✓ Nothing persisted after rollback")
|
|
|
|
|
|
|
|
- print("✓ Test passed: Wallet mint operations work correctly")
|
|
|
|
|
|
|
+ # Now commit
|
|
|
|
|
+ tx2 = await db.begin_db_transaction()
|
|
|
|
|
+ await tx2.add_mint(mint_url1, None)
|
|
|
|
|
+ await tx2.add_mint(mint_url2, None)
|
|
|
|
|
+ await tx2.add_mint_keysets(mint_url1, [keyset_info])
|
|
|
|
|
+ await tx2.increment_keyset_counter(keyset_id, 42)
|
|
|
|
|
+ await tx2.commit()
|
|
|
|
|
+ print("✓ Committed transaction")
|
|
|
|
|
+
|
|
|
|
|
+ # Verify persistence
|
|
|
|
|
+ tx_verify = await db.begin_db_transaction()
|
|
|
|
|
+ keyset_after = await tx_verify.get_keyset_by_id(keyset_id)
|
|
|
|
|
+ assert keyset_after is not None, "Keyset should exist after commit"
|
|
|
|
|
+ counter_after = await tx_verify.increment_keyset_counter(keyset_id, 0)
|
|
|
|
|
+ await tx_verify.rollback()
|
|
|
|
|
+ assert counter_after == 42, f"Expected counter 42, got {counter_after}"
|
|
|
|
|
+ print("✓ All operations persisted after commit")
|
|
|
|
|
+
|
|
|
|
|
+ print("✓ Test passed: Transaction atomicity works")
|
|
|
|
|
+
|
|
|
|
|
+ finally:
|
|
|
|
|
+ if os.path.exists(db_path):
|
|
|
|
|
+ os.unlink(db_path)
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+# Wallet Tests (using direct wallet methods without explicit transactions)
|
|
|
|
|
+
|
|
|
|
|
+async def test_wallet_creation():
|
|
|
|
|
+ """Test creating a wallet with SQLite backend"""
|
|
|
|
|
+ print("\n=== Test: Wallet Creation ===")
|
|
|
|
|
+
|
|
|
|
|
+ with tempfile.NamedTemporaryFile(suffix=".db", delete=False) as tmp:
|
|
|
|
|
+ db_path = tmp.name
|
|
|
|
|
+
|
|
|
|
|
+ try:
|
|
|
|
|
+ backend = cdk_ffi.WalletDbBackend.SQLITE(path=db_path)
|
|
|
|
|
+ db = cdk_ffi.create_wallet_db(backend)
|
|
|
|
|
+ print("✓ Wallet database created")
|
|
|
|
|
+
|
|
|
|
|
+ # Verify database is accessible
|
|
|
|
|
+ mint_quotes = await db.get_mint_quotes()
|
|
|
|
|
+ assert isinstance(mint_quotes, list), "get_mint_quotes should return a list"
|
|
|
|
|
+ print("✓ Wallet database accessible")
|
|
|
|
|
+
|
|
|
|
|
+ print("✓ Test passed: Wallet creation works")
|
|
|
|
|
|
|
|
finally:
|
|
finally:
|
|
|
if os.path.exists(db_path):
|
|
if os.path.exists(db_path):
|
|
|
os.unlink(db_path)
|
|
os.unlink(db_path)
|
|
|
|
|
|
|
|
|
|
|
|
|
-async def test_wallet_proof_operations():
|
|
|
|
|
- """Test adding and querying proofs with transactions"""
|
|
|
|
|
- print("\n=== Test: Wallet Proof Operations ===")
|
|
|
|
|
|
|
+async def test_wallet_mint_management():
|
|
|
|
|
+ """Test adding and querying mints"""
|
|
|
|
|
+ print("\n=== Test: Wallet Mint Management ===")
|
|
|
|
|
|
|
|
with tempfile.NamedTemporaryFile(suffix=".db", delete=False) as tmp:
|
|
with tempfile.NamedTemporaryFile(suffix=".db", delete=False) as tmp:
|
|
|
db_path = tmp.name
|
|
db_path = tmp.name
|
|
@@ -359,35 +393,38 @@ async def test_wallet_proof_operations():
|
|
|
db = cdk_ffi.create_wallet_db(backend)
|
|
db = cdk_ffi.create_wallet_db(backend)
|
|
|
|
|
|
|
|
mint_url = cdk_ffi.MintUrl(url="https://testmint.example.com")
|
|
mint_url = cdk_ffi.MintUrl(url="https://testmint.example.com")
|
|
|
- keyset_id = cdk_ffi.Id(hex="004146bdf4a9afab")
|
|
|
|
|
|
|
|
|
|
- # Setup mint and keyset
|
|
|
|
|
|
|
+ # Add mint (using transaction)
|
|
|
tx = await db.begin_db_transaction()
|
|
tx = await db.begin_db_transaction()
|
|
|
await tx.add_mint(mint_url, None)
|
|
await tx.add_mint(mint_url, None)
|
|
|
- keyset_info = cdk_ffi.KeySetInfo(
|
|
|
|
|
- id=keyset_id.hex,
|
|
|
|
|
- unit=cdk_ffi.CurrencyUnit.SAT(),
|
|
|
|
|
- active=True,
|
|
|
|
|
- input_fee_ppk=0
|
|
|
|
|
- )
|
|
|
|
|
- await tx.add_mint_keysets(mint_url, [keyset_info])
|
|
|
|
|
await tx.commit()
|
|
await tx.commit()
|
|
|
- print("✓ Setup mint and keyset")
|
|
|
|
|
|
|
+ print("✓ Added mint to wallet")
|
|
|
|
|
+
|
|
|
|
|
+ # Get specific mint (read-only, can use db directly)
|
|
|
|
|
+ await db.get_mint(mint_url)
|
|
|
|
|
+ print("✓ Retrieved mint from database")
|
|
|
|
|
+
|
|
|
|
|
+ # Remove mint (using transaction)
|
|
|
|
|
+ tx = await db.begin_db_transaction()
|
|
|
|
|
+ await tx.remove_mint(mint_url)
|
|
|
|
|
+ await tx.commit()
|
|
|
|
|
+ print("✓ Removed mint from wallet")
|
|
|
|
|
|
|
|
- # Proof operations are complex and require proper key generation
|
|
|
|
|
- # This would require implementing PublicKey API properly
|
|
|
|
|
- print("✓ Proof operations (basic test - complex operations require proper FFI key API)")
|
|
|
|
|
|
|
+ # Verify removal
|
|
|
|
|
+ mint_info_after = await db.get_mint(mint_url)
|
|
|
|
|
+ assert mint_info_after is None, "Mint should be removed"
|
|
|
|
|
+ print("✓ Verified mint removal")
|
|
|
|
|
|
|
|
- print("✓ Test passed: Wallet proof operations work correctly")
|
|
|
|
|
|
|
+ print("✓ Test passed: Mint management works")
|
|
|
|
|
|
|
|
finally:
|
|
finally:
|
|
|
if os.path.exists(db_path):
|
|
if os.path.exists(db_path):
|
|
|
os.unlink(db_path)
|
|
os.unlink(db_path)
|
|
|
|
|
|
|
|
|
|
|
|
|
-async def test_wallet_quote_operations():
|
|
|
|
|
- """Test mint and melt quote operations with transactions"""
|
|
|
|
|
- print("\n=== Test: Wallet Quote Operations ===")
|
|
|
|
|
|
|
+async def test_wallet_keyset_management():
|
|
|
|
|
+ """Test adding and querying keysets"""
|
|
|
|
|
+ print("\n=== Test: Wallet Keyset Management ===")
|
|
|
|
|
|
|
|
with tempfile.NamedTemporaryFile(suffix=".db", delete=False) as tmp:
|
|
with tempfile.NamedTemporaryFile(suffix=".db", delete=False) as tmp:
|
|
|
db_path = tmp.name
|
|
db_path = tmp.name
|
|
@@ -397,26 +434,42 @@ async def test_wallet_quote_operations():
|
|
|
db = cdk_ffi.create_wallet_db(backend)
|
|
db = cdk_ffi.create_wallet_db(backend)
|
|
|
|
|
|
|
|
mint_url = cdk_ffi.MintUrl(url="https://testmint.example.com")
|
|
mint_url = cdk_ffi.MintUrl(url="https://testmint.example.com")
|
|
|
|
|
+ keyset_id = cdk_ffi.Id(hex="004146bdf4a9afab")
|
|
|
|
|
|
|
|
- # Setup mint
|
|
|
|
|
|
|
+ # Add mint and keyset (using transaction)
|
|
|
tx = await db.begin_db_transaction()
|
|
tx = await db.begin_db_transaction()
|
|
|
await tx.add_mint(mint_url, None)
|
|
await tx.add_mint(mint_url, None)
|
|
|
|
|
+ keyset_info = cdk_ffi.KeySetInfo(
|
|
|
|
|
+ id=keyset_id.hex,
|
|
|
|
|
+ unit=cdk_ffi.CurrencyUnit.SAT(),
|
|
|
|
|
+ active=True,
|
|
|
|
|
+ input_fee_ppk=0
|
|
|
|
|
+ )
|
|
|
|
|
+ await tx.add_mint_keysets(mint_url, [keyset_info])
|
|
|
await tx.commit()
|
|
await tx.commit()
|
|
|
|
|
+ print("✓ Added mint and keyset")
|
|
|
|
|
+
|
|
|
|
|
+ # Query keyset by ID (read-only)
|
|
|
|
|
+ keyset = await db.get_keyset_by_id(keyset_id)
|
|
|
|
|
+ assert keyset is not None, "Keyset should exist"
|
|
|
|
|
+ assert keyset.id == keyset_id.hex, "Keyset ID should match"
|
|
|
|
|
+ print(f"✓ Retrieved keyset: {keyset.id}")
|
|
|
|
|
|
|
|
- # Quote operations require proper QuoteState enum construction
|
|
|
|
|
- # which varies by FFI implementation
|
|
|
|
|
- print("✓ Quote operations (basic test - requires proper QuoteState API)")
|
|
|
|
|
|
|
+ # Query keysets for mint (read-only)
|
|
|
|
|
+ keysets = await db.get_mint_keysets(mint_url)
|
|
|
|
|
+ assert keysets is not None and len(keysets) > 0, "Should have keysets for mint"
|
|
|
|
|
+ print(f"✓ Retrieved {len(keysets)} keyset(s) for mint")
|
|
|
|
|
|
|
|
- print("✓ Test passed: Wallet quote operations work correctly")
|
|
|
|
|
|
|
+ print("✓ Test passed: Keyset management works")
|
|
|
|
|
|
|
|
finally:
|
|
finally:
|
|
|
if os.path.exists(db_path):
|
|
if os.path.exists(db_path):
|
|
|
os.unlink(db_path)
|
|
os.unlink(db_path)
|
|
|
|
|
|
|
|
|
|
|
|
|
-async def test_wallet_balance_query():
|
|
|
|
|
- """Test querying wallet balance with different proof states"""
|
|
|
|
|
- print("\n=== Test: Wallet Balance Query ===")
|
|
|
|
|
|
|
+async def test_wallet_keyset_counter():
|
|
|
|
|
+ """Test keyset counter operations"""
|
|
|
|
|
+ print("\n=== Test: Wallet Keyset Counter ===")
|
|
|
|
|
|
|
|
with tempfile.NamedTemporaryFile(suffix=".db", delete=False) as tmp:
|
|
with tempfile.NamedTemporaryFile(suffix=".db", delete=False) as tmp:
|
|
|
db_path = tmp.name
|
|
db_path = tmp.name
|
|
@@ -428,7 +481,7 @@ async def test_wallet_balance_query():
|
|
|
mint_url = cdk_ffi.MintUrl(url="https://testmint.example.com")
|
|
mint_url = cdk_ffi.MintUrl(url="https://testmint.example.com")
|
|
|
keyset_id = cdk_ffi.Id(hex="004146bdf4a9afab")
|
|
keyset_id = cdk_ffi.Id(hex="004146bdf4a9afab")
|
|
|
|
|
|
|
|
- # Setup
|
|
|
|
|
|
|
+ # Setup (using transaction)
|
|
|
tx = await db.begin_db_transaction()
|
|
tx = await db.begin_db_transaction()
|
|
|
await tx.add_mint(mint_url, None)
|
|
await tx.add_mint(mint_url, None)
|
|
|
keyset_info = cdk_ffi.KeySetInfo(
|
|
keyset_info = cdk_ffi.KeySetInfo(
|
|
@@ -439,21 +492,32 @@ async def test_wallet_balance_query():
|
|
|
)
|
|
)
|
|
|
await tx.add_mint_keysets(mint_url, [keyset_info])
|
|
await tx.add_mint_keysets(mint_url, [keyset_info])
|
|
|
await tx.commit()
|
|
await tx.commit()
|
|
|
|
|
+ print("✓ Setup complete")
|
|
|
|
|
|
|
|
- # Balance query requires proper proof creation with PublicKey
|
|
|
|
|
- # which needs proper FFI key generation API
|
|
|
|
|
- print("✓ Balance query (basic test - requires proper PublicKey API for proof creation)")
|
|
|
|
|
|
|
+ # Increment counter (using transaction)
|
|
|
|
|
+ tx = await db.begin_db_transaction()
|
|
|
|
|
+ counter1 = await tx.increment_keyset_counter(keyset_id, 1)
|
|
|
|
|
+ counter2 = await tx.increment_keyset_counter(keyset_id, 5)
|
|
|
|
|
+ counter3 = await tx.increment_keyset_counter(keyset_id, 0)
|
|
|
|
|
+ await tx.commit()
|
|
|
|
|
|
|
|
- print("✓ Test passed: Wallet balance query works correctly")
|
|
|
|
|
|
|
+ print(f"✓ Counter after +1: {counter1}")
|
|
|
|
|
+ assert counter1 == 1, f"Expected counter 1, got {counter1}"
|
|
|
|
|
+ print(f"✓ Counter after +5: {counter2}")
|
|
|
|
|
+ assert counter2 == 6, f"Expected counter 6, got {counter2}"
|
|
|
|
|
+ print(f"✓ Current counter: {counter3}")
|
|
|
|
|
+ assert counter3 == 6, f"Expected counter 6, got {counter3}"
|
|
|
|
|
+
|
|
|
|
|
+ print("✓ Test passed: Keyset counter works")
|
|
|
|
|
|
|
|
finally:
|
|
finally:
|
|
|
if os.path.exists(db_path):
|
|
if os.path.exists(db_path):
|
|
|
os.unlink(db_path)
|
|
os.unlink(db_path)
|
|
|
|
|
|
|
|
|
|
|
|
|
-async def test_wallet_transaction_atomicity():
|
|
|
|
|
- """Test that transaction rollback properly reverts all changes"""
|
|
|
|
|
- print("\n=== Test: Wallet Transaction Atomicity ===")
|
|
|
|
|
|
|
+async def test_wallet_quotes():
|
|
|
|
|
+ """Test mint and melt quote operations"""
|
|
|
|
|
+ print("\n=== Test: Wallet Quote Operations ===")
|
|
|
|
|
|
|
|
with tempfile.NamedTemporaryFile(suffix=".db", delete=False) as tmp:
|
|
with tempfile.NamedTemporaryFile(suffix=".db", delete=False) as tmp:
|
|
|
db_path = tmp.name
|
|
db_path = tmp.name
|
|
@@ -462,66 +526,47 @@ async def test_wallet_transaction_atomicity():
|
|
|
backend = cdk_ffi.WalletDbBackend.SQLITE(path=db_path)
|
|
backend = cdk_ffi.WalletDbBackend.SQLITE(path=db_path)
|
|
|
db = cdk_ffi.create_wallet_db(backend)
|
|
db = cdk_ffi.create_wallet_db(backend)
|
|
|
|
|
|
|
|
- mint_url1 = cdk_ffi.MintUrl(url="https://mint1.example.com")
|
|
|
|
|
- mint_url2 = cdk_ffi.MintUrl(url="https://mint2.example.com")
|
|
|
|
|
- keyset_id = cdk_ffi.Id(hex="004146bdf4a9afab")
|
|
|
|
|
|
|
+ mint_url = cdk_ffi.MintUrl(url="https://testmint.example.com")
|
|
|
|
|
|
|
|
- # Start a transaction with multiple operations
|
|
|
|
|
|
|
+ # Add mint (using transaction)
|
|
|
tx = await db.begin_db_transaction()
|
|
tx = await db.begin_db_transaction()
|
|
|
|
|
+ await tx.add_mint(mint_url, None)
|
|
|
|
|
+ await tx.commit()
|
|
|
|
|
+ print("✓ Added mint")
|
|
|
|
|
|
|
|
- # Add mints
|
|
|
|
|
- await tx.add_mint(mint_url1, None)
|
|
|
|
|
- await tx.add_mint(mint_url2, None)
|
|
|
|
|
|
|
+ # Query quotes (read-only)
|
|
|
|
|
+ mint_quotes = await db.get_mint_quotes()
|
|
|
|
|
+ assert isinstance(mint_quotes, list), "get_mint_quotes should return a list"
|
|
|
|
|
+ print(f"✓ Retrieved {len(mint_quotes)} mint quote(s)")
|
|
|
|
|
|
|
|
- # Add keyset
|
|
|
|
|
- keyset_info = cdk_ffi.KeySetInfo(
|
|
|
|
|
- id=keyset_id.hex,
|
|
|
|
|
- unit=cdk_ffi.CurrencyUnit.SAT(),
|
|
|
|
|
- active=True,
|
|
|
|
|
- input_fee_ppk=0
|
|
|
|
|
- )
|
|
|
|
|
- await tx.add_mint_keysets(mint_url1, [keyset_info])
|
|
|
|
|
|
|
+ melt_quotes = await db.get_melt_quotes()
|
|
|
|
|
+ assert isinstance(melt_quotes, list), "get_melt_quotes should return a list"
|
|
|
|
|
+ print(f"✓ Retrieved {len(melt_quotes)} melt quote(s)")
|
|
|
|
|
|
|
|
- # Increment counter
|
|
|
|
|
- await tx.increment_keyset_counter(keyset_id, 42)
|
|
|
|
|
|
|
+ print("✓ Test passed: Quote operations work")
|
|
|
|
|
|
|
|
- print("✓ Performed multiple operations in transaction")
|
|
|
|
|
|
|
+ finally:
|
|
|
|
|
+ if os.path.exists(db_path):
|
|
|
|
|
+ os.unlink(db_path)
|
|
|
|
|
|
|
|
- # Rollback instead of commit
|
|
|
|
|
- await tx.rollback()
|
|
|
|
|
- print("✓ Rolled back transaction")
|
|
|
|
|
|
|
|
|
|
- # Verify nothing was persisted
|
|
|
|
|
- mints = await db.get_mints()
|
|
|
|
|
- assert len(mints) == 0, f"Expected 0 mints after rollback, got {len(mints)}"
|
|
|
|
|
- print("✓ Mints were not persisted")
|
|
|
|
|
|
|
+async def test_wallet_proofs_by_ys():
|
|
|
|
|
+ """Test retrieving proofs by Y values"""
|
|
|
|
|
+ print("\n=== Test: Wallet Get Proofs by Y Values ===")
|
|
|
|
|
|
|
|
- # Try to read keyset (should not exist)
|
|
|
|
|
- tx_read = await db.begin_db_transaction()
|
|
|
|
|
- keyset_read = await tx_read.get_keyset_by_id(keyset_id)
|
|
|
|
|
- await tx_read.rollback()
|
|
|
|
|
- assert keyset_read is None, "Keyset should not exist after rollback"
|
|
|
|
|
- print("✓ Keyset was not persisted")
|
|
|
|
|
|
|
+ with tempfile.NamedTemporaryFile(suffix=".db", delete=False) as tmp:
|
|
|
|
|
+ db_path = tmp.name
|
|
|
|
|
|
|
|
- # Now commit the same operations
|
|
|
|
|
- tx2 = await db.begin_db_transaction()
|
|
|
|
|
- await tx2.add_mint(mint_url1, None)
|
|
|
|
|
- await tx2.add_mint(mint_url2, None)
|
|
|
|
|
- await tx2.add_mint_keysets(mint_url1, [keyset_info])
|
|
|
|
|
- await tx2.increment_keyset_counter(keyset_id, 42)
|
|
|
|
|
- await tx2.commit()
|
|
|
|
|
- print("✓ Committed transaction with same operations")
|
|
|
|
|
|
|
+ try:
|
|
|
|
|
+ backend = cdk_ffi.WalletDbBackend.SQLITE(path=db_path)
|
|
|
|
|
+ db = cdk_ffi.create_wallet_db(backend)
|
|
|
|
|
|
|
|
- # Verify keyset and counter were persisted
|
|
|
|
|
- tx_verify = await db.begin_db_transaction()
|
|
|
|
|
- keyset_after = await tx_verify.get_keyset_by_id(keyset_id)
|
|
|
|
|
- assert keyset_after is not None, "Keyset should exist after commit"
|
|
|
|
|
- counter_after = await tx_verify.increment_keyset_counter(keyset_id, 0)
|
|
|
|
|
- await tx_verify.rollback()
|
|
|
|
|
- assert counter_after == 42, f"Expected counter 42, got {counter_after}"
|
|
|
|
|
|
|
+ # Test with empty list
|
|
|
|
|
+ proofs = await db.get_proofs_by_ys([])
|
|
|
|
|
+ assert len(proofs) == 0, f"Expected 0 proofs, got {len(proofs)}"
|
|
|
|
|
+ print("✓ get_proofs_by_ys returns empty for empty input")
|
|
|
|
|
|
|
|
- print("✓ All operations persisted after commit (mints query skipped due to API complexity)")
|
|
|
|
|
- print("✓ Test passed: Transaction atomicity works correctly")
|
|
|
|
|
|
|
+ print("✓ Test passed: get_proofs_by_ys works")
|
|
|
|
|
|
|
|
finally:
|
|
finally:
|
|
|
if os.path.exists(db_path):
|
|
if os.path.exists(db_path):
|
|
@@ -530,20 +575,24 @@ async def test_wallet_transaction_atomicity():
|
|
|
|
|
|
|
|
async def main():
|
|
async def main():
|
|
|
"""Run all tests"""
|
|
"""Run all tests"""
|
|
|
- print("Starting CDK FFI Transaction Tests")
|
|
|
|
|
|
|
+ print("Starting CDK FFI Wallet and Transaction Tests")
|
|
|
print("=" * 50)
|
|
print("=" * 50)
|
|
|
|
|
|
|
|
tests = [
|
|
tests = [
|
|
|
|
|
+ # Transaction tests
|
|
|
("Increment Counter with Commit", test_increment_keyset_counter_commit),
|
|
("Increment Counter with Commit", test_increment_keyset_counter_commit),
|
|
|
("Implicit Rollback on Drop", test_implicit_rollback_on_drop),
|
|
("Implicit Rollback on Drop", test_implicit_rollback_on_drop),
|
|
|
("Explicit Rollback", test_explicit_rollback),
|
|
("Explicit Rollback", test_explicit_rollback),
|
|
|
("Transaction Reads", test_transaction_reads),
|
|
("Transaction Reads", test_transaction_reads),
|
|
|
("Multiple Increments", test_multiple_increments_same_transaction),
|
|
("Multiple Increments", test_multiple_increments_same_transaction),
|
|
|
- ("Wallet Mint Operations", test_wallet_mint_operations),
|
|
|
|
|
- ("Wallet Proof Operations", test_wallet_proof_operations),
|
|
|
|
|
- ("Wallet Quote Operations", test_wallet_quote_operations),
|
|
|
|
|
- ("Wallet Balance Query", test_wallet_balance_query),
|
|
|
|
|
- ("Wallet Transaction Atomicity", test_wallet_transaction_atomicity),
|
|
|
|
|
|
|
+ ("Transaction Atomicity", test_transaction_atomicity),
|
|
|
|
|
+ # Wallet tests (read methods + write via transactions)
|
|
|
|
|
+ ("Wallet Creation", test_wallet_creation),
|
|
|
|
|
+ ("Wallet Mint Management", test_wallet_mint_management),
|
|
|
|
|
+ ("Wallet Keyset Management", test_wallet_keyset_management),
|
|
|
|
|
+ ("Wallet Keyset Counter", test_wallet_keyset_counter),
|
|
|
|
|
+ ("Wallet Quote Operations", test_wallet_quotes),
|
|
|
|
|
+ ("Wallet Get Proofs by Y Values", test_wallet_proofs_by_ys),
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
passed = 0
|
|
passed = 0
|