-
Notifications
You must be signed in to change notification settings - Fork 208
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
feat: use orchFns.autoStake
as target for receiveUpcall
#10065
base: master
Are you sure you want to change the base?
Conversation
- uses an async-flow function as the handler for a `.monitorTransfers()` tap - allows guest develoeprs to write handlers as flows instead of with vows and watchers
Deploying agoric-sdk with Cloudflare Pages
|
trace('receiveUpcall', event); | ||
const { localAccount, stakingAccount, config } = this.state; | ||
// eslint-disable-next-line no-use-before-define -- defined by orchestrateAll, necessarily after this | ||
orchFns.autoStake(localAccount, stakingAccount, config, event); |
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 wanted to do orchFns.autoStake(this.state, event)
here, and call it ~(continuingOfferCtx, event)
on the other end, but was greeted with Error: cannot serialize Remotables with accessors like "localAccount"
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.
you might try passing a copy with normal properties rather than accessors {... this.state }
.
* stakingAccount: GuestInterface<CosmosOrchestrationAccount>; | ||
* localAccount: GuestInterface<LocalOrchestrationAccount>; |
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.
If we use OrchestrationAccount<any>
, which the flow is expecting, we see Argument of type '<OrchestrationAccount<any>>' is not assignable to parameter of type 'Passable'.
on L105.
closes: #10047
Description
Rework
auto-stake-it.contract.js
to use an orchestrated async-flow as the handler for.monitorTransfers()
(vtransfer). Previously, it was written using vows and watchers.To Do
ts-expect-error
's introducedSecurity Considerations
n/a
Scaling Considerations
n/a
Documentation Considerations
Better example code for prospective developers.
Testing Considerations
Existing tests should pass.
Upgrade Considerations
n/a, example code