-
Notifications
You must be signed in to change notification settings - Fork 226
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
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 }
.
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.
This was my observation with this approach unfortunately: #10991 (comment)
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.
odd. I'm almost certain that I've done it.
* 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.
- 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
5b8b568
to
5f50d92
Compare
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.Security Considerations
n/a
Scaling Considerations
n/a
Documentation Considerations
Better example code for prospective developers.
Testing Considerations
Covered by existing contract test and e2e test in
multichain-testing
Upgrade Considerations
n/a, example code