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

Refund logic #21

Merged
merged 22 commits into from
Aug 28, 2017
Merged

Refund logic #21

merged 22 commits into from
Aug 28, 2017

Conversation

poznyakbogdan
Copy link
Collaborator

No description provided.

Copy link
Contributor

@frostiq frostiq left a comment

Choose a reason for hiding this comment

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

Please take a look at the comments

// Confirm validators have refunded funds
require(isBurnApproved());
// Confirm the next payment is due to be released
require(isFundFreezePeriodEnded());
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can allow to burn even before the paymentTime

refundedAmount = getPaymentAmount();
firtPaymentReleased = true;
} else {
refundedAmount = getPaymentAmount();
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to return all remaining amount, not next payment amount

refundedAmount = balance();
}
// Assumes intended interval is meant to recur regardless of claiming funds
paymentTime = paymentTime + recurrentPaymentInterval;
Copy link
Contributor

Choose a reason for hiding this comment

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

we don't need to update paymentTime in burn case

firstPaymentPercent,
token.address,
PAYOUT_PERCENT
it("#14 should refund all roots and then refund balance of 0", async() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please, don't forget to change tests after your changes in PR.
You need just to check that all ether amount are refunded, if burn was approved.
And also a negative scenario (burn was not approved -> failure)

# Conflicts:
#	migrations/2_deploy_IouRootsToken.js
#	migrations/3_deploy_PensionFundRelease.js
#	test/IouRootsTokenTest.js
#	test/PensionFundReleaseTest.js
#	truffle.js
@frostiq
Copy link
Contributor

frostiq commented Aug 28, 2017

relates to #21

Copy link
Contributor

@frostiq frostiq left a comment

Choose a reason for hiding this comment

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

Good job, thanks!

@frostiq frostiq merged commit 75f5a9a into master Aug 28, 2017
@frostiq frostiq deleted the refund-logic branch August 28, 2017 17:13
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.

3 participants