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

How can i get the contract source code from an invite? #877

Closed
DavidBruant opened this issue Apr 7, 2020 · 1 comment · Fixed by #896
Closed

How can i get the contract source code from an invite? #877

DavidBruant opened this issue Apr 7, 2020 · 1 comment · Fixed by #896
Assignees
Labels
Zoe package: Zoe
Milestone

Comments

@DavidBruant
Copy link
Contributor

  • From the invite payment amount, i can extract the instanceHandle
  • I can call zoe.getInstance(instanceHandle) which gives me the installationHandle

But from the installationHandle, it's not clear to me how a user can get the contract source code

In any case, going through 2 handles to get to the source code feels like too much for no good reason

Could the source code be made available directly as part of the instanceRecord?

@katelynsills katelynsills self-assigned this Apr 7, 2020
@katelynsills
Copy link
Contributor

Somehow we dropped a method on the Zoe service API, which should have been: zoe.getInstallationRecord(installationHandle) or zoe.getInstallation(installationHandle). This would return the installation code. This solution would require two calls to get the source code, but I would expect that most of the time, there's no need to look at the source code, since most contracts are reused quite a bit and the only comparison that needs to be made is whether it is an installationHandle you recognize. Let's talk about this more in the design discussion though.

@katelynsills katelynsills added this to the Zoe 0.5.0 milestone Apr 7, 2020
Chris-Hibbert added a commit that referenced this issue Apr 9, 2020
It's tested in an existing large test by checking for specific text in
the source code. We could check something less fragile (e.g. starts
with 'function getExport'), and still be pretty sure that if a string
is returned, it would continue to be the source of the contract.

fixes #877
Chris-Hibbert added a commit that referenced this issue Apr 9, 2020
It's tested in an existing large test by checking for specific text in
the source code. We could check something less fragile (e.g. starts
with 'function getExport'), and still be pretty sure that if a string
is returned, it would continue to be the source of the contract.

fixes #877
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Zoe package: Zoe
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants