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

Finish APIs for Transaction, Query, and a lot of internal classes #503

Merged
merged 9 commits into from
Sep 19, 2023

Conversation

rwalworth
Copy link
Contributor

@rwalworth rwalworth commented Sep 14, 2023

Description:
This PR finishes up and completes all API implementations for Transaction, Query, and a lot of the internal utility classes used by the SDK (such as BaseNetwork and derived classes, BaseNode and derived classes, etc.). There were quite a few changes and reworks of processing and I will try to highlight all of them here.

This PR, which originally started as a PR to implement the ConsensusPubSubChunkedExample, turned into a whole Executable processing overhaul which now matches more closely with how other Hedera SDKs operate.

Major changes:

  • Add ConsensusPubSubChunkedExample, which shows users how to send and subscribe to large topic messages.
  • Transactions now properly pre-generate Transaction protobuf objects for a random 1/3 of the selected Client network’s nodes.
  • All Transaction APIs are now implemented.
  • Query cost is queried from the network and properly added to the Query as it is sent as a TransferTransaction to its header.
  • All Query APIs are now implemented.
  • ChunkedTransactions add their data correctly to each chunk as it is sent, as opposed to copying a whole new ChunkedTransaction and sending only a portion of the data.
  • All ChunkedTransaction APIs are now implemented.
  • Common backend network processing for Network, MirrorNetwork, Node, MirrorNode, etc. was consolidated into base classes (i.e. BaseNode, BaseNetwork, BaseNodeAddress). These APIs were fully implemented as well.
  • Completed all APIs for NodeAddress and NodeAddressBook.

Other changes:

  • sign and getNodesWithAccountIds APIs removed from Client. Now getNetwork() can be called to get the Network object and get Nodes that way (which lines up with how other SDKs do it). This is done in Executable via the getNodesFromNodeAccountIds() and getNodeIndexForExecute() private functions.
  • toSignaturePairProtobuf() added for PublicKey classes.
  • makeRequest() and submitRequest() function signatures changed for Executable derived classes that better streamline creating and sending protobufs to the network.
  • isKnownNetwork() added to LedgerId which allows a user to determine if the ledger represented by that LedgerId is known (i.e. Mainnet, Testnet, or Previewnet).
  • fromBytes() added to PublicKey, which allows a PublicKey to be created from raw bytes.
  • operator!= and less<Hedera::TransactionId> added to TransactionId.
  • MaxQueryPaymentExceededException added.
  • Update all derived Transaction unit tests setter/getter tests to properly be allowed to freeze (set node account ID and transaction ID).
  • Add tests for Transaction::fromBytes() that deserializes TransactionList protobuf objects.

Related issue(s):

Fixes #496

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@rwalworth rwalworth added Feature Enhancement Enhancing an existing feature driven by business requirements. Typically backwards compatible. New Feature A new feature, service, or documentation. Major changes that are not backwards compatible. labels Sep 14, 2023
@rwalworth rwalworth requested a review from deyanzz September 14, 2023 15:04
@rwalworth rwalworth self-assigned this Sep 14, 2023
@rwalworth rwalworth linked an issue Sep 14, 2023 that may be closed by this pull request
@rwalworth rwalworth marked this pull request as ready for review September 18, 2023 22:42
Signed-off-by: Rob Walworth <[email protected]>
Copy link
Contributor

@deyanzz deyanzz left a comment

Choose a reason for hiding this comment

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

Apart this PR introduces huge amount of changes, I reviewed most of them and they are looking good to me.

@rwalworth rwalworth merged commit 90da24a into main Sep 19, 2023
2 checks passed
@rwalworth rwalworth deleted the 00496-add-consensuspubsubchunkedexample branch September 19, 2023 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Enhancement Enhancing an existing feature driven by business requirements. Typically backwards compatible. New Feature A new feature, service, or documentation. Major changes that are not backwards compatible.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ConsensusPubSubChunkedExample
2 participants