bittensor.core.extrinsics.utils#
Module with helper functions for extrinsics.
Functions#
|
Submits an extrinsic to the substrate blockchain and handles potential exceptions. |
Module Contents#
- bittensor.core.extrinsics.utils.submit_extrinsic(substrate, extrinsic, wait_for_inclusion, wait_for_finalization)[source]#
Submits an extrinsic to the substrate blockchain and handles potential exceptions.
This function attempts to submit an extrinsic to the substrate blockchain with specified options for waiting for inclusion in a block and/or finalization. If an exception occurs during submission, it logs the error and re-raises the exception.
- Parameters:
substrate (substrateinterface.SubstrateInterface) – The substrate interface instance used to interact with the blockchain.
extrinsic (scalecodec.types.GenericExtrinsic) – The extrinsic to be submitted to the blockchain.
wait_for_inclusion (bool) – Whether to wait for the extrinsic to be included in a block.
wait_for_finalization (bool) – Whether to wait for the extrinsic to be finalized on the blockchain.
- Returns:
The response from the substrate after submitting the extrinsic.
- Return type:
response
- Raises:
SubstrateRequestException – If the submission of the extrinsic fails, the error is logged and re-raised.