Add proof-measure client + Gitea PyPI publish; bump to 0.4.0
All checks were successful
Publish to PyPI Registry / publish (release) Successful in 1m14s
All checks were successful
Publish to PyPI Registry / publish (release) Successful in 1m14s
proof-measure is a separate, public, unauthenticated Dragonchain service. Adds: - UnauthenticatedClient: HMAC-free transport mirroring Client (session injection, allow_redirects=False, from_dict decoding). - ProofMeasureClient: get_security / report / health; default base URL https://proof-measure.dragonchain.com. Standalone (ProofMeasureClient()) and via DragonchainSDK.proof_measure. - Proof-measure dataclass models (decimals as strings, timestamps as int). - .gitea/workflows/publish.yml: build + twine upload to the Gitea PyPI registry on release (the SDK had no publish workflow before). Also fixes 3 pre-existing failing tests: _FakeSession.request didn't accept the allow_redirects kwarg the client now passes (added by the prior redirect change), so the suite was red at HEAD.
This commit is contained in:
@@ -71,11 +71,24 @@ from .models import (
|
||||
TransactionTypeCreateResponse,
|
||||
VerificationBlock,
|
||||
)
|
||||
from .models import (
|
||||
AnchorSecurity,
|
||||
HashPower,
|
||||
HealthResponse,
|
||||
RawMeasure,
|
||||
ReportAnchorInput,
|
||||
ReportRequest,
|
||||
SecurityResult,
|
||||
TransactionReport,
|
||||
)
|
||||
from .proof_measure import DEFAULT_BASE_URL as PROOF_MEASURE_DEFAULT_BASE_URL
|
||||
from .proof_measure import ProofMeasureClient
|
||||
from .system import SystemClient
|
||||
from .transaction import TransactionClient
|
||||
from .transaction_type import TransactionTypeClient
|
||||
from .unauthenticated_client import UnauthenticatedClient
|
||||
|
||||
__version__ = "0.2.0"
|
||||
__version__ = "0.4.0"
|
||||
|
||||
|
||||
class DragonchainSDK:
|
||||
@@ -111,6 +124,10 @@ class DragonchainSDK:
|
||||
self.contract = ContractClient(self._client)
|
||||
self.block = BlockClient(self._client)
|
||||
self.system = SystemClient(self._client)
|
||||
# proof-measure is a separate, unauthenticated public service; this
|
||||
# handle targets its default public endpoint. For a custom endpoint
|
||||
# construct a ``ProofMeasureClient`` directly.
|
||||
self.proof_measure = ProofMeasureClient()
|
||||
|
||||
def get_client(self) -> Client:
|
||||
"""Return the underlying HTTP client (advanced use)."""
|
||||
@@ -128,6 +145,9 @@ __all__ = [
|
||||
"SystemClient",
|
||||
"TransactionClient",
|
||||
"TransactionTypeClient",
|
||||
"ProofMeasureClient",
|
||||
"UnauthenticatedClient",
|
||||
"PROOF_MEASURE_DEFAULT_BASE_URL",
|
||||
# models
|
||||
"Block",
|
||||
"BlockHeader",
|
||||
@@ -155,4 +175,13 @@ __all__ = [
|
||||
"TransactionTypeCreateRequest",
|
||||
"TransactionTypeCreateResponse",
|
||||
"VerificationBlock",
|
||||
# proof-measure models
|
||||
"RawMeasure",
|
||||
"SecurityResult",
|
||||
"ReportAnchorInput",
|
||||
"ReportRequest",
|
||||
"AnchorSecurity",
|
||||
"HashPower",
|
||||
"TransactionReport",
|
||||
"HealthResponse",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user