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

ife stop eating wrong side bond #585

Merged
merged 9 commits into from
Feb 19, 2020

Conversation

boolafish
Copy link
Contributor

@boolafish boolafish commented Feb 17, 2020

Note

@boolafish boolafish changed the title Boolafish/ife stop eating wrong side bond ife stop eating wrong side bond Feb 17, 2020
@thec00n thec00n self-requested a review February 17, 2020 09:59
Copy link
Contributor

@pdobacz pdobacz left a comment

Choose a reason for hiding this comment

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

LGTM, leaving two comments, but deferring the final review to others, if there aren't any surprises here.

{
for (uint16 i = 0; i < PaymentTransactionModel.MAX_INPUT_NUM(); i++) {
PaymentExitDataModel.WithdrawData memory withdrawal = exit.inputs[i];
if (token == withdrawal.token && exit.isInputPiggybacked(i)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this might be up to the wording (and possibly require a clarifying comment), but I'm assuming here that invalid and challenged piggybacks won't return the bond, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing this out. I just double checked the challenge piggyback code. So if it challenged, it would return the bond immediately and delete the piggyback flag. So this implementation is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But I definitely have the wrong impression in my mind when making the code change....I thought challenge piggyback would end up changing the piggyback bond owner.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, maybe consider leaving a comment about challenged piggybacks - that this is taken care of b/c isInputPiggybacked returns false.

@@ -464,6 +465,14 @@ contract('PaymentProcessInFlightExit', ([_, ifeBondOwner, inputOwner1, inputOwne
expect(postBalance).to.be.bignumber.equal(expectedBalance);
});

it('should return piggyback bond to the output owner', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

is there testing that a challenged invalid piggyback doesn't return the bond? Also are both canonicity-cases covered in here?

@boolafish boolafish force-pushed the boolafish/ife_stop_eating_wrong_side_bond branch from 9b0d5b9 to 15dffd9 Compare February 17, 2020 15:11
by PR review suggestion

Co-Authored-By: Kevin Sullivan <4653170+kevsul@users.noreply.github.com>
Also format the README file a bit.
- run `npm version patch -m`
- update changelog
@boolafish
Copy link
Contributor Author

boolafish commented Feb 18, 2020

@kevsul @thec00n to make things simple and ready for release if possible, added 1.0.3 version bumping change within this PR as well.

kevsul
kevsul previously approved these changes Feb 18, 2020
CHANGELOG.md Outdated Show resolved Hide resolved
for PR review

Co-Authored-By: Kevin Sullivan <4653170+kevsul@users.noreply.github.com>
kevsul
kevsul previously approved these changes Feb 18, 2020
Although the inputs and outputs storage is defined to be exactly the max size of payment tx inputs/outputs. However, using the length itself makes the code more
self explaining.
Copy link
Contributor

@thec00n thec00n left a comment

Choose a reason for hiding this comment

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

ok

@boolafish boolafish merged commit 7c3f796 into master Feb 19, 2020
@boolafish boolafish deleted the boolafish/ife_stop_eating_wrong_side_bond branch February 19, 2020 07:19
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.

5 participants