Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(fast-usdc): prune testBorrow, testRepay methods #10607

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

dckc
Copy link
Member

@dckc dckc commented Dec 3, 2024

closes: #10388
refs: #10511

Description

Prune testBorrow, testRepay methods along with contract tests that depend on them.

  • Several tests are largely covered by share-pool-math tests
    • 1 was not, so I made a pool-share-math test to cover repay succeeds with no Pool or Contract Fee.
  • Several tests basically checked the interface guards of lp.borrower.borrow / lp.repayer.repay.
    These are internal APIs with static types.
    • testing consistency between interface guards and static types
      might have some value, but, I suggest, not enough for the cost

Scaling / Documentation / Upgrade Considerations

none

Security / Testing Considerations

small loss in test coverage - mostly in test redundancy

makeTestPushInvitation remains on the public facet. Getting rid of it in due course remains critical.
I expect / hope we can get rid of it in #10606 (cc @samsiegart ) .

Ideally, the liquidity-pool exo would have unit test coverage. I looked into that but found that I would have to build substantial ZCF / Zoe test tooling. Since liquidity-pool.js is just 360 lines of straightforward Zoe API usage, I suggest we postpone that under...

@dckc dckc requested review from turadg and 0xpatrickdev December 3, 2024 00:08
@dckc dckc requested a review from a team as a code owner December 3, 2024 00:08
@dckc dckc mentioned this pull request Dec 3, 2024
2 tasks
Copy link
Member

@turadg turadg left a comment

Choose a reason for hiding this comment

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

Rationale makes sense to me

@@ -494,3 +494,29 @@ test('repay fails when seat allocation does not equal amounts', t => {
},
);
});

test('repay succeeds with no Pool or Contract Fee', t => {
const { USDC } = brands;
Copy link
Member

Choose a reason for hiding this comment

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

out of scope: consider using withAmountUtils to make the brands, issuers and amounts easier to work with

totalBorrows: make(USDC, 100n),
};
const fromSeatAllocation = amounts;
t.notThrows(() =>
Copy link
Member

Choose a reason for hiding this comment

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

consider verifying the shareWorth doesn't change and encumberedBalance does.

Copy link

cloudflare-workers-and-pages bot commented Dec 3, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: d96a45e
Status: ✅  Deploy successful!
Preview URL: https://005c481a.agoric-sdk.pages.dev
Branch Preview URL: https://dc-fc-contract-tests.agoric-sdk.pages.dev

View logs

@dckc dckc added the automerge:rebase Automatically rebase updates, then merge label Dec 3, 2024
@dckc dckc force-pushed the dc-fc-contract-tests branch from fbfe008 to a6b86da Compare December 3, 2024 00:21
@dckc dckc force-pushed the dc-fc-contract-tests branch from ffc0cbc to 78c2eab Compare December 3, 2024 04:11
dckc added 2 commits December 3, 2024 17:08
 - largely covered by share-pool-math tests
   - move 'repay succeeds with no Pool or Contract Fee'
     from contract test to pool-share-math test.
 - borrow / repay are internal APIs with static types
   - testing consistency between interface guards and static types
     might have some value, but not enough
@dckc dckc force-pushed the dc-fc-contract-tests branch from 78c2eab to d96a45e Compare December 3, 2024 17:08
@mergify mergify bot merged commit 11c895a into master Dec 3, 2024
79 checks passed
@mergify mergify bot deleted the dc-fc-contract-tests branch December 3, 2024 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:rebase Automatically rebase updates, then merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Contract flow tests
3 participants