Skip to content

Conversation

patitonar
Copy link
Contributor

Context

Closes #326

Changes proposed in this pull request

Adds new integration tests for the process of submitting a claim and redeeming the payout.

Test plan

New tests were added in test/integration/YieldTokenIncidents/submitClaim.js

Checklist

  • Rebased the base branch
  • Attached corresponding Github issue
  • Prefixed the name with the type of change (i.e. feat, chore, test)
  • Performed a self-review of my own code
  • Followed the style guidelines of this project
  • Made corresponding changes to the documentation
  • Didn't generate new warnings
  • Didn't generate failures on existing tests
  • Added tests that prove my fix is effective or that my feature works

Review

When reviewing a PR, please indicate intention in comments using the following emojis:

  • 🍰 = Nice to have but not essential.
  • 💡 = Suggestion or a comment based on personal opinion
  • 🔨 = I believe this should be changed.
  • 🤔 = I don’t understand something, do you mind giving me more context?
  • 🚀 = Feedback

@danoctavian danoctavian force-pushed the test/cover-yieldtokenincidents-integration-tests branch from 0ec6010 to 3ee311e Compare December 7, 2022 17:53
[chainlinkDAI.address, chainlinkSteth.address],
[18, 18],
[dai.address, stETH.address, usdc.address],
[chainlinkDAI.address, chainlinkSteth.address, chainlinkUSDC.address],
Copy link
Contributor

Choose a reason for hiding this comment

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

good integration test addition for USDC to test different decimals basically


const { period, gracePeriod, priceDenominator } = submitClaimFixture;

const amount = parseUnits('10', 6);
Copy link
Contributor

Choose a reason for hiding this comment

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

const usdcDecimals = 6

});

// submit incident
await submitIncident({ gv, yc, productId, period, priceBefore: parseUnits('1', 6) });
Copy link
Contributor

Choose a reason for hiding this comment

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

const usdcDecimals

yc.connect(coverBuyer1).redeemPayout(0, 0, 0, parseEther('1'), nonMember1.address, [], { gasPrice: 0 }),
).to.be.revertedWith('The incident needs to be accepted');
const usdcBalanceBefore = await usdc.balanceOf(nonMember1.address);
await yc.connect(coverBuyer1).redeemPayout(0, 0, 0, parseUnits('1', 6), nonMember1.address, []);
Copy link
Contributor

Choose a reason for hiding this comment

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

const usdcDecimals all over there's a few more places

@danoctavian
Copy link
Contributor

danoctavian commented Dec 7, 2022

This looks good, just a few minor things but they are not critical @patitonar

Copy link
Contributor

@danoctavian danoctavian left a comment

Choose a reason for hiding this comment

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

nice work

@danoctavian danoctavian merged commit a0292cf into nexus-v2 Dec 8, 2022
@danoctavian danoctavian deleted the test/cover-yieldtokenincidents-integration-tests branch December 8, 2022 07:54
@roxdanila roxdanila linked an issue Dec 8, 2022 that may be closed by this pull request
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.

Cover <> YieldTokenIncidents integration tests
2 participants