Open dckc opened 2 months ago
If we resolve the vow, we see that the test fails.
orchestrate - osmosis makeAccount returns a ContinuingOfferResult
Rejected promise returned by test. Reason:
Error {
message: 'In "getChain" method of (Orchestrator orchestrator): arg 0: undefined "[undefined]" - Must be a string',
}
interesting, good catch.
This test wasn't updated when we added the offer arg for chainName
🙏🏽
In the current tests, vstorage queries are mocked in such a way that they're completely disconnected from the operation of the contract:
It's important to have a test to nail down the interface between the contract and clients such as the UI.
I'm pretty sure the contract requires offerArgs of the form
{ chainName }
and the UI supplies that when it makes offers.The test code, on the other hand, provides offerArgs of the form
{ id: offerId }
:https://github.com/Agoric/dapp-orchestration-basics/blob/2379c1a3370387b7017b4a5ed9e6e8278e353fe0/contract/test/orca-contract.test.js#L428-L433
I was surprised that this test code works.
Diagnosis: the offer handler in the contract is an async flow, so it returns a vow. The client code in the test doesn't resolve the vow:
https://github.com/Agoric/dapp-orchestration-basics/blob/2379c1a3370387b7017b4a5ed9e6e8278e353fe0/contract/test/orca-contract.test.js#L437
So the offer handler doesn't actually run.
cc @Jovonni @turadg