Skip to content

Feat/indexer multi contract events#517

Open
mijinummi wants to merge 2 commits intoLabsCrypt:mainfrom
mijinummi:feat/indexer-multi-contract-events
Open

Feat/indexer multi contract events#517
mijinummi wants to merge 2 commits intoLabsCrypt:mainfrom
mijinummi:feat/indexer-multi-contract-events

Conversation

@mijinummi
Copy link
Copy Markdown

📝 Description

Overview

This PR extends the event indexer to subscribe to LendingPool, RemittanceNFT, and MultisigGovernance contract events.

Key Features

  • LendingPool: Deposit, Withdraw, EmergencyWithdraw
  • RemittanceNFT: ScoreUpdated, NFTSeized, NFTBurned, NFTMinted
  • MultisigGovernance: ProposalCreated, ProposalApproved, ProposalFinalized
  • Events stored in dedicated DB tables
  • Dashboard, borrower history, and governance transparency enabled

Closes #437

@ogazboiz
Copy link
Copy Markdown
Contributor

The contracts CI is failing on the rustfmt format check. This isn't a logic issue, just formatting.

Run this in the contracts directory and push:

cd contracts
cargo fmt

Then commit and push the formatting changes. The CI should pass after that.

@ogazboiz
Copy link
Copy Markdown
Contributor

Backend CI is failing with a Jest environment error:

ReferenceError: You are trying to `import` a file after the Jest environment has been torn down.

This usually means a test file has async operations that outlive the test suite — either missing await on async teardown, or an import that fires a side effect (like a Redis/DB connection) after the test runner has already cleaned up.

To fix: check if any test files in your PR have async operations in top-level scope without proper beforeAll/afterAll cleanup. Also make sure any mocks for Redis or DB are set up before the app module is imported.

Contracts CI is also failing on cargo fmt. Run cargo fmt in the contracts/ directory and push the formatting changes.

Copy link
Copy Markdown
Contributor

@ogazboiz ogazboiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two failures to fix:

Contracts CI: Failing under 30s, which is a cargo fmt issue.

cd contracts
cargo fmt

Backend CI: eventIndexer.test.ts failure. Rebase on main to pick up the recent test fix:

git fetch upstream
git rebase upstream/main

Commit, format, and push when done.

@ogazboiz
Copy link
Copy Markdown
Contributor

The codebase issues on main have been resolved and all CI checks are passing now. Please rebase your branch to pull in the latest changes before continuing. Thanks for your patience.

Copy link
Copy Markdown
Contributor

@ogazboiz ogazboiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has merge conflicts. Imports use bare module paths without .js extensions (inconsistent with ESM codebase). Every handler uses event: any with no validation. No migration files included for the ~9 new tables referenced. The Rust code appends a second impl block which won't compile. Needs significant rework.

@ogazboiz
Copy link
Copy Markdown
Contributor

heads up, a few important changes just landed on main that affect your PR:

  1. axios pinned to 1.13.5 - there's an active supply chain attack on axios 1.14.1 (pulls in confirmed malware). we added overrides in all package.json files to block it.

  2. CI now runs a supply chain audit before backend/frontend jobs. if your lockfile has a compromised package, CI will fail with a clear error.

  3. backend test fixes - loanEndpoints tests now use valid Stellar addresses and base64 strings. if your PR was failing backend CI but you didn't touch backend code, this should fix it after rebase.

please rebase on latest main:

git fetch upstream
git rebase upstream/main
git push --force-with-lease

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.

feat(backend): index LendingPool, RemittanceNFT and MultisigGovernance events in event indexer

2 participants