fix(lending): RepaymentEvent TryFromVal E0277 — drop conflicting PartialEq derive (#597) - #723
Merged
likableai merged 1 commit intoSep 1, 2026
Conversation
…Pi-Defi-world#597) RepaymentEvent had #[derive(PartialEq)] alongside #[contracttype]. The contracttype proc-macro generates TryFromVal<Env, Self> for the struct; adding a manual PartialEq derive on a struct containing an Address field in a no_std context conflicts with that generated impl, preventing the compiler from satisfying the Val: TryFromVal bound required by env.events().publish() — E0277. Fix: drop PartialEq from RepaymentEvent's derive list, matching every other event struct in the contract that contains an Address field (BorrowEvent, RepayEvent, LoanCreatedEvent, LoanRepaidEvent, etc.). Tests in acbu_lending_pool/tests/test.rs are unaffected: they compare individual Address and i128 fields, not RepaymentEvent itself. Acceptance: acbu_lending_pool compiles without E0277.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@albatrossxXx 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! 🚀 |
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.
Summary
Fixes #597 —
RepaymentEventfailsVal: TryFromVal(E0277), preventing the repayment event from being published.Root cause
RepaymentEventwas decorated with both#[contracttype]and#[derive(PartialEq)]. The#[contracttype]proc-macro generates theTryFromVal<Env, Self>impl Soroban requires forenv.events().publish(). Adding#[derive(PartialEq)]on a struct that contains anAddressfield in a#[no_std]context conflicts with the macro-generated code, causing the compiler to fail with:Fix
Removed
PartialEqfrom the#[derive(...)]onRepaymentEvent:This matches the established pattern for every other event struct containing an
Addressfield in this contract (BorrowEvent,RepayEvent,LoanCreatedEvent,LoanRepaidEvent) and across the codebase (MintEvent,BurnEvent, etc. inshared/src/lib.rs).Impact
acbu_lending_pool/tests/test.rsare unaffected: they compare individualAddressandi128fields, notRepaymentEventitself.Acceptance criterion
acbu_lending_poolcompiles without E0277. Repayment event publishes successfully.closes #597