-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python: Introduce a new connection API that is a bit less stateful.
- Loading branch information
Showing
33 changed files
with
3,652 additions
and
66 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright (c) 2017-2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
__all__ = ["AIOGlobalClient", "AIOPartyClient", "Network", "NotSupportedError"] | ||
|
||
|
||
from .v8 import NotSupportedError | ||
from .v8_client_aio import AIOGlobalClient, AIOPartyClient | ||
from .v8_network import Network |
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,16 @@ | ||
_NS_LEDGER_ID_DEPRECATED = ( | ||
"fetching ledger_id from an event is deprecated; instead get it from the connection (or " | ||
"consider if knowing the ledger ID is important to your usecase)" | ||
) | ||
|
||
_NS_ACS_DEPRECATED = ( | ||
"acs functions are deprecated; you should keep your own store, or use contract keys to avoid " | ||
"needing to work with local state" | ||
) | ||
|
||
|
||
COMMAND_ID = "command_id is no longer accessible in the new API" | ||
WORKFLOW_ID = "workflow_id is no longer accessible in the new API" | ||
EVENT_ID = "event_id is no longer accessible in the new API" | ||
WITNESS_PARTIES = "witness_parties is no longer accessible in the new API" | ||
PARTY = "reading `party` from a connection is ambiguous when multi-party submissions are being used; consider an alternate way of determining an appropriate Party in this context" |
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,40 @@ | ||
# Copyright (c) 2017-2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
""" | ||
This module contains symbols to aid in a gradual migration of v5-v7 code to v8. These symbols will | ||
be marked as deprecated in v8, and be removed in v9. | ||
""" | ||
from typing import TypeVar | ||
|
||
from ..protocols.core import AEventHandler, ArchiveEvent, CreateEvent, InitEvent, ReadyEvent | ||
|
||
__all__ = ["ConnectionReuseWarning", "CallbackReturnValueWarning", "NotSupportedError"] | ||
|
||
InitFn = TypeVar("InitFn", bound=AEventHandler[InitEvent]) | ||
ReadyFn = TypeVar("ReadyFn", bound=AEventHandler[ReadyEvent]) | ||
CreateFn = TypeVar("CreateFn", bound=AEventHandler[CreateEvent]) | ||
ArchiveFn = TypeVar("ArchiveFn", bound=AEventHandler[ArchiveEvent]) | ||
DEFAULT_TIMEOUT_SECONDS = 30 | ||
|
||
|
||
class NotSupportedError(Exception): | ||
""" | ||
Error raised when calling an API that exists on :class:`Network` but is not supported on | ||
:class:`ConnectionFactory`. | ||
""" | ||
|
||
|
||
class ConnectionReuseWarning(DeprecationWarning): | ||
""" | ||
Warning raised when Network.aio_party or Network.simple_party are called more than once with | ||
the same party literal. Connection sharing will no longer explicitly be provided by dazl in the | ||
v8 API; any connection sharing must be instead managed by your application. | ||
""" | ||
|
||
|
||
class CallbackReturnValueWarning(DeprecationWarning): | ||
""" | ||
Warning raised when a callback returns a value instead of directly submitting a command itself. | ||
This style of callback is not supported by the dazl v8 API. | ||
""" |
Oops, something went wrong.