Skip to content

Feat/global config for cross contract#206

Open
Anuoluwapo25 wants to merge 14 commits intoRemitwise-Org:mainfrom
Anuoluwapo25:feat/global-config-for-cross-contract
Open

Feat/global config for cross contract#206
Anuoluwapo25 wants to merge 14 commits intoRemitwise-Org:mainfrom
Anuoluwapo25:feat/global-config-for-cross-contract

Conversation

@Anuoluwapo25
Copy link
Contributor

@Anuoluwapo25 Anuoluwapo25 commented Feb 24, 2026

##PR Description:

Implemented a global Config contract to manage shared cross-contract settings (limits, feature flags) with admin-controlled typed key/value storage. Added set_config, get_config, and get_all_keys functions, migrated at least one hard-coded limit to dynamic config, and integrated an existing contract to read from it. Includes tests and admin access enforcement.

closes #151

@Baskarayelu
Copy link
Contributor

resolve the conflicts

@Anuoluwapo25
Copy link
Contributor Author

@Baskarayelu done

@Baskarayelu
Copy link
Contributor

@Anuoluwapo25 fix the pipeline

Anuoluwapo25 and others added 8 commits February 25, 2026 11:28
Three corrupted `/// # Arguments/Returns/Example` doc-comment headers in
bill_payments/src/lib.rs had `#[contractclient(...)]` attribute text
accidentally inserted outside the `///` prefix, causing parse errors.

Also removes duplicate `#[allow(clippy::too_many_arguments)]` attributes
(bill_payments, remittance_split) and adds the new `currency` parameter to
all `create_bill` calls in the stress and config integration test files.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
- insurance: replace #[should_panic(expected = "Policy is not active")] with
  try_pay_premium assertion now that pay_premium returns InsuranceError
- remittance_split/src/test.rs: fix 9 tests that had wrong initialize_split
  args (all used 50/30/15/5 template instead of their actual boundary values:
  33/33/33/1, 17/19/23/41, 100/0/0/0, 0/100/0/0, 0/0/100/0, 0/0/0/100,
  25/25/25/25); fix update_split nonce (stays at 1, not incremented)
- reporting: update BillPaymentsTrait and InsuranceTrait to match paginated
  signatures (get_unpaid_bills/get_active_policies now take cursor+limit and
  return BillPage/PolicyPage); add BillPage and PolicyPage structs; update
  get_bill_compliance_report to use get_unpaid_bills (avoids owner.require_auth
  in cross-contract call); fix mock impls in tests.rs to match new traits
- reporting: fix two #[should_panic(expected = "...")] tests with stale strings
- ci.yml: trigger on all branches (push: "**") and all pull_requests, not
  just main, so CI runs on every feature branch

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@Baskarayelu
Copy link
Contributor

please resolve the conflicts

@Anuoluwapo25
Copy link
Contributor Author

@Baskarayelu done ...I have fixed the pipeline many times

I only fix the conflicts on here and i got failed checks again

- Remove duplicate #[allow(clippy::too_many_arguments)] in remittance_split/src/lib.rs
- Remove unused testutils::Address import in reporting/src/tests.rs
- Replace std vec! macro with array literal in savings_goals stress tests
- Add missing currency arg to all create_bill calls in bill_payments stress tests
- Add missing before_timestamp arg to archive_paid_bills call
- Rewrite remittance_split stress tests: use calculate_split (non-try) for happy path,
  try_calculate_split only for error path, manual Vec sum helper

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@Baskarayelu
Copy link
Contributor

@Anuoluwapo25 Can you please resolve the conflicts?

@Anuoluwapo25
Copy link
Contributor Author

@Baskarayelu done

@Anuoluwapo25
Copy link
Contributor Author

@Baskarayelu I have fixed the conflit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Global Config Contract for Cross-Contract Settings

2 participants