-
Notifications
You must be signed in to change notification settings - Fork 49
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
package/asset: Add extrinsic before dispatch #188
Conversation
Signed-off-by: Shreevatsa N <vatsa@dhiway.com>
Signed-off-by: Shreevatsa N <vatsa@dhiway.com>
Signed-off-by: Amar Tumballi <amar@dhiway.com>
Signed-off-by: Shreevatsa N <vatsa@dhiway.com>
Signed-off-by: Shreevatsa N <vatsa@dhiway.com>
let promises = []; | ||
for (let j = 0; j < tx_batch.length; j++) { | ||
try { | ||
let extSignCallback: Cord.SignExtrinsicCallback = async ({ data }) => ({ |
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.
nitpick: This technically can move out of loop as this remains same regardless of iterations.
const authorizedBatch = await Cord.Did.authorizeBatch({ | ||
batchFunction: api.tx.utility.batchAll, | ||
did: issuerDid.uri, | ||
nonce: new BN(j+3), |
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 is needed mainly because of async submission. In a case where only 1 utility.batchAll() is called per block, we wouldn't need nonce calculations.
Leaving comment here for others to refer in future.
This PR
prepareExtrinsic
beforedispatchIssueToChain
, making it possible to send batches of extrinsic calls in a single dispatch to chain call.