File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,10 @@ class Constants:
33
33
"latent-lite" : latent_lite_entrypoint ,
34
34
"subvortex" : subvortex_entrypoint ,
35
35
}
36
+ genesis_block_hash_map = {
37
+ "finney" : "0x2f0555cc76fc2840a25a6ea3b9637146806f1f44b090c175ffde2a7e5ab36c03" ,
38
+ "test" : "0x8f9cf856bf558a14440e75569c9e58594757048d7b3a84b5d25f6bd978263105" ,
39
+ }
36
40
delegates_detail_url = "https://raw.githubusercontent.com/opentensor/bittensor-delegates/main/public/delegates.json"
37
41
38
42
Original file line number Diff line number Diff line change 16
16
from rich .padding import Padding
17
17
from rich .prompt import Confirm
18
18
19
- from bittensor_cli .src import COLOR_PALETTE , COLORS
19
+ from bittensor_cli .src import COLOR_PALETTE , COLORS , Constants
20
20
from bittensor_cli .src .bittensor import utils
21
21
from bittensor_cli .src .bittensor .balances import Balance
22
22
from bittensor_cli .src .bittensor .chain_data import (
@@ -1594,6 +1594,19 @@ async def find_coldkey_swap_extrinsic(
1594
1594
- execution_block: Block number when swap will execute
1595
1595
Empty dict if not found
1596
1596
"""
1597
+
1598
+ current_block , genesis_block = await asyncio .gather (
1599
+ subtensor .substrate .get_block_number (),
1600
+ subtensor .substrate .get_block_hash (0 )
1601
+ )
1602
+ if (
1603
+ current_block - start_block > 300
1604
+ and genesis_block == Constants .genesis_block_hash_map ["finney" ]
1605
+ ):
1606
+ console .print ("Querying archive node for coldkey swap events..." )
1607
+ await subtensor .substrate .close ()
1608
+ subtensor = SubtensorInterface ("archive" )
1609
+
1597
1610
block_hashes = await asyncio .gather (
1598
1611
* [
1599
1612
subtensor .substrate .get_block_hash (block_num )
You can’t perform that action at this time.
0 commit comments