Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
66 changes: 65 additions & 1 deletion .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ reviews:
in_progress_fortune: false # Do not stall time with a message (spammy)
poem: false # Do not write a literal poem (spammy)
enable_prompt_for_ai_agents: false # Disable prompts for AI agents (spammy)

# TOKEN REVIEW INSTRUCTIONS
token_review_instructions: &token_review_instructions |
You are acting as a senior maintainer reviewing token-related code
Expand Down Expand Up @@ -684,6 +683,71 @@ reviews:
- Do NOT block the PR on them.
- Do NOT suggest fixes inline.
- Instead, aggregate all out-of-scope issues into a single comment with a list of recommendations for one or more follow-up issues that can be created.

PROTOCOL SOURCE OF TRUTH

The generated protobuf Python modules in this repository
(files ending in `_pb2.py`, `_pb2.pyi`, `_pb2_grpc.py`)
represent the authoritative contract of what the
network accepts.

Treat them as LAW for responses sent to the network.

They are the compiled form of the `.proto` definitions and
define the exact:

- message structures
- nesting
- enums
- presence semantics
- types

These files define wire format and contractual requirements —
not SDK architecture.

------------------------------------------------------------------
MANDATORY PROTO VERIFICATION
------------------------------------------------------------------

When reviewing any change that:

- constructs a protobuf message
- converts SDK objects to/from protobuf
- reads values from protobuf
- writes values into protobuf

you MUST:

1. Locate the corresponding message or service in the generated modules.
2. Compare SDK ↔ protobuf field mappings.
3. Verify:

- field names match exactly (should)
- optional vs presence handling matches
- defaults are not silently altered
- enums map correctly
- no field is invented or dropped

4. Confirm required identifiers are validated BEFORE proto construction.

If you did not perform this inspection,
you are NOT allowed to produce feedback.

------------------------------------------------------------------
WHAT CONSTITUTES A DEFECT
------------------------------------------------------------------

Report ONLY problems that cause:

- wire incompatibility
- incorrect or missing data transmission
- presence/absence errors
- semantic divergence from protobuf
- API or behavioral breakage

If protobuf alignment is correct,
a confirmation statement is expected.

path_instructions:
# --- CODEOWNERS REVIEW INSTRUCTIONS ---
- path: ".github/CODEOWNERS"
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ myenv/

# Generated protobuf files
.protos
src/hiero_sdk_python/hapi

# VS Code settings
.vscode/
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
### Tests
- Format `tests/unit/crypto_utils_test.py` with black for code style consistency (#1524)
- Standardize formatting of `tests/unit/entity_id_helper_test.py` using Black for consistent code style across the test suite (#1527)

- temp
- Added tests for ProtoBuf Training Example Implementation
- Formatted `tests/unit/get_receipt_query_test.py` with black for code style consistency. (#1537)
- format black `tests/unit/hbar*.py`.(#1538)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/hiero-ledger/hiero-sdk-python/badge)](https://scorecard.dev/viewer/?uri=github.com/hiero-ledger/hiero-sdk-python)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/10697/badge)](https://bestpractices.coreinfrastructure.org/projects/10697)
[![License](https://img.shields.io/badge/license-apache2-blue.svg)](LICENSE)

[![Python Version](https://img.shields.io/badge/python-%3E%3D3.10-blue)](https://www.python.org/)
A Python SDK for interacting with the Hedera Hashgraph platform.

>**Python compatibility:**
Expand Down
Empty file.
Empty file.
42 changes: 42 additions & 0 deletions src/hiero_sdk_python/hapi/mirror/consensus_service_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

105 changes: 105 additions & 0 deletions src/hiero_sdk_python/hapi/mirror/consensus_service_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings
from . import consensus_service_pb2 as mirror_dot_consensus__service__pb2

GRPC_GENERATED_VERSION = '1.76.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
from grpc._utilities import first_version_is_lower
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
_version_not_supported = True

if _version_not_supported:
raise RuntimeError(
f'The grpc package installed is at version {GRPC_VERSION},'
+ ' but the generated code in mirror/consensus_service_pb2_grpc.py depends on'
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
)


class ConsensusServiceStub(object):
"""*
The Mirror Service provides the ability to query a stream of Hedera Consensus Service (HCS)
messages for an HCS Topic via a specific (possibly open-ended) time range.
"""

def __init__(self, channel):
"""Constructor.

Args:
channel: A grpc.Channel.
"""
self.subscribeTopic = channel.unary_stream(
'/com.hedera.mirror.api.proto.ConsensusService/subscribeTopic',
request_serializer=mirror_dot_consensus__service__pb2.ConsensusTopicQuery.SerializeToString,
response_deserializer=mirror_dot_consensus__service__pb2.ConsensusTopicResponse.FromString,
_registered_method=True)


class ConsensusServiceServicer(object):
"""*
The Mirror Service provides the ability to query a stream of Hedera Consensus Service (HCS)
messages for an HCS Topic via a specific (possibly open-ended) time range.
"""

def subscribeTopic(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')


def add_ConsensusServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'subscribeTopic': grpc.unary_stream_rpc_method_handler(
servicer.subscribeTopic,
request_deserializer=mirror_dot_consensus__service__pb2.ConsensusTopicQuery.FromString,
response_serializer=mirror_dot_consensus__service__pb2.ConsensusTopicResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'com.hedera.mirror.api.proto.ConsensusService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
server.add_registered_method_handlers('com.hedera.mirror.api.proto.ConsensusService', rpc_method_handlers)


# This class is part of an EXPERIMENTAL API.
class ConsensusService(object):
"""*
The Mirror Service provides the ability to query a stream of Hedera Consensus Service (HCS)
messages for an HCS Topic via a specific (possibly open-ended) time range.
"""

@staticmethod
def subscribeTopic(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(
request,
target,
'/com.hedera.mirror.api.proto.ConsensusService/subscribeTopic',
mirror_dot_consensus__service__pb2.ConsensusTopicQuery.SerializeToString,
mirror_dot_consensus__service__pb2.ConsensusTopicResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
39 changes: 39 additions & 0 deletions src/hiero_sdk_python/hapi/mirror/mirror_network_service_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading