File tree Expand file tree Collapse file tree 4 files changed +44
-4
lines changed Expand file tree Collapse file tree 4 files changed +44
-4
lines changed Original file line number Diff line number Diff line change 2
2
3
3
from chia .apis .api_protocol_registry import ApiProtocolRegistry
4
4
from chia .apis .harvester_stub import HarvesterApiStub
5
+ from chia .apis .timelord_stub import TimelordApiStub
5
6
6
- __all__ = ["ApiProtocolRegistry" , "HarvesterApiStub" ]
7
+ __all__ = ["ApiProtocolRegistry" , "HarvesterApiStub" , "TimelordApiStub" ]
Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
3
from chia .apis .harvester_stub import HarvesterApiStub
4
+ from chia .apis .timelord_stub import TimelordApiStub
4
5
from chia .farmer .farmer_api import FarmerAPI
5
6
from chia .full_node .full_node_api import FullNodeAPI
6
7
from chia .introducer .introducer_api import IntroducerAPI
7
8
from chia .protocols .outbound_message import NodeType
8
9
from chia .server .api_protocol import ApiProtocol
9
- from chia .timelord .timelord_api import TimelordAPI
10
10
from chia .wallet .wallet_node_api import WalletNodeAPI
11
11
12
12
ApiProtocolRegistry : dict [NodeType , type [ApiProtocol ]] = {
13
13
NodeType .FULL_NODE : FullNodeAPI ,
14
14
NodeType .WALLET : WalletNodeAPI ,
15
15
NodeType .INTRODUCER : IntroducerAPI ,
16
- NodeType .TIMELORD : TimelordAPI ,
16
+ NodeType .TIMELORD : TimelordApiStub ,
17
17
NodeType .FARMER : FarmerAPI ,
18
18
NodeType .HARVESTER : HarvesterApiStub ,
19
19
}
Original file line number Diff line number Diff line change
1
+ from __future__ import annotations
2
+
3
+ import logging
4
+ from typing import TYPE_CHECKING , ClassVar , cast
5
+
6
+ if TYPE_CHECKING :
7
+ from chia .server .api_protocol import ApiProtocol
8
+
9
+ # Minimal imports to avoid circular dependencies
10
+ from chia .protocols import timelord_protocol
11
+ from chia .protocols .timelord_protocol import NewPeakTimelord
12
+ from chia .server .api_protocol import ApiMetadata
13
+
14
+
15
+ class TimelordApiStub :
16
+ """Lightweight API stub for TimelordAPI to break circular dependencies."""
17
+
18
+ if TYPE_CHECKING :
19
+ _protocol_check : ClassVar [ApiProtocol ] = cast ("TimelordApiStub" , None )
20
+
21
+ log : logging .Logger
22
+ metadata : ClassVar [ApiMetadata ] = ApiMetadata ()
23
+
24
+ def ready (self ) -> bool :
25
+ """Check if the timelord is ready."""
26
+ return True
27
+
28
+ @metadata .request ()
29
+ async def new_peak_timelord (self , new_peak : NewPeakTimelord ) -> None :
30
+ """Handle new peak from full node."""
31
+
32
+ @metadata .request ()
33
+ async def new_unfinished_block_timelord (
34
+ self , new_unfinished_block : timelord_protocol .NewUnfinishedBlockTimelord
35
+ ) -> None :
36
+ """Handle new unfinished block from full node."""
37
+
38
+ @metadata .request ()
39
+ async def request_compact_proof_of_time (self , vdf_info : timelord_protocol .RequestCompactProofOfTime ) -> None :
40
+ """Handle request for compact proof of time."""
Original file line number Diff line number Diff line change @@ -92,7 +92,6 @@ depends_on = [
92
92
{ path = " chia.introducer" , deprecated = false },
93
93
{ path = " chia.wallet" , deprecated = false },
94
94
{ path = " chia.full_node" , deprecated = false },
95
- { path = " chia.timelord" , deprecated = false },
96
95
{ path = " chia.protocols" , deprecated = false },
97
96
{ path = " chia.server" , deprecated = false },
98
97
]
You can’t perform that action at this time.
0 commit comments