-
Notifications
You must be signed in to change notification settings - Fork 212
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
Opera ticket zoe contract #780
Opera ticket zoe contract #780
Conversation
I've moved forward My experience so far is that writing a contract is hard because of a combinaison of:
|
A first version of the contract is ready, so i'm marking this PR as ready for review There are cosmetic aspects (lint/prettier/commit messages) that will need to be addressed, but the PR is ready for functional review |
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.
Thanks, David! This looks like it's nearly there. I think the major thing to change is to remove the getSalesPayment
method and use the Zoe payout system. Other comments are small. I will do another pass after the linting errors are fixed - it was hard to view in my local VSCode environment with the errors, so I may have missed things.
packages/zoe/test/unitTests/contracts/test-operaConcertTicket.js
Outdated
Show resolved
Hide resolved
packages/zoe/test/unitTests/contracts/test-operaConcertTicket.js
Outdated
Show resolved
Hide resolved
packages/zoe/test/unitTests/contracts/test-operaConcertTicket.js
Outdated
Show resolved
Hide resolved
packages/zoe/test/unitTests/contracts/test-operaConcertTicket.js
Outdated
Show resolved
Hide resolved
packages/zoe/test/unitTests/contracts/test-operaConcertTicket.js
Outdated
Show resolved
Hide resolved
I didn't have eslint enabled on VSCode so i didn't realize how annoying it might have been to read the code. I've enabled it and fixed the errors |
The only two remaining things are the removal of I'm going to try to work on |
I removed async/awaits and i've rewritten so that the Opera uses payouts. For this i had the Opera creating the offers and redeeming invites directly (instead of having the contract do it) I think this is ready for a review |
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 think we're making good progress, but I think we can make this contract simpler. Let's schedule some time to discuss how we can do that.
I rewrote the contract according to the discussion i've had with @katelynsills I'm particularly satisfied with the description of wanted allocations in |
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.
This is looking really good to me. Some small typos and other questions, but I think after those are fixed, we are good to go. Thanks!
packages/zoe/test/unitTests/contracts/test-operaConcertTicket.js
Outdated
Show resolved
Hide resolved
packages/zoe/test/unitTests/contracts/test-operaConcertTicket.js
Outdated
Show resolved
Hide resolved
packages/zoe/test/unitTests/contracts/test-operaConcertTicket.js
Outdated
Show resolved
Hide resolved
@katelynsills Have you seen #780 (comment) ? Before merging, i'd like to have your go on this point specifically because i've become skeptical of merging this |
Sorry, I missed the comment. I responded above. I think also, @erights should take a look at this and approve it before we merge |
I addressed comments and change a bit how the tests are structured There are 2 ways to fix the contract for the test to succeed (Joker fails to buy a ticket for 1 moola):
|
Do the first bulleted choice
not the second one. The second one better approximates the semantics of multiples, but I prefer not to do it that way until we have genuine multiples. |
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 have reviewed the contract and the review thread (including resolved items) about the contract. To both of you, good analysis and refinement, thanks! I have nothing more to add beyond comments already posted.
I skipped the test code, and the review comment threads on the test code, completely. If there's something in there you'd like to call my attention to, please do.
The contract-enforced offer safety by performExchange
is the only remaining issue I know of before this can be merged.
1663967
to
7269c24
Compare
…blicAPI.getTicketIssuer
…The contract also does not do its own redeem but rather lets the Opera do it
…ght away and passes them to the auditorium via zoe wih offer safety
Co-Authored-By: Kate Sills <[email protected]>
Co-Authored-By: Kate Sills <[email protected]>
Co-Authored-By: Kate Sills <[email protected]>
Co-Authored-By: Kate Sills <[email protected]>
5768785
to
444f8ea
Compare
rebase on top of current master (with zoe helper import changes) + force-push |
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.
Looks good to me! I will squash and merge
Closes #543
To run the test independently, run:
tape -r esm 'test/unitTests/contracts/test-operaConcertTicket.js' | tap-spec
(in zoe package and with
./node_modules/.bin
in your$PATH
)I'm currently, stuck with a weird error
but the payment is the return value of
await zoe.makeInstance
, so i'm fairly confident and surprised this wouldn't be caught by other tests.I'm doing something else and will be back to it in a couple hours