-
Notifications
You must be signed in to change notification settings - Fork 147
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
Changes from 5 commits
f657198
31ae8e4
0c438c8
5247ebf
8947c07
3b39aa5
3a66efa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -69,7 +69,11 @@ contract GraphPayments is Multicall, GraphDirectory, GraphPaymentsStorageV1Stora | |||||
} | ||||||
|
||||||
// Pay the rest to the receiver | ||||||
uint256 tokensReceiverRemaining = tokens - tokensProtocol - tokensDataService - tokensDelegationPool; | ||||||
uint256 totalCut = tokensProtocol + tokensDataService + tokensDelegationPool; | ||||||
if (totalCut > tokens) { | ||||||
revert GraphPaymentsCollectorInsufficientAmount(tokens, totalCut); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure I would use the term
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. totally! |
||||||
} | ||||||
uint256 tokensReceiverRemaining = tokens - totalCut; | ||||||
_graphToken().pushTokens(receiver, tokensReceiverRemaining); | ||||||
|
||||||
emit GraphPaymentsCollected( | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LOL very nice catch There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. haha I was so confused for a moment |
||
WITHDRAW_ESCROW_THAWING_PERIOD = withdrawEscrowThawingPeriod; | ||
} | ||
|
||
// approve a data service to collect funds | ||
function approveCollector(address dataService, uint256 amount) external { | ||
authorizedCollectors[msg.sender][dataService].authorized = true; | ||
authorizedCollectors[msg.sender][dataService].amount = amount; | ||
Collector storage collector = authorizedCollectors[msg.sender][dataService]; | ||
if (collector.amount > amount) { | ||
revert GraphEscrowCollectorInsufficientAmount(collector.amount, amount); | ||
} | ||
|
||
collector.authorized = true; | ||
collector.amount = amount; | ||
emit AuthorizedCollector(msg.sender, dataService); | ||
} | ||
|
||
|
This file was deleted.
This file was deleted.
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.
👀
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.
😅