-
Notifications
You must be signed in to change notification settings - Fork 163
Open
Labels
Blockchain / DLTIssues engineering distributed ledger functionalityIssues engineering distributed ledger functionalityenhancementNew feature or requestNew feature or requestintermediaterequires some knowledge of the codebase with some defined steps to implement or examplesrequires some knowledge of the codebase with some defined steps to implement or examplespythonUses Python programming languageUses Python programming language
Description
The protobuf ContractGetInfoResponse.ContractInfo message includes a staking_info field that provides staking-related metadata for contracts. This field is already supported and exposed in the other SDK, but it is currently missing from the Python SDK ContractInfo class.
Proposed Solution
- Add a new optional field to the Python ContractInfo class:
staking_info: Optional[StakingInfo] = None
- Update
from_proto()to correctly deserialize staking data:# eg @classmethod def _from_proto(cls, proto: ContractGetInfoResponse.ContractInfo) -> "ContractInfo": ... return cls( ..., staking_info=( StakingInfo.from_proto(proto.stakingInfo) if proto.HasField("stakingInfo") else None ) )
- Update to_proto to serialize staking data back to protobuf:
def _to_proto(self) -> ContractGetInfoResponse.ContractInfo: .... return ContractGetInfoResponse.ContractInfo( ..., staking_info=( self.staking_info.to_proto() if self.staking_info is not None else None ) )
- Ensure unit test for fromBytes / toBytes round-tripping includes staking information once added.
Metadata
Metadata
Assignees
Labels
Blockchain / DLTIssues engineering distributed ledger functionalityIssues engineering distributed ledger functionalityenhancementNew feature or requestNew feature or requestintermediaterequires some knowledge of the codebase with some defined steps to implement or examplesrequires some knowledge of the codebase with some defined steps to implement or examplespythonUses Python programming languageUses Python programming language