-
Notifications
You must be signed in to change notification settings - Fork 5
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
Using/Teaching zone.exo
instead of Far
--wip--
#89
base: main
Are you sure you want to change the base?
Conversation
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.
baggage is the 3rd arg of start
. Let's go ahead and do it that way. I think it simplifies things considerably.
I'm not confident that mixing u16 and u12 dependencies is reliable.
contract/package.json
Outdated
"@agoric/zoe": "^0.26.3-u12.0", | ||
"@agoric/zone": "^0.3.0-u16.1", |
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.
What impact does this have on the contract bundle size? Does it introduce duplicate dependencies?
Other dependencies in this dapp (zoe, ertp) look like they're from u12. IME, mixing u12 and u16 is asking for trouble.
I know dapp-agoric-basics uses u14: Agoric/dapp-agoric-basics@817bc8a
Are you familiar with the fragility of dependency versions?
- bundle contains duplicated modules based on duplicated packages in node_modules agoric-sdk#8621
- fix: contract bundles have duplicate dependencies #34
- Test that compressed contract bundles are less than 1MB #36
- cannot publish inter protocol bundles over 1M due to max_tx_bytes tendermint config agoric-sdk#7501
It looks like @Jovonni managed to use u16 in dapp-orchestration-basics, though it took some troubleshooting. See item 9 in particular.
I gather recent symptoms include a problem when starting the ui: a blank page and a console error:
|
zone.exo
instead of Far
zone.exo
instead of Far
--wip--
eb2d98b
to
b5d3dea
Compare
contract/src/offer-up.contract.js
Outdated
// Mark the publicFacet Far, i.e. reachable from outside the contract | ||
const publicFacet = Far('Items Public Facet', { | ||
// Use zone.exo to make a publicFacet suitable for use by remote callers. | ||
const publicFacet = zone.exo('Items Public Facet', undefined, { | ||
makeTradeInvitation, |
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 suggest inlining makeTradeInvitation
here.
- That's the more usual idiom.
- I think exo methods have to use concise method syntax.
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 exo methods have to use concise method syntax.
"have to" is a bit too strong, but is directionally right. And exo singleton such as this one does not need to refer to this
. Therefore, arrow functions happen to work. But they are not idiomatic and should not be. Methods of exo classes and exo class kits generally do need to refer to their this
, and so must use concise method syntax. Also, methods in JavaScript class syntax are necessarily in concise method syntax. So for uniformity, I strongly recommend that even for exo singletons, methods use only concise method syntax.
00ba31c
to
fe3e965
Compare
Co-authored-by: Dan Connolly <connolly@agoric.com>
Co-authored-by: Dan Connolly <connolly@agoric.com>
Co-authored-by: Dan Connolly <connolly@agoric.com>
Co-authored-by: Dan Connolly <connolly@agoric.com>
1bc346c
to
1be91de
Compare
* Make an invitation to trade for items. | ||
* | ||
* Proposal Keywords used in offers using these invitations: | ||
* - give: `Price` | ||
* - want: `Items` |
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.
any particular reason to drop this bit of documentation?
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.
hmm, don't remember removing them at all, will put them back.
Also, currently there are a lot of type errors in the CI which is bothering me a bit. Let me know if you can find time to help there.
Co-authored-by: Dan Connolly <connolly@agoric.com>
This adds code to contract file (and related deps to package.json) to use
zone.exo
to replaceFar
. Note that this is only for teaching purpose at the moment and does not make resulting contract upgradable becausezone
andbaggage
are created insidestart
function. The upgradability will require changingstart
signature which I am avoiding at the moment.Ref(s):
Agoric/documentation#1033