File tree Expand file tree Collapse file tree 1 file changed +0
-32
lines changed
bittensor/core/extrinsics Expand file tree Collapse file tree 1 file changed +0
-32
lines changed Original file line number Diff line number Diff line change 20
20
from scalecodec .types import GenericExtrinsic , GenericCall
21
21
22
22
23
- def sign_and_send_with_nonce (
24
- subtensor : "Subtensor" ,
25
- call : "GenericCall" ,
26
- wallet : "Wallet" ,
27
- wait_for_inclusion : bool ,
28
- wait_for_finalization ,
29
- nonce_key : str = "hotkey" ,
30
- signing_key : str = "hotkey" ,
31
- ):
32
- keypair = getattr (wallet , nonce_key )
33
- next_nonce = subtensor .substrate .get_account_next_index (keypair .ss58_address )
34
- signing_keypair = getattr (wallet , signing_key )
35
- extrinsic = subtensor .substrate .create_signed_extrinsic (
36
- call = call ,
37
- keypair = signing_keypair ,
38
- nonce = next_nonce ,
39
- )
40
- response = subtensor .substrate .submit_extrinsic (
41
- extrinsic = extrinsic ,
42
- wait_for_inclusion = wait_for_inclusion ,
43
- wait_for_finalization = wait_for_finalization ,
44
- )
45
-
46
- if not wait_for_finalization and not wait_for_inclusion :
47
- return True , None
48
-
49
- if response .is_success :
50
- return True , None
51
-
52
- return False , format_error_message (response .error_message )
53
-
54
-
55
23
def submit_extrinsic (
56
24
subtensor : "Subtensor" ,
57
25
extrinsic : "GenericExtrinsic" ,
You can’t perform that action at this time.
0 commit comments