Skip to content
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

Merged
merged 5 commits into from
Mar 11, 2024

Conversation

vatsa287
Copy link
Member

@vatsa287 vatsa287 commented Mar 6, 2024

This PR

  • Adds a prepareExtrinsic before dispatchIssueToChain, making it possible to send batches of extrinsic calls in a single dispatch to chain call.
  • Asset-Benchmark: Changes on asset benchmark script updates

Signed-off-by: Shreevatsa N <vatsa@dhiway.com>
@vatsa287 vatsa287 marked this pull request as draft March 6, 2024 13:31
Signed-off-by: Shreevatsa N <vatsa@dhiway.com>
Signed-off-by: Amar Tumballi <amar@dhiway.com>
Signed-off-by: Shreevatsa N <vatsa@dhiway.com>
@vatsa287 vatsa287 marked this pull request as ready for review March 11, 2024 12:29
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 }) => ({
Copy link
Member

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),
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants