-
Notifications
You must be signed in to change notification settings - Fork 30
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 #319 from InjectiveLabs/feat/refactor_network_mixe…
…d_secure_insecure_channels feat/refactor_network_mixed_secure_insecure_channels
- Loading branch information
Showing
6 changed files
with
163 additions
and
33 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
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,28 @@ | ||
from warnings import catch_warnings | ||
|
||
from pyinjective.core.network import DisabledCookieAssistant, Network | ||
|
||
|
||
class TestNetworkDeprecationWarnings: | ||
def test_use_secure_connection_parameter_deprecation_warning(self): | ||
with catch_warnings(record=True) as all_warnings: | ||
Network( | ||
lcd_endpoint="lcd_endpoint", | ||
tm_websocket_endpoint="tm_websocket_endpoint", | ||
grpc_endpoint="grpc_endpoint", | ||
grpc_exchange_endpoint="grpc_exchange_endpoint", | ||
grpc_explorer_endpoint="grpc_explorer_endpoint", | ||
chain_stream_endpoint="chain_stream_endpoint", | ||
chain_id="chain_id", | ||
fee_denom="fee_denom", | ||
env="env", | ||
cookie_assistant=DisabledCookieAssistant(), | ||
use_secure_connection=True, | ||
) | ||
|
||
deprecation_warnings = [warning for warning in all_warnings if issubclass(warning.category, DeprecationWarning)] | ||
assert len(deprecation_warnings) == 1 | ||
assert ( | ||
str(deprecation_warnings[0].message) | ||
== "use_secure_connection parameter in Network is no longer used and will be deprecated" | ||
) |
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