-
Notifications
You must be signed in to change notification settings - Fork 212
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
test: depositing to and withdrawing from a remote ica account #10211
Conversation
I think that's a mistake. I am going to remove it from the requirements. I also adjusted the description for #9784 to better reflect the current state of things. |
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.
sharing my comments so far
const { deleteTestKeys, setupTestKeys, ...rest } = await commonSetup(t); | ||
deleteTestKeys(accounts).catch(); | ||
const wallets = await setupTestKeys(accounts); |
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.
Aside...
In Agoric/dapp-orchestration-basics#61 where I folded in your work on starship testing, I struggled a bit to get this commonSetup(t)
stuff working. In order to be able to test it without re-deploying my contract for each iteration (or worse: standing up the whole cluster again), I factored out the ambient authority so I could inject mocks for quick ava testing.
See test('orca-multichain.test style usage', ...)
.
https://github.com/Agoric/dapp-orchestration-basics/blob/63f85352eaa73659d4cadbc1f17d48dd4095d98c/contract/test/agd-lib.test.js#L234
and test('deploy-cli style usage', ...)
https://github.com/Agoric/dapp-orchestration-basics/blob/main/contract/test/agd-lib.test.js#L214
Here's hoping we can migrate that back to support.js
here in due course.
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.
Nice, that's a good approach for this problem. We added startContact
in 3639831 a bit ago that ensures the contract is only installed once by querying vstorage
I wonder what the best path is for keeping testing tools in sync with minimal effort. Releases were something I'd floated in the past but it didn't seem to get much support.
invitationSpec: { | ||
source: 'agoricContract', | ||
instancePath: [contractName], | ||
callPipe: [['makeOrchAccountInvitation']], |
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.
devex note: it would be nice if our contracts came with a supplementary module of constants so that client didn't have to come up with magic strings like this.
For example: https://github.com/Agoric/agoric-sdk/blob/master/packages/inter-protocol/src/clientSupport.js
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.
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.
Awesome to have this user story tested e2e
I'd like to improve the abstractions in the tests so they're more reviewable by Product, but that can wait
|
||
const accountStoragePath = Object.fromEntries(offerToPublicSubscriberPaths)[ | ||
makeAccountOfferId | ||
]?.account; |
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 surprised this optional doesn't cause a problem for the .split
on 73. Maybe offerToPublicSubscriberPaths
is `any? Not a blocker but consider typing.
]?.account; | |
]!.account; |
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.
Yes, offerToPublicSubscriberPaths
is any
. Typing that here doesn't feel right - I've added a TODO for #10214
|
||
// IBC Transfer funds to remoteChain account | ||
const remoteChainId = remoteChainInfo.chain.chain_id; | ||
const ibcTransferOfferId = `Transfer-to-${chainName}-${Date.now()}`; |
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.
the other offer ids are lowercase
- creates a `PortfolioHolder` account that's comprised of a local and remote orchAccounts - uses `Deposit` and `Transfer` invitationMakers (via `Proxying`) to send funds to `remoteOrchAccount` - uses `Transfer` and `Withdraw` invitationMakers (via `Proxying`) to retrieve funds from `remoteOrchAccount`
6021289
to
4a2108a
Compare
Deploying agoric-sdk with Cloudflare Pages
|
9d82dfa
to
53f76a5
Compare
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.
@0xpatrickdev in Documentation Considerations of #10211, you write...
These tests serve as documentation for using the
Deposit
,Withdraw
,Transfer
, andProxying
invitationMakers from the Orchestration APIDo we have any JSDoc for those? I'm struggling to find
PortfolioHolderKit
at all in @agoric/orchestration API docs.
Good question @dckc . I exported the types for PortfolioHolder
and MakeCombineInvitationMakers
in the recent commits and improved the copy.
See: https://e46fc33c.agoric-sdk.pages.dev/funcs/_agoric_orchestration.preparePortfolioHolder and https://e46fc33c.agoric-sdk.pages.dev/funcs/_agoric_orchestration.prepareCombineInvitationMakers
Edit: moved to its own PR: #10217
|
||
const accountStoragePath = Object.fromEntries(offerToPublicSubscriberPaths)[ | ||
makeAccountOfferId | ||
]?.account; |
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.
Yes, offerToPublicSubscriberPaths
is any
. Typing that here doesn't feel right - I've added a TODO for #10214
53f76a5
to
ba81770
Compare
closes: #9193
Description
Deposit
andWithdraw
invitationMakers forLocalOrchestrationAccount
via thebasic-flows
contractPortfolioHolder
via thebasic-flows
contractProxying
invitationMaker to optionally accept invitationArgsSecurity Considerations
n/a, primarily tests
Scaling Considerations
n/a, primarily tests
Documentation Considerations
These tests serve as documentation for using the
Deposit
,Withdraw
,Transfer
, andProxying
invitationMakers from the Orchestration APITesting Considerations
PR includes E2E tests to close out the referenced issue.
Upgrade Considerations
Library code for NPM Orch release