Skip to content

Add tests for referral stats, distribution contract, price oracle + SDK types - #570

Merged
Levi-Ojukwu merged 2 commits into
Invoice-Liquidity-Network:mainfrom
cristianooR7:add-tests-referral-distribution-oracle-and-sdk-types
Jul 28, 2026
Merged

Add tests for referral stats, distribution contract, price oracle + SDK types#570
Levi-Ojukwu merged 2 commits into
Invoice-Liquidity-Network:mainfrom
cristianooR7:add-tests-referral-distribution-oracle-and-sdk-types

Conversation

@cristianooR7

@cristianooR7 cristianooR7 commented Jul 25, 2026

Copy link
Copy Markdown

Resolves
Closes #492
Closes #493
Closes #494
Closes #564

  • Adds tests_referral.rs coverage: increment on submission, 0 for unknown code, batch submission counting
  • Adds tests_distribution.rs coverage: set_distribution_contract auth checks, notify_distribution_funding called during funding
  • Adds tests_new_features.rs coverage: get/set_price_oracle including admin-only enforcement
  • Adds missing SDK TypeScript types to sdk/src/types.ts

Note: fixed two pre-existing compile errors found while adding these tests (ReferralCode type mismatch in tests_referral.rs, wrong initialize/submit_invoice arity in tests_distribution.rs).

- tests_referral.rs: referral count increments on submission, returns 0
  for unknown codes, and batch submissions count referrals correctly
  (also fixes an existing type error: ReferralCode::Present(..) instead
  of Some(..))
- tests_distribution.rs: set_distribution_contract as admin, rejects
  non-admin, notify_distribution_funding invoked during fund_invoice
  (also fixes broken initialize/submit_invoice call arity)
- tests_new_features.rs: get_price_oracle defaults to None, set_price_oracle
  succeeds as admin and is reflected in get_price_oracle, rejects non-admin
- sdk/src/types.ts: add TypeScript types for InvoiceNftMetadata,
  LpFundRequest, AppealRecord, DisputeRecord, TopPayerEntry,
  ReputationProfile, ContractStats

Resolves Invoice-Liquidity-Network#492, Invoice-Liquidity-Network#493, Invoice-Liquidity-Network#494, Invoice-Liquidity-Network#564
@drips-wave

drips-wave Bot commented Jul 25, 2026

Copy link
Copy Markdown

@cristianooR7 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! 🚀

Learn more about application limits

…dk-types, preserving new invoice liquidity referral/distribution tests
@Levi-Ojukwu
Levi-Ojukwu merged commit ee383d8 into Invoice-Liquidity-Network:main Jul 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants