Skip to content

Make adjustments to allow tests to run#15

Merged
kgrgpg merged 2 commits intocadence-testing-patterns-forkfrom
kan/pr-14-adjustments
Jun 19, 2025
Merged

Make adjustments to allow tests to run#15
kgrgpg merged 2 commits intocadence-testing-patterns-forkfrom
kan/pr-14-adjustments

Conversation

@Kay-Zee
Copy link
Copy Markdown
Member

@Kay-Zee Kay-Zee commented Jun 18, 2025

Some suggestions for your PR.

In response to your questions

  1. MockOracle deployment - Should it be in the common deployContracts() function? Currently it's only deployed in one test file, causing import errors in others
    • I don't really see a reason for it not be deployed in the deploy contracts helper, i've went ahead and moved it here
  2. MockTidalProtocolConsumer conflicts - Getting "cannot overwrite existing contract" errors even when tests run individually
    • You were getting this error because you deployed it in deployContracts(), as well as in setup() in each test. I've gone ahead and removed the one in setup()
  3. Import resolution - Some tests can't find DFB and TidalProtocol imports
    • I've commented out TidalProtocol import in test_helpers, as i can't see why it's needed, don't see it used anywhere.
    • Don't see any other import issues.

I believe all tests should run with these changes. I've not validated the logic of the tests themselves yet, but at the moment they all pass. the only test i changed was testAddSupportedTokenSucceedsAndDuplicateFails, which needed an additional helper

log(detailsBefore.balances[0].balance)

// TODO: This current fails
// Test.assert(detailsBefore.balances[0].balance == 1000.0) // check initial position balance
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@kgrgpg

Having set Flow and MOET price to 1.0, and creating the initial wrapped position, i would expect this value to be some even number, as the flow/collateral balance i'd expect to still be 1000, and the MOET balance would be 800 (is that what collateral factor means in this case?)

but i get some balance lower than either of those: 615.38461538 , i assume this is a problem?

@kgrgpg kgrgpg merged commit e32140c into cadence-testing-patterns-fork Jun 19, 2025
1 check passed
@kgrgpg kgrgpg deleted the kan/pr-14-adjustments branch June 19, 2025 10:05
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.

2 participants