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

[WIP] Horizon: fix unit tests and refactor #972

Merged
merged 7 commits into from
May 23, 2024

Conversation

Maikol
Copy link
Member

@Maikol Maikol commented May 21, 2024

No description provided.

Copy link

openzeppelin-code bot commented May 21, 2024

[WIP] Horizon: fix unit tests and refactor

Generated at commit: 3a66efa829d081494b2ecb69d9a61f727d4cc8c0

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
2
5
0
16
42
65
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

@Maikol Maikol force-pushed the mde/fix-escrow-and-payments-tests branch from e3d164d to 85a6f9d Compare May 22, 2024 14:59
@Maikol Maikol force-pushed the mde/fix-escrow-and-payments-tests branch from 2fab1d6 to 8947c07 Compare May 22, 2024 21:39
Copy link
Contributor

@tmigone tmigone left a comment

Choose a reason for hiding this comment

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

💪 great one, left a minor comment

@@ -16,6 +16,7 @@ import { IGraphProxyAdmin } from "@graphprotocol/contracts/contracts/upgrades/IG

import { ICuration } from "@graphprotocol/contracts/contracts/curation/ICuration.sol";

import "forge-std/console.sol";
Copy link
Contributor

Choose a reason for hiding this comment

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

👀

Copy link
Member Author

Choose a reason for hiding this comment

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

😅

uint256 tokensReceiverRemaining = tokens - tokensProtocol - tokensDataService - tokensDelegationPool;
uint256 totalCut = tokensProtocol + tokensDataService + tokensDelegationPool;
if (totalCut > tokens) {
revert GraphPaymentsCollectorInsufficientAmount(tokens, totalCut);
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure I would use the term Collector here, how about just:

Suggested change
revert GraphPaymentsCollectorInsufficientAmount(tokens, totalCut);
revert GraphPaymentsInsufficientTokens(tokens, totalCut);

Copy link
Member Author

Choose a reason for hiding this comment

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

totally!

@@ -78,14 +78,19 @@ contract PaymentsEscrow is Multicall, GraphDirectory, IPaymentsEscrow {
revert GraphEscrowThawingPeriodTooLong(withdrawEscrowThawingPeriod, MAX_THAWING_PERIOD);
}

revokeCollectorThawingPeriod = revokeCollectorThawingPeriod;
withdrawEscrowThawingPeriod = withdrawEscrowThawingPeriod;
REVOKE_COLLECTOR_THAWING_PERIOD = revokeCollectorThawingPeriod;
Copy link
Contributor

Choose a reason for hiding this comment

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

LOL very nice catch

Copy link
Member Author

Choose a reason for hiding this comment

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

haha I was so confused for a moment

@Maikol Maikol marked this pull request as ready for review May 23, 2024 14:39
@Maikol Maikol merged commit 7cd7374 into horizon May 23, 2024
3 of 7 checks passed
@Maikol Maikol deleted the mde/fix-escrow-and-payments-tests branch May 23, 2024 14:39
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