dhiway / cord.js

Cord JS API
Apache License 2.0
34 stars 46 forks source link

Move `signAndSubmitTx` out of the function `dispatchRegisterToChain` & `dispatchRevokeToChain` #180

Closed Vikastc closed 4 months ago

Vikastc commented 4 months ago

Issue: The authorizeBatch() function currently accepts an array of Extrinsic objects as its argument. However, when utilizing dispatchRegisterToChain(), it submits a single transaction directly to the chain.

Requirement: For bulk uploads or revocations of records in the studio.

Solution: To address this, consider removing the signAndSubmitTx() function from within dispatchRegisterToChain() and instead have it return only the extrinsic. The same has to be done for dispatchRevokeToChain()

amarts commented 4 months ago

Suggestion: considering the name of method is dispatchToChain(), can we move everything before sign and submit to prepareExtrinsic() method, which also can be exported from the SDK, and the dispatch also can get the extrinsic from same method.

Vikastc commented 4 months ago

That will suffice