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

fix(zoe): add terms to invite details #7149

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

erights
Copy link
Member

@erights erights commented Mar 9, 2023

Fixes #5903

Invitation amounts now include terms in the details as info accoring to zoe (as opposed to customDetails, which is info according to the contract).

@erights erights self-assigned this Mar 9, 2023
@erights erights marked this pull request as ready for review March 9, 2023 23:07
@datadog-full-agoric
Copy link

datadog-full-agoric bot commented Mar 9, 2023

Datadog Report

Branch report: markm-5903-add-terms-to-invite-details
Commit report: 33247ea

agoric-sdk: 2 Failed (0 Known Flaky), 0 New Flaky, 2146 Passed, 22 Skipped, 17m 35.87s Wall Time

❌ Failed Tests (2)

  • smartWallet › oracle-integration › before hook - agoric.inter-protocol - Details

    Expand for error
     ---
         name: AssertionError
         message: Rejected promise returned by test
         values:
           'Rejected promise returned by test. Reason:': |-
             Error {
               message: 'In "startInstance" method of (ZoeService): arg 2?: A "promise" cannot be a key',
             }
         at: >-
           throwLabeled (packages/internal/src/utils.js:110:27)
     ...
    
  • smartWallet › psm-integration › before hook - agoric.inter-protocol - Details

    Expand for error
     ---
         name: AssertionError
         message: Rejected promise returned by test
         values:
           'Rejected promise returned by test. Reason:': |-
             Error {
               message: 'In "startInstance" method of (ZoeService): arg 2?: A "promise" cannot be a key',
             }
         at: >-
           throwLabeled (packages/internal/src/utils.js:110:27)
     ...
    

Comment on lines +350 to +353
terms: {
brands: {},
issuers: {},
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are empty brands and issuers (and a duplicate of the data that will end up in terms) being included in the custom details? It seems a distracting and unenlightening choice to include in customTerms.

It could be anything, right? It doesn't have anything to do with the brand and issuers in the top-level terms. So it could completely contradict the real info according to Zoe. Wouldn't a better example either show that these brands and issuers are completely separate info or show that they're arbitrary fields according to the contract?

Copy link
Member Author

Choose a reason for hiding this comment

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

The point is to add terms itself to the regular invitation details, the part according to zoe, not the customDetails, which is not clearly separated as the part according to the contract.

I don't understand the reference to customTerms. IIUC, customTerms is the part of terms aside from the brands and issuers. If we think of the customTerms rather than the terms as being the parameters of the contract, that could be an argument for only including the customTerms, not the full terms, in the invitationDetails.

It doesn't have anything to do with the brand and issuers in the top-level terms. So it could completely contradict the real info according to Zoe.

This is the key issue. The entire purpose of this PR is to introduce only the terms according to Zoe. The PR is trash until it succeeds at that.

The relevant lines are

const instanceRecord = state.instanceState.getInstanceRecord();
...
   terms: instanceRecord.terms,

Is state.instanceState.getInstanceRecord().terms the terms according to Zoe? In what ways can the contract influence the contents of this field?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused by the following snippet. Why does terms appear twice in these invitation details? The deeper one seems to be at the discretion of the contract (it's under customDetails).

  t.deepEqual(details, {
    description: 'myInvitation',
    handle: details.handle,
    installation,
    instance,
    terms: {
      brands: {},
      issuers: {},
    },
    customDetails: {
      description: 'whatever',
      installation: 'whatever',
      instance: 'whatever',
      terms: {
        brands: {},
        issuers: {},
      },
    },
  });

@Chris-Hibbert
Copy link
Contributor

Invitation amounts now include terms in the details as info accoring to zoe (as opposed to customDetails, which is info according to the contract).

Which documentation needs to be updated to explain what info in an invitation is guaranteed with what veracity according to which authority?

cc: @Tyrosine22

@erights erights force-pushed the markm-5903-add-terms-to-invite-details branch from b1dfd96 to 7b30fa4 Compare March 13, 2023 19:18
@erights erights force-pushed the markm-5903-add-terms-to-invite-details branch from 7b30fa4 to 51cba8d Compare March 14, 2023 05:54
@erights erights changed the base branch from master to markm-missing-await March 14, 2023 05:57
@erights erights force-pushed the markm-5903-add-terms-to-invite-details branch 2 times, most recently from f6f792f to bae637d Compare March 14, 2023 06:55
@erights erights force-pushed the markm-5903-add-terms-to-invite-details branch from bae637d to 78dc146 Compare March 14, 2023 07:03
Base automatically changed from markm-missing-await to master March 14, 2023 19:37
@erights erights force-pushed the markm-5903-add-terms-to-invite-details branch from 59de8ad to 574a1a7 Compare March 19, 2023 23:56
@datadog-full-agoric
Copy link

datadog-full-agoric bot commented Mar 20, 2023

Datadog Report

Branch report: markm-5903-add-terms-to-invite-details
Commit report: 1f92f6e

agoric-sdk: 4 Failed (0 Known Flaky), 0 New Flaky, 2391 Passed, 29 Skipped, 20m 5.18s Wall Time

❌ Failed Tests (4)

  • smartWallet › oracle-integration › before hook - agoric.inter-protocol - Details

    Expand for error
     ---
         name: AssertionError
         message: Rejected promise returned by test
         values:
           'Rejected promise returned by test. Reason:': |-
             Error {
               message: 'In "startInstance" method of (ZoeService): arg 2?: A "promise" cannot be a key',
             }
         at: >-
           throwLabeled (packages/internal/src/utils.js:110:27)
     ...
    
  • smartWallet › oracle-integration › before hook - agoric.inter-protocol - Details

    Expand for error
     ---
         name: AssertionError
         message: Rejected promise returned by test
         values:
           'Rejected promise returned by test. Reason:': |-
             Error {
               message: 'In "startInstance" method of (ZoeService): arg 2?: A "promise" cannot be a key',
             }
         at: >-
           throwLabeled (packages/internal/src/utils.js:110:27)
     ...
    
  • smartWallet › psm-integration › before hook - agoric.inter-protocol - Details

    Expand for error
     ---
         name: AssertionError
         message: Rejected promise returned by test
         values:
           'Rejected promise returned by test. Reason:': |-
             Error {
               message: 'In "startInstance" method of (ZoeService): arg 2?: A "promise" cannot be a key',
             }
         at: >-
           throwLabeled (packages/internal/src/utils.js:110:27)
     ...
    
  • smartWallet › psm-integration › before hook - agoric.inter-protocol - Details

    Expand for error
     ---
         name: AssertionError
         message: Rejected promise returned by test
         values:
           'Rejected promise returned by test. Reason:': |-
             Error {
               message: 'In "startInstance" method of (ZoeService): arg 2?: A "promise" cannot be a key',
             }
         at: >-
           throwLabeled (packages/internal/src/utils.js:110:27)
     ...
    

@erights erights force-pushed the markm-5903-add-terms-to-invite-details branch from 574a1a7 to e5169b6 Compare May 20, 2023 22:10
@erights erights force-pushed the markm-5903-add-terms-to-invite-details branch from e5169b6 to 1637c63 Compare June 6, 2023 02:49
@erights erights marked this pull request as draft June 6, 2023 02:49
@erights
Copy link
Member Author

erights commented Jun 6, 2023

Converted to draft because this is a durable representation change which needs upgrade coordination

@erights erights force-pushed the markm-5903-add-terms-to-invite-details branch from 1637c63 to 72aa7c6 Compare July 3, 2023 09:57
@erights erights force-pushed the markm-5903-add-terms-to-invite-details branch from 72aa7c6 to 5b9d838 Compare July 14, 2023 02:15
@erights erights force-pushed the markm-5903-add-terms-to-invite-details branch 4 times, most recently from dc1ad86 to 48725f4 Compare July 31, 2023 22:19
@erights erights force-pushed the markm-5903-add-terms-to-invite-details branch 2 times, most recently from acd9381 to 24b3c23 Compare August 11, 2023 05:49
@erights erights force-pushed the markm-5903-add-terms-to-invite-details branch from 24b3c23 to 71e88e8 Compare August 22, 2023 02:23
@erights erights force-pushed the markm-5903-add-terms-to-invite-details branch 2 times, most recently from 94d3afd to 65a9619 Compare August 30, 2023 01:26
@erights erights force-pushed the markm-5903-add-terms-to-invite-details branch from 65a9619 to 69d700a Compare September 13, 2023 04:04
@erights erights force-pushed the markm-5903-add-terms-to-invite-details branch from 69d700a to 77cc571 Compare October 14, 2023 01:55
@erights erights force-pushed the markm-5903-add-terms-to-invite-details branch from 77cc571 to a8f9569 Compare October 24, 2023 23:38
@erights erights force-pushed the markm-5903-add-terms-to-invite-details branch from a8f9569 to 1753253 Compare November 7, 2023 20:05
@erights erights force-pushed the markm-5903-add-terms-to-invite-details branch from 1753253 to 2fc60ac Compare December 21, 2023 03:55
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.

Invitation amounts should include terms
2 participants