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

Markm make exo not far #29

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Markm make exo not far #29

wants to merge 5 commits into from

Conversation

erights
Copy link
Member

@erights erights commented Mar 26, 2024

refs: #26

Doesn't work yet. Putting up for now for reference.

@erights erights requested a review from dckc March 26, 2024 04:56
@erights erights self-assigned this Mar 26, 2024
contract/package.json Outdated Show resolved Hide resolved
@@ -56,6 +57,7 @@
"@agoric/vats": "0.15.2-u14.0",
"@agoric/zoe": "^0.26.3-u14.0",
"@endo/bundle-source": "^2.8.0",
"@endo/exo": "^1.3.0",
Copy link
Member

Choose a reason for hiding this comment

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

This dapp uses packages from agoric-upgrade-14. The version there seems to be "@endo/[email protected]".

https://github.com/Agoric/agoric-sdk/blob/d69c011001d300735546dcb74a9ae21e306e4789/yarn.lock#L1395

I don't know what happens if you mix in this version of exo.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I need to wait until I can depend on a more recent endo before proceeding farther. I need at least support for M.raw() in order to sidestep some of the exceptional cases.

I am surprised to see lots of async generator definitions in this repo. Looks like twelve! This is the cause of some of the special cases I need to sidestep. Where did these come from?

Copy link
Member

@dckc dckc Mar 26, 2024

Choose a reason for hiding this comment

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

Where did these [async generator definitions] come from?

Async iterators seemed like the natural API for query subscriptions, and async generators seemed like a convenient way to produce them for mocking purposes, as well as consuming them.

for example:

  const { stringify: lit } = JSON;
...
  const cosmosBalanceUpdates = () =>
    dedup(poll(getCosmosBalances, { delay }), (a, b) => lit(a) === lit(b));

Copy link
Member

Choose a reason for hiding this comment

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

In case M.raw() is blocking progress here, it became available in Agoric SDK on March 20. Please let me know if there’s further Endo work in flight to unblock this draft.

Copy link
Member Author

Choose a reason for hiding this comment

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

This dapp uses packages from agoric-upgrade-14. The version there seems to be "@endo/[email protected]".

In case M.raw() is blocking progress here,

It is.

it became available in Agoric SDK on March 20. Please let me know if there’s further Endo work in flight to unblock this draft.

What is needed so M.raw() is available here?

@@ -177,7 +187,7 @@ export const mockWalletFactory = (
*
* @param {Brand} brand
*/
async function* purseUpdates(brand) {
async function* purseUpdatesInternal(brand) {
Copy link
Member Author

Choose a reason for hiding this comment

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

If this change turns out to be pointless, revert it.

Copy link
Member

Choose a reason for hiding this comment

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

Why did you make it?

Comment on lines -98 to +101
produce.priceAuthority.resolve(Far('NullPriceAuthority', {}));
produce.priceAuthority.resolve(
makeExo(
Copy link
Member

Choose a reason for hiding this comment

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

I suggest skipping everything under test/.

Comment on lines +244 to +253
const deposit = makeExo(
'DepositFacet',
M.interface(
'DepositFacet',
{},
{ defaultGuards: 'passable', sloppy: true },
),
{
receive: async payment => {
const brand = await E(payment).getAllegedBrand();
Copy link
Member

Choose a reason for hiding this comment

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

indenting everything further is tedious.

If we factor out the interface, can we avoid that?

Suggested change
const deposit = makeExo(
'DepositFacet',
M.interface(
'DepositFacet',
{},
{ defaultGuards: 'passable', sloppy: true },
),
{
receive: async payment => {
const brand = await E(payment).getAllegedBrand();
const sloppyGuards = { defaultGuards: 'passable', sloppy: true };
const depositI = M.interface('DepositFacet', {}, sloppyGuards);
const deposit = makeExo('DepositFacet', depositI, {
receive: async payment => {
const brand = await E(payment).getAllegedBrand();

Comment on lines +20 to +21
'NameHub',
M.interface('NameHub', {}, { defaultGuards: 'passable', sloppy: true }),
Copy link
Member

Choose a reason for hiding this comment

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

repeating the 'NameHub' string is tedious

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.

4 participants