Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for DID SDK compatibility #38

Merged

Conversation

AlexanderShenshin
Copy link
Contributor

This PR contains changes that were made for running Hedera DID SDK with this library (replacing current dependency).

Summary:

  • Updated PublicKey and PrivateKey classes
    • Added from_string method for PublicKey
    • Added from_bytes method for both
      • Please note that support for loading ECDSA public key from raw bytes (encoded point) is not implemented, added TODO item for this
  • Fixed protobuf conversions for Timestamp class
  • Updated retry logic for client.get_transaction_receipt
    • Removed unconditional retry
      • For example, failed transactions with UNAUTHORIZED status will not be retried
    • Added more response codes for explicit "retry list" - BUSY, RECORD_NOT_FOUND, PLATFORM_NOT_ACTIVE
    • Decreased retries amount passed by transaction classes (initially was used as timeout in seconds and we we're getting large amount of retries)
  • Moved transaction.get_receipt method implementation to base class
  • Fixed default values of transaction memo in classes (needs to be empty string)

@@ -72,7 +74,7 @@ def to_date(self) -> datetime:
Returns:
datetime: A `datetime` instance.
"""
return datetime.fromtimestamp(self.seconds) + timedelta(
return datetime.fromtimestamp(self.seconds, tz=timezone.utc) + timedelta(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was needed to fix Windows-specific issues with timestamp parsing.

As far as I see, it should not cause any issues + tests are running fine on MacOS as well.

@nadineloepfe
Copy link
Contributor

great PR, thank you so much! also for the note on ECDSA public key from raw bytes

@nadineloepfe nadineloepfe merged commit f7a2447 into hiero-ledger:main Jan 30, 2025
1 check passed
@AlexanderShenshin AlexanderShenshin deleted the did-sdk-compatibility branch January 30, 2025 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants