-
Notifications
You must be signed in to change notification settings - Fork 213
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -40,7 +40,7 @@ const queryAccountBalances = test.macro({ | |||||||
const { | ||||||||
wallets, | ||||||||
provisionSmartWallet, | ||||||||
vstorageClient, | ||||||||
smartWalletKit, | ||||||||
retryUntilCondition, | ||||||||
} = t.context; | ||||||||
|
||||||||
|
@@ -67,7 +67,8 @@ const queryAccountBalances = test.macro({ | |||||||
}); | ||||||||
|
||||||||
const offerResult = await retryUntilCondition( | ||||||||
() => vstorageClient.queryData(`published.wallet.${agoricAddr}`), | ||||||||
() => smartWalletKit.readPublished(`wallet.${agoricAddr}`), | ||||||||
// @ts-expect-error UpdateRecord may not have 'status' | ||||||||
({ status }) => status.id === offerId && (status.result || status.error), | ||||||||
Comment on lines
+71
to
72
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if there's no status,
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have you considered the seatLike There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? |
||||||||
`${offerId} offer result is in vstorage`, | ||||||||
MAKE_ACCOUNT_AND_QUERY_BALANCE_TIMEOUT, | ||||||||
|
@@ -83,6 +84,7 @@ const queryAccountBalances = test.macro({ | |||||||
); | ||||||||
|
||||||||
const { | ||||||||
// @ts-expect-error UpdateRecord may not have 'status' | ||||||||
status: { result, error }, | ||||||||
} = offerResult; | ||||||||
if (expectValidResult) { | ||||||||
|
@@ -110,7 +112,7 @@ const queryAccountBalance = test.macro({ | |||||||
const { | ||||||||
wallets, | ||||||||
provisionSmartWallet, | ||||||||
vstorageClient, | ||||||||
smartWalletKit, | ||||||||
retryUntilCondition, | ||||||||
useChain, | ||||||||
} = t.context; | ||||||||
|
@@ -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' | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here we are with another copy of the |
||||||||
({ status }) => status.id === offerId && (status.result || status.error), | ||||||||
`${offerId} offer result is in vstorage`, | ||||||||
MAKE_ACCOUNT_AND_QUERY_BALANCE_TIMEOUT, | ||||||||
|
@@ -162,6 +165,7 @@ const queryAccountBalance = test.macro({ | |||||||
); | ||||||||
|
||||||||
const { | ||||||||
// @ts-expect-error UpdateRecord may not have 'status' | ||||||||
status: { result, error }, | ||||||||
} = offerResult; | ||||||||
if (expectValidResult) { | ||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ const queryICQChain = test.macro({ | |
const { | ||
wallets, | ||
provisionSmartWallet, | ||
vstorageClient, | ||
smartWalletKit, | ||
retryUntilCondition, | ||
useChain, | ||
} = t.context; | ||
|
@@ -108,7 +108,8 @@ const queryICQChain = test.macro({ | |
}); | ||
|
||
const offerResult = await retryUntilCondition( | ||
() => vstorageClient.queryData(`published.wallet.${agoricAddr}`), | ||
() => smartWalletKit.readPublished(`wallet.${agoricAddr}`), | ||
// @ts-expect-error UpdateRecord may not have 'status' | ||
({ status }) => status.id === offerId && (status.result || status.error), | ||
`${offerId} offer result is in vstorage`, | ||
{ | ||
|
@@ -117,6 +118,7 @@ const queryICQChain = test.macro({ | |
); | ||
t.log('ICQ Query Offer Result', offerResult); | ||
const { | ||
// @ts-expect-error UpdateRecord may not have 'status' | ||
status: { result, error }, | ||
} = offerResult; | ||
t.is(error, undefined, 'No error observed'); | ||
|
@@ -160,7 +162,7 @@ const queryChainWithoutICQ = test.macro({ | |
const { | ||
wallets, | ||
provisionSmartWallet, | ||
vstorageClient, | ||
smartWalletKit, | ||
retryUntilCondition, | ||
useChain, | ||
} = t.context; | ||
|
@@ -200,14 +202,16 @@ const queryChainWithoutICQ = test.macro({ | |
}); | ||
|
||
const offerResult = await retryUntilCondition( | ||
() => vstorageClient.queryData(`published.wallet.${agoricAddr}`), | ||
() => smartWalletKit.readPublished(`wallet.${agoricAddr}`), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wow there are a lot of these. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah. I think |
||
// @ts-expect-error UpdateRecord may not have 'status' | ||
({ status }) => status.id === offerId && (status.result || status.error), | ||
`${offerId} continuing invitation is in vstorage`, | ||
{ | ||
maxRetries: 10, | ||
}, | ||
); | ||
t.is( | ||
// @ts-expect-error UpdateRecord may not have 'status' | ||
offerResult.status.error, | ||
`Error: Queries not available for chain "${chain_id}"`, | ||
'Queries not available error returned', | ||
|
@@ -216,7 +220,7 @@ const queryChainWithoutICQ = test.macro({ | |
}); | ||
|
||
test.serial('Send Local Query from chain object', async t => { | ||
const { wallets, provisionSmartWallet, vstorageClient, retryUntilCondition } = | ||
const { wallets, provisionSmartWallet, smartWalletKit, retryUntilCondition } = | ||
t.context; | ||
|
||
const agoricAddr = wallets['agoric']; | ||
|
@@ -268,14 +272,16 @@ test.serial('Send Local Query from chain object', async t => { | |
}); | ||
|
||
const offerResult = await retryUntilCondition( | ||
() => vstorageClient.queryData(`published.wallet.${agoricAddr}`), | ||
() => smartWalletKit.readPublished(`wallet.${agoricAddr}`), | ||
// @ts-expect-error UpdateRecord may not have 'status' | ||
({ status }) => status.id === offerId && (status.result || status.error), | ||
`${offerId} continuing invitation is in vstorage`, | ||
{ | ||
maxRetries: 10, | ||
}, | ||
); | ||
|
||
// @ts-expect-error UpdateRecord may not have 'status' | ||
const parsedResults = JSON.parse(offerResult.status.result); | ||
t.truthy(parsedResults[0].height, 'query height is returned'); | ||
t.is(parsedResults[0].error, '', 'error is empty'); | ||
|
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.
in what way is this a kit? it looks like 1 object with methods, not a kit of facets.
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'm pretty sure "kit" is not necessarily an ExoClassKit.
is there another name you'd suggest? It would be a change to client-utils