-
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
Created prepareDelegateAuthorizationExtrinsic() and modified dispatchDelegateAuthorization() function #240
base: develop
Are you sure you want to change the base?
Conversation
@vatsa287 , @gamemaker1 Please review it and let me know if any changes are required. |
.gitpod.yml
Outdated
@@ -0,0 +1,10 @@ | |||
# This configuration file was automatically generated by Gitpod. |
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 file is not required for the PR.
* @returns A promise resolving to the prepared extrinsic. | ||
* @throws {SDKErrors.CordQueryError} - Thrown on error during preparation. | ||
*/ | ||
export async function prepareDelegateAuthorizationExtrinsic( |
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 function also requires did.authorizeTx()
to be implemented for prepare...
.
Refer dispatchUpdateTxCapacityToChain()
.
The idea of prepare and dispatch is to separate authorising
from did and signing
from account.
throw new SDKErrors.CordDispatchError( | ||
`Error dispatching delegate authorization: ${error}` | ||
) | ||
if (error instanceof Error) { |
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.
Single error is enough as both mean the same.
…d made error single
@vatsa287 I have made suggested changes, please review them and regarding "DID" I have a minor confusion..we have used import "* as Did" and the code doesn't have DID class so, if I use Did.DID is fine? And if not , how should I Pass the DID object for authorization.? |
Description
Separate Delegate Authorization preparation and dispatch of extrinsic to chain. This would help when bulk transaction takes place so we just prepare all the required extrinsics and then execute these transaction in batches by dumping them into a promise using
a batch sign & submit utility ex, authorizeBatch which can take array of extrinsics, instead of just one. (#201 )
Goals:
prepareDelegateAuthorizationExtrinsic()
: This function consolidates thedispatchDelegateAuthorizationTx
andDid.authorizeTx()
logic.dispatchDelegateAuthorization()
: The existing function now integrates the new preparation function and handles extrinsics dispatch separately.This change will improve the process when dealing with multiple transactions by enabling batch signing and submission.
Changes made:
prepareDelegateAuthorizationExtrinsic()
function that handles both extrinsic preparation and authorization.dispatchDelegateAuthorization()
to utilize the new function for better separation of concerns.