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

multichain testing improvements #10713

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

multichain testing improvements #10713

wants to merge 4 commits into from

Conversation

turadg
Copy link
Member

@turadg turadg commented Dec 17, 2024

refs: #10578

Description

Some tangential improvements while working on #10578

Security Considerations

Scaling Considerations

Documentation Considerations

Testing Considerations

Upgrade Considerations

Copy link

cloudflare-workers-and-pages bot commented Dec 17, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: c49d585
Status: ✅  Deploy successful!
Preview URL: https://6a91c0c0.agoric-sdk.pages.dev
Branch Preview URL: https://ta-dry-e2e-tools.agoric-sdk.pages.dev

View logs

@turadg turadg added the force:integration Force integration tests to run on PR label Dec 17, 2024
Copy link
Member

@dckc dckc left a comment

Choose a reason for hiding this comment

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

It's good to capture more of the common idioms.

Some parts of this appeal to me more than others...

@@ -67,7 +67,8 @@ const queryAccountBalances = test.macro({
});

const offerResult = await retryUntilCondition(
() => vstorageClient.queryData(`published.wallet.${agoricAddr}`),
() => smartWalletKit.readPublished(`wallet.${agoricAddr}`),
Copy link
Member

Choose a reason for hiding this comment

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

in what way is this a kit? it looks like 1 object with methods, not a kit of facets.

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'm pretty sure "kit" is not necessarily an ExoClassKit.

is there another name you'd suggest? It would be a change to client-utils

Comment on lines +71 to 72
// @ts-expect-error UpdateRecord may not have 'status'
({ status }) => status.id === offerId && (status.result || status.error),
Copy link
Member

Choose a reason for hiding this comment

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

if there's no status, status.id will throw, right?

Suggested change
// @ts-expect-error UpdateRecord may not have 'status'
({ status }) => status.id === offerId && (status.result || status.error),
(u) => u?.status.id === offerId && (u?.status.result || u?.status.error),

Copy link
Member

Choose a reason for hiding this comment

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

Have you considered the seatLike .getOfferResult() API?

Copy link
Member Author

Choose a reason for hiding this comment

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

haven't considered that yet. I was just trying to DRY out what I could.

do you think that API should be part of client-utils?

@@ -146,7 +148,8 @@ const queryAccountBalance = test.macro({
});

const offerResult = await retryUntilCondition(
() => vstorageClient.queryData(`published.wallet.${agoricAddr}`),
() => smartWalletKit.readPublished(`wallet.${agoricAddr}`),
// @ts-expect-error UpdateRecord may not have 'status'
Copy link
Member

Choose a reason for hiding this comment

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

here we are with another copy of the getOfferResult() logic.

@@ -200,14 +202,16 @@ const queryChainWithoutICQ = test.macro({
});

const offerResult = await retryUntilCondition(
() => vstorageClient.queryData(`published.wallet.${agoricAddr}`),
() => smartWalletKit.readPublished(`wallet.${agoricAddr}`),
Copy link
Member

Choose a reason for hiding this comment

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

wow there are a lot of these.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah. I think SmartWalletKit is a good place to hang something like "await a matching state of the status node and return it"

? Array<[string, Brand]>
: T extends 'fastUsdc'
? ContractRecord
: T extends 'fastUsdc.poolMetrics'
Copy link
Member

Choose a reason for hiding this comment

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

This coupling still seems odd to me.

To my mind, fast-usdc is in the agoric-sdk for logistical reasons; any 3rd party developer should be able to make a similar app. Do we expect 3rd-party developers to update client-utils for every vstorage path they introduce?

Is there any way to flip it around so that a dev can combine types from agoricNames, inter protocol, and fast-usdc? I did something like that once...

type ConsumeBootrapItem = <N extends string>(
name: N,
) => N extends keyof FastUSDCCorePowers['consume']
? FastUSDCCorePowers['consume'][N]
: N extends keyof EconomyBootstrapPowers['consume']
? EconomyBootstrapPowers['consume'][N]
: unknown;

Copy link
Member Author

Choose a reason for hiding this comment

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

Do we expect 3rd-party developers to update client-utils for every vstorage path they introduce?

No.

Is there any way to flip it around…

Sure. It's just not anywhere near the top of priorities.

Let's tackle it when it's a problem. It won't be hard to fix but having the actual instance of the problem will make it more efficient than doing it now. (One of the "less effort later" kind of tasks.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
force:integration Force integration tests to run on PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants