Skip to content

Conversation

patitonar
Copy link
Contributor

Context

Closes #274

Changes proposed in this pull request

Adds new unit tests for createStakingPool and performStakeBurn. Implemented the list of test cases from the issue.

Test plan

New tests were added in test/unit/Cover/createStakingPool.js and test/unit/Cover/performStakeBurn.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

@roxdanila roxdanila linked an issue Oct 31, 2022 that may be closed by this pull request
10 tasks
@danoctavian danoctavian force-pushed the test/cover-create-pool-stake-burn-unit-tests branch from 3914e81 to 4a80f41 Compare November 1, 2022 08:07
return buyCoverOnMultiplePools.call(this, params, 1);
}

async function buyCoverOnMultiplePools(
Copy link
Contributor

Choose a reason for hiding this comment

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

this is not clear enough what it does.

It both create pools and buys.

Also it's used in only 1 place.

Let's have a function that's buyCoverOnMultiplePools

but creates the pools before separately. There's only 1 place where this is used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure I fully understood your proposed changes. I applied the following changes 132e088 to only buy the cover on buyCoverOnMultiplePools and creating the pools outside the function, in the test that uses it and in buyCoverOnOnePool to not modify the behavior of that function as it is used in several unit tests.

Is something like this what you had in mind?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is what i mean yes, good!

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.

some changes necessary.

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.

Some changes necessary.

@roxdanila roxdanila force-pushed the test/cover-create-pool-stake-burn-unit-tests branch from 132e088 to 95a0e7d Compare November 2, 2022 13:33
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.

LGTM

@roxdanila roxdanila merged commit 57a2fe4 into nexus-v2 Nov 2, 2022
@roxdanila roxdanila deleted the test/cover-create-pool-stake-burn-unit-tests branch November 2, 2022 15:56
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.

V2 Cover unit tests: createStakingPool & performStakeBurn
3 participants