-
Notifications
You must be signed in to change notification settings - Fork 50
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
test: refactor all tests according to singleton contracts #1077
Conversation
15240b6
to
80dbae3
Compare
7d2dd69
to
8f58ce8
Compare
5634eff
to
b4d9ea6
Compare
@andreivladbrg, what do you think about prefixing error names with Any feedback on Loom recording? Was it more helpful compared to if I would have written explanations in the PR description? |
What about |
The errors would only be thrown when a tx with
We can change it to |
Other contracts can call the I am strongly in favor of using |
I am in for SablierHelpers then. @andreivladbrg I have added it as a task in src PR description. |
151dbdd
to
57d7def
Compare
358a061
to
a06b1f2
Compare
57d7def
to
8ca1274
Compare
80099e1
to
914f13e
Compare
8ca1274
to
9050f98
Compare
914f13e
to
0828db8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turned out to be a bigger PR than expected, shesh :)). Fast work!
I have some recommendations, along with the ones we already talked about on Slack - they are mostly addressed in the PR raised on top of this
test/core/integration/concrete/lockup-tranched/get-tranches/getTranches.tree
Show resolved
Hide resolved
test/core/integration/concrete/lockup-dynamic/get-segments/getSegments.tree
Show resolved
Hide resolved
@@ -65,7 +65,7 @@ contract EstimateMaxCount is Test { | |||
|
|||
/// @notice Estimate the maximum number of tranches allowed in LockupTranched. | |||
function test_EstimateTranches() public { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's remove this, as we use only the segments count
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd preferred to keep it because right now, even though the segments count is less than tranches count but there could be a case in the future where tranches count may exceed segments count. So instead of rewriting it again, I'd leave the implementation.
A better approach would be to take the minimum of tranches count and segments count and update it, which is also something I intent to do (added to the OP).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be a case in the future where tranches count may exceed segments count
how exactly? a tranche has the same variables as the segments expect for the exponent
A better approach would be to take the minimum of tranches count and segments count and update it
thought about it but i find it unneeded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a tranche has the same variables as the segments expect for the exponent
Yes but the computation part can differ. If you are confident that segments will always be more gas expensive then we can remove it. I am doubtful so I thought the minimum of the two would be a safer choice. I leave it for you to decide.
test: update periphery tests chore: bump version to v1.3.0 This is a combination of 14 commits. test: update tests accordingly to singletone architecture test: update fork tests for core test(core): refactor integration tests for core test(integration): rename Lockup_Create_Integration_Shared_Test to Lockup_Integration_Shared_Test test: dry'ify concrete tests test(core): update fuzz tests test(core): updates invariant tests test(benchmark): update benchmark test: fix file path build: link libraries to optimized build test: move nullStreamId variable into Integration tests build: etch helpers bytecode onto dummy addresses for optimized tests test: update precompiles test: fix benchmarks test: polish librariy linkage test: mock lockup in periphery fork test test: deploy libraries through DeployOptimized contract
0828db8
to
86adfca
Compare
test: update periphery tests chore: bump version to v1.3.0 This is a combination of 14 commits. test: update tests accordingly to singletone architecture test: update fork tests for core test(core): refactor integration tests for core test(integration): rename Lockup_Create_Integration_Shared_Test to Lockup_Integration_Shared_Test test: dry'ify concrete tests test(core): update fuzz tests test(core): updates invariant tests test(benchmark): update benchmark test: fix file path build: link libraries to optimized build test: move nullStreamId variable into Integration tests build: etch helpers bytecode onto dummy addresses for optimized tests test: update precompiles test: fix benchmarks test: polish librariy linkage test: mock lockup in periphery fork test test: deploy libraries through DeployOptimized contract Co-authored-by: andreivladbrg <[email protected]>
test: update periphery tests chore: bump version to v1.3.0 This is a combination of 14 commits. test: update tests accordingly to singletone architecture test: update fork tests for core test(core): refactor integration tests for core test(integration): rename Lockup_Create_Integration_Shared_Test to Lockup_Integration_Shared_Test test: dry'ify concrete tests test(core): update fuzz tests test(core): updates invariant tests test(benchmark): update benchmark test: fix file path build: link libraries to optimized build test: move nullStreamId variable into Integration tests build: etch helpers bytecode onto dummy addresses for optimized tests test: update precompiles test: fix benchmarks test: polish librariy linkage test: mock lockup in periphery fork test test: deploy libraries through DeployOptimized contract Co-authored-by: andreivladbrg <[email protected]>
This PR contains tests according to singleton contract. Upon review, this PR should be merged into #1069.
To do
abstract
from the contracts that do not depend on the lockup modelTake the minimum of tranches count and segments count and update itResources: