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: revive the ability of a zoe client to get access to the code. #896

Merged
merged 1 commit into from
Apr 9, 2020

Conversation

Chris-Hibbert
Copy link
Contributor

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

@@ -321,7 +321,7 @@ const makeZoe = (additionalEndowments = {}) => {
}
}
const installationHandle = installationTable.create(
harden({ installation }),
harden({ installation, code }),
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the difference between the installation and the code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

code is a string with the actual source code. installation is the result of evaluating the code with all the context it needs. It's an object with a makeContract() function. That function has a bunch of metering wrappers thrown in, so it's not a useful place for clients to get access to and compare the code they are expecting to see.

erights
erights previously requested changes Apr 9, 2020
packages/zoe/src/state.js Outdated Show resolved Hide resolved
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
Copy link
Contributor

@katelynsills katelynsills left a comment

Choose a reason for hiding this comment

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

LGTM!

@Chris-Hibbert Chris-Hibbert dismissed erights’s stale review April 9, 2020 17:37

made the requested change to a comment.

@Chris-Hibbert Chris-Hibbert merged commit e5c270f into master Apr 9, 2020
@Chris-Hibbert Chris-Hibbert deleted the 877-zoeCodeAccess branch April 9, 2020 17:37
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.

How can i get the contract source code from an invite?
3 participants