Skip to content

fix(maintenance-pool): emit PoolCreated on first deposit; fix get_deposit pool-existence check - #916

Merged
chonilius merged 2 commits into
MergeFi:mainfrom
codemagician1949:feat/pool-created-event-dup-check-819-817-811-822
Nov 21, 2026
Merged

chonilius merged 2 commits into
MergeFi:mainfrom
codemagician1949:feat/pool-created-event-dup-check-819-817-811-822

Conversation

@codemagician1949

@codemagician1949 codemagician1949 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Two bug fixes for maintenance-pool:

1 — Emit PoolCreated on first deposit (#811)

deposit() published the same PoolDeposited event whether it created the pool or topped it up, making it impossible for indexers to distinguish pool creation from subsequent deposits.

Added PoolCreated { pool_id, sponsor, token, created_at } (mirroring MilestoneCreated/MilestoneContributed) and emit it from the None branch of the pool lookup, before PoolDeposited. Existing event consumers are unaffected.

2 — get_deposit returns PoolNotFound for unknown pool (#819)

get_deposit returned DepositNotFound for a non-existent pool_id, pointing clients at the wrong variable. Added a has(DataKey::Pool(pool_id)) check that returns PoolNotFound first, mirroring milestones::get_contribution.

Closes #811
Closes #819


To be completed:
-closes #817
-closes #822

…existence in get_deposit (MergeFi#811, MergeFi#819)

- Add PoolCreated { pool_id, sponsor, token, created_at } event emitted
  from the None branch of the pool lookup in deposit(), so indexers can
  distinguish pool creation from top-ups. Mirrors MilestoneCreated/
  MilestoneContributed pattern.
- get_deposit now checks has(DataKey::Pool(pool_id)) first and returns
  PoolNotFound when the pool does not exist, instead of the misleading
  DepositNotFound. Mirrors milestones::get_contribution.

Closes MergeFi#811
Closes MergeFi#819
@vercel

vercel Bot commented Nov 21, 2026

Copy link
Copy Markdown

@codemagician1949 is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Nov 21, 2026

Copy link
Copy Markdown

@codemagician1949 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

@chonilius
chonilius merged commit 65b7167 into MergeFi:main Nov 21, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment