Skip to content

DeFi Connector Integration Tests#302

Open
UlyanaAndrukhiv wants to merge 3 commits intomainfrom
UlianaAndrukhiv/282-defi-connector-tests
Open

DeFi Connector Integration Tests#302
UlyanaAndrukhiv wants to merge 3 commits intomainfrom
UlianaAndrukhiv/282-defi-connector-tests

Conversation

@UlyanaAndrukhiv
Copy link
Copy Markdown
Contributor

@UlyanaAndrukhiv UlyanaAndrukhiv commented Mar 31, 2026

Closes: #282

Context

This PR adds the remaining missing tests from the issue, with a primary focus on reentrancy scenarios in DeFi actions.

  • Malicious Sink calls back into protocol during deposit
  • Malicious Source calls back during withdrawal
  • Reentrancy guards effectiveness
  • State consistency validation

Notes:

@UlyanaAndrukhiv UlyanaAndrukhiv self-assigned this Mar 31, 2026
@UlyanaAndrukhiv UlyanaAndrukhiv requested a review from mts1715 March 31, 2026 10:51
@UlyanaAndrukhiv UlyanaAndrukhiv marked this pull request as ready for review March 31, 2026 15:28
@UlyanaAndrukhiv UlyanaAndrukhiv requested a review from a team as a code owner March 31, 2026 15:28
//
// In this test, the topUpSource behavior is adversarial: it attempts to re-enter
// the pool during the pull/deposit flow. We expect the transaction to fail.
let withdrawRes = _executeTransaction(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
let withdrawRes = _executeTransaction(
let withdrawRes = _executeTransaction(

vaultPublicPath: FLOW_VAULT_PUBLIC_PATH
) ?? 0.0
Test.assertEqual(FLOWBefore, FLOWAfter)
} No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
}
}

access(contract) var uniqueID: DeFiActions.UniqueIdentifier?
/// An unentitled Capability on the Vault to which deposits are distributed
access(self) let depositVault: Capability<&{FungibleToken.Vault}>
access(all) let liveDataCap: Capability<&LiveData>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe access(self) ?

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.

DeFi Connector Integration Tests

2 participants