-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #819 from HathorNetwork/release-candidate
Release v0.57.0
- Loading branch information
Showing
144 changed files
with
1,871 additions
and
1,224 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
codecov: | ||
branch: dev | ||
branch: master | ||
|
||
coverage: | ||
# https://docs.codecov.com/docs/coverage-configuration | ||
|
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 |
---|---|---|
|
@@ -24,7 +24,6 @@ jobs: | |
- python | ||
- pypy | ||
python-version: | ||
- '3.9' | ||
- '3.10' | ||
- '3.11' | ||
exclude: | ||
|
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
32 changes: 32 additions & 0 deletions
32
hathor/cli/events_simulator/event_forwarding_websocket_factory.py
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,32 @@ | ||
# Copyright 2023 Hathor Labs | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from typing import Any | ||
|
||
from twisted.internet.interfaces import IAddress | ||
|
||
from hathor.cli.events_simulator.event_forwarding_websocket_protocol import EventForwardingWebsocketProtocol | ||
from hathor.event.websocket import EventWebsocketFactory | ||
from hathor.simulator import Simulator | ||
|
||
|
||
class EventForwardingWebsocketFactory(EventWebsocketFactory): | ||
def __init__(self, simulator: Simulator, *args: Any, **kwargs: Any) -> None: | ||
self._simulator = simulator | ||
super().__init__(*args, **kwargs) | ||
|
||
def buildProtocol(self, _: IAddress) -> EventForwardingWebsocketProtocol: | ||
protocol = EventForwardingWebsocketProtocol(self._simulator) | ||
protocol.factory = self | ||
return protocol |
47 changes: 47 additions & 0 deletions
47
hathor/cli/events_simulator/event_forwarding_websocket_protocol.py
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,47 @@ | ||
# Copyright 2023 Hathor Labs | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
from autobahn.websocket import ConnectionRequest | ||
|
||
from hathor.event.websocket import EventWebsocketProtocol | ||
from hathor.simulator import Simulator | ||
|
||
if TYPE_CHECKING: | ||
from hathor.cli.events_simulator.event_forwarding_websocket_factory import EventForwardingWebsocketFactory | ||
|
||
|
||
class EventForwardingWebsocketProtocol(EventWebsocketProtocol): | ||
factory: 'EventForwardingWebsocketFactory' | ||
|
||
def __init__(self, simulator: Simulator) -> None: | ||
self._simulator = simulator | ||
super().__init__() | ||
|
||
def onConnect(self, request: ConnectionRequest) -> None: | ||
super().onConnect(request) | ||
self._simulator.run(60) | ||
|
||
def onOpen(self) -> None: | ||
super().onOpen() | ||
self._simulator.run(60) | ||
|
||
def onClose(self, wasClean: bool, code: int, reason: str) -> None: | ||
super().onClose(wasClean, code, reason) | ||
self._simulator.run(60) | ||
|
||
def onMessage(self, payload: bytes, isBinary: bool) -> None: | ||
super().onMessage(payload, isBinary) | ||
self._simulator.run(60) |
Oops, something went wrong.