-
Notifications
You must be signed in to change notification settings - Fork 685
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make JSON-RPC Server an isolated plugin
- Loading branch information
Showing
29 changed files
with
397 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from typing import ( | ||
Type, | ||
) | ||
|
||
from lahja import ( | ||
BaseEvent, | ||
BaseRequestResponseEvent, | ||
) | ||
|
||
|
||
class PeerCountResponse(BaseEvent): | ||
|
||
def __init__(self, peer_count: int) -> None: | ||
self.peer_count = peer_count | ||
|
||
|
||
class PeerCountRequest(BaseRequestResponseEvent[PeerCountResponse]): | ||
|
||
@staticmethod | ||
def expected_response_type() -> Type[PeerCountResponse]: | ||
return PeerCountResponse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from trinity.utils.async_dispatch import ( | ||
async_method, | ||
) | ||
|
||
|
||
class AsyncChainMixin: | ||
|
||
coro_get_canonical_block_by_number = async_method('get_canonical_block_by_number') | ||
coro_get_block_by_hash = async_method('get_block_by_hash') | ||
coro_get_block_by_header = async_method('get_block_by_header') |
Oops, something went wrong.