Join our community: https://t.me/+DOylgFv1jyJlNzM0
Description
The decodeU64, decodeI128, decodeAddress, decodeMap helpers and all event handlers in the event worker have no tests. A subtle decoding bug would silently corrupt all indexed stream data.
Test Cases Needed
test_decodeU64_max_value
test_decodeI128_positive, test_decodeI128_negative, test_decodeI128_max_i128
test_decodeAddress_g_address (account key)
test_decodeAddress_c_address (contract ID)
test_handleStreamCreated_writes_correct_db_record (mock Prisma)
test_handleStreamToppedUp_updates_deposited_amount
test_handleStreamCancelled_sets_inactive
test_handleStreamPaused_sets_isPaused (once handlers added)
test_unknown_event_type_silently_ignored
Files
backend/tests/soroban-event-worker.test.ts (create)
Acceptance Criteria
Description
The
decodeU64,decodeI128,decodeAddress,decodeMaphelpers and all event handlers in the event worker have no tests. A subtle decoding bug would silently corrupt all indexed stream data.Test Cases Needed
test_decodeU64_max_valuetest_decodeI128_positive,test_decodeI128_negative,test_decodeI128_max_i128test_decodeAddress_g_address(account key)test_decodeAddress_c_address(contract ID)test_handleStreamCreated_writes_correct_db_record(mock Prisma)test_handleStreamToppedUp_updates_deposited_amounttest_handleStreamCancelled_sets_inactivetest_handleStreamPaused_sets_isPaused(once handlers added)test_unknown_event_type_silently_ignoredFiles
backend/tests/soroban-event-worker.test.ts(create)Acceptance Criteria
npm test