-
Notifications
You must be signed in to change notification settings - Fork 294
feat: add batchStakingBuilder (bond and nominate) and bondExtraBuilder #6126
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
base: master
Are you sure you want to change the base?
Conversation
0691236
to
648f74d
Compare
c78e900
to
19b1b23
Compare
protected _validators: string[] = []; | ||
|
||
// Batch control | ||
protected _atomic = true; // Default to batchAll (atomic) |
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.
We will always set this to true right?
If so we can remove
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.
Sure, I'll force atomic
amount?: string; | ||
controller?: string; | ||
payee?: string | { Account: string }; | ||
validators?: string[]; |
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.
Why optional?
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.
👍, will edit
const calls: string[] = []; | ||
|
||
// Add bond call if amount is set | ||
if (this._amount) { |
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.
Amount and validator are always required
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, will implement by forcing atomic
import { BatchArgs, BondArgs, NominateArgs } from './iface'; | ||
import BigNumber from 'bignumber.js'; | ||
|
||
export class BatchBuilder extends TransactionBuilder { |
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 will be used for stake and unstake batch?
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.
We could use another batch builder for unstake, will rename this
…r for polyx TICKET: SC-1826
TICKET: SC-1826