Skip to content

fix: add sender-aware borrow owner-index lookup and harden route tests#153

Merged
bayological merged 4 commits intomainfrom
fix/borrow-owner-index-and-monad-route-tests
Mar 23, 2026
Merged

fix: add sender-aware borrow owner-index lookup and harden route tests#153
bayological merged 4 commits intomainfrom
fix/borrow-owner-index-and-monad-route-tests

Conversation

@bayological
Copy link
Copy Markdown
Member

@bayological bayological commented Mar 23, 2026

Description

This PR makes borrow owner-index selection sender-aware so opening a trove uses the first unused derived trove id instead of assuming the current Trove NFT balance is always a safe next index. It also avoids unnecessary trove scans for owners with no Trove NFT balance and clarifies zombie trove and Trove NFT ownership behavior in the borrow docs.

It also hardens the Monad and router integration tests by selecting quoteable routes dynamically instead of relying on discovered routes that may not be quoteable on-chain at test time.

Other changes

  • Bump the SDK version to 3.2.0
  • Add getOwnedTroveCount() and findNextAvailableOwnerIndex()
  • Keep getNextOwnerIndex() as a compatibility alias for current owned trove count
  • Update the README and changelog to document the new borrow flow and zombie trove behavior

Tested

  • Added and updated unit coverage for borrow owner-index lookup, trove-id derivation, and empty-owner trove reads
  • Updated integration coverage for Monad multicall and router multi-hop route selection
  • Local test execution

Related issues

  • N/A

Backwards compatibility

This change is backwards compatible. getNextOwnerIndex() remains available, but consumers opening new troves should prefer findNextAvailableOwnerIndex() because trove ids depend on both the owner and the transaction sender.

Documentation

  • Updated README.md
  • Updated CHANGELOG.md

@bayological bayological merged commit 7e22093 into main Mar 23, 2026
3 checks passed
@bayological bayological deleted the fix/borrow-owner-index-and-monad-route-tests branch March 23, 2026 15:59
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.

1 participant