test(invoice): write full lifecycle integration test for invoice_contract#89
Open
teeschima wants to merge 3 commits into
Open
test(invoice): write full lifecycle integration test for invoice_contract#89teeschima wants to merge 3 commits into
teeschima wants to merge 3 commits into
Conversation
Add missing tests for all error branches in registry_contract: - test_register_buyer_duplicate: AlreadyRegistered error (TrusTrove#2) - test_get_admin_not_found: NotFound error (TrusTrove#3) - test_revoke_admin_not_found: NotFound error (TrusTrove#3) - test_revoke_nonexistent_profile: NotFound error (TrusTrove#3) - test_revoke_not_authorized: NotAuthorized error (TrusTrove#4) - test_batch_register_issuers_no_admin: NotFound error (TrusTrove#3) Closes TrusTrove#4
Add complete end-to-end integration test deploying all four contracts (registry, invoice, escrow, pool) and exercising the full invoice lifecycle: - Deploy and wire all contracts with real implementations - Register issuer and buyer on registry - Create invoice, list for financing, fund via pool - Mark as shipped, confirm delivery (both parties) - Repay and assert final status == Repaid - Assert pool yield increased after repayment Adds trusttrove-registry, trusttrove-escrow, trusttrove-pool as dev-dependencies for the invoice crate. Closes TrusTrove#7
|
@teeschima Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
Author
|
done boss |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7
Summary
Adds a complete end-to-end integration test that exercises the full invoice lifecycle using real (not mocked) implementations of all four contracts.
Test Flow
CreatedListedFunded, pool stats updatedActiveConfirmedRepaidtotal_yield_distributedand LP position reflect the discount spread)Changes
contracts/invoice/Cargo.toml: Addtrusttrove-registry,trusttrove-escrow,trusttrove-poolas dev-dependenciescontracts/invoice/src/test.rs: Addtest_full_lifecycle_integrationwith real cross-contract wiringAll 93 tests across all four contracts pass with
cargo test.