Skip to content

feat: Update PublicKey To Key In Node Create And Update#2457

Merged
aceppaluni merged 3 commits into
hiero-ledger:mainfrom
aceppaluni:keychange
Jul 21, 2026
Merged

feat: Update PublicKey To Key In Node Create And Update#2457
aceppaluni merged 3 commits into
hiero-ledger:mainfrom
aceppaluni:keychange

Conversation

@aceppaluni

Copy link
Copy Markdown
Contributor

Description:

This PR updates node create/update to use Key instead of PublicKey as per issue #2337.

Related issue(s):

Fixes #2337

Notes for reviewer:

Checklist

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

Signed-off-by: aceppaluni <aceppaluni@gmail.com>
@aceppaluni
aceppaluni requested review from a team as code owners July 20, 2026 18:39
@github-actions github-actions Bot added approved Issue has been approved by team member lang: python Uses Python programming language skill: intermediate requires some knowledge of the codebase with some defined steps to implement or examples labels Jul 20, 2026
@aceppaluni aceppaluni added reviewer: maintainer PR needs a review from the maintainer team reviewer: committer request review help from a committer python Pull requests that update python code and removed approved Issue has been approved by team member labels Jul 20, 2026
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2457      +/-   ##
==========================================
+ Coverage   95.01%   95.03%   +0.01%     
==========================================
  Files         164      164              
  Lines       10464    10464              
==========================================
+ Hits         9942     9944       +2     
+ Misses        522      520       -2     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Node create and update transactions now accept Key values for admin_key, serialize them with to_proto_key(), deserialize them with Key.from_proto_key(), and test private-key inputs produce public key protobuf bytes.

Changes

Node admin key support

Layer / File(s) Summary
Admin key type contracts
src/hiero_sdk_python/nodes/node_create_transaction.py, src/hiero_sdk_python/nodes/node_update_transaction.py
Parameter models, constructors, documentation, and setters now use Key for admin_key.
Protobuf conversion and private-key tests
src/hiero_sdk_python/nodes/node_create_transaction.py, src/hiero_sdk_python/nodes/node_update_transaction.py, tests/unit/node_create_transaction_test.py, tests/unit/node_update_transaction_test.py
Protobuf construction and parsing use generic Key conversion methods; tests verify private keys serialize public key bytes and round-trip through protobuf.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant KeyInput
  participant NodeTransaction
  participant TransactionBody
  KeyInput->>NodeTransaction: set_admin_key(Key)
  NodeTransaction->>KeyInput: to_proto_key()
  NodeTransaction->>TransactionBody: serialize admin_key
  TransactionBody->>NodeTransaction: provide admin_key
  NodeTransaction->>KeyInput: Key.from_proto_key()
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: switching node create/update admin keys from PublicKey to Key.
Description check ✅ Passed The description is directly related to the code changes and references the linked issue correctly.
Linked Issues check ✅ Passed The PR matches #2337 by updating admin_key types, serialization, and tests to support generic Key values.
Out of Scope Changes check ✅ Passed The changes stay within the node transaction update and corresponding tests, with no obvious unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
📋 Issue Planner

Built with CodeRabbit's Coding Plans for faster development and fewer bugs.

View plan used: #2337

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Signed-off-by: aceppaluni <aceppaluni@gmail.com>
@github-actions github-actions Bot added the approved Issue has been approved by team member label Jul 20, 2026
@aceppaluni aceppaluni removed the approved Issue has been approved by team member label Jul 20, 2026
@github-actions github-actions Bot added open to community review PR is open for community review and feedback queue:junior-committer PR awaiting initial quality review labels Jul 20, 2026
@hiero-ledger hiero-ledger deleted a comment from github-actions Bot Jul 20, 2026
@github-actions github-actions Bot added queue:committers PR awaiting committer technical review and removed queue:junior-committer PR awaiting initial quality review labels Jul 21, 2026
@danielmarv danielmarv added the status: update branch developer needs to click update branch label Jul 21, 2026
@github-actions github-actions Bot added the status: ready-to-merge PR has 1+ maintainer and 2+ total approvals, ready to merge label Jul 21, 2026
@github-actions github-actions Bot removed the queue:committers PR awaiting committer technical review label Jul 21, 2026
@manishdait

Copy link
Copy Markdown
Contributor

@aceppaluni, please rebase the branch

@github-actions github-actions Bot added the approved Issue has been approved by team member label Jul 21, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: f45a0ebb-9d42-458c-a8e8-dcb6366d0eb9

📥 Commits

Reviewing files that changed from the base of the PR and between 714f833 and c7808ea.

📒 Files selected for processing (2)
  • tests/unit/node_create_transaction_test.py
  • tests/unit/node_update_transaction_test.py

Comment thread tests/unit/node_create_transaction_test.py
@aceppaluni
aceppaluni merged commit c75ed0a into hiero-ledger:main Jul 21, 2026
28 checks passed
@github-actions

Copy link
Copy Markdown

👋 Hi @aceppaluni! Great work completing a Intermediate issue! 🎉

Thanks for your contribution! 🚀

Here are some issues you might want to explore next:

🌟 Stay connected:

Happy coding! 🚀
— Hiero Python SDK Team

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Issue has been approved by team member lang: python Uses Python programming language open to community review PR is open for community review and feedback python Pull requests that update python code reviewer: committer request review help from a committer reviewer: maintainer PR needs a review from the maintainer team skill: intermediate requires some knowledge of the codebase with some defined steps to implement or examples status: ready-to-merge PR has 1+ maintainer and 2+ total approvals, ready to merge status: update branch developer needs to click update branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Node Create/Upadate Transaction to use Key instead of PublicKey

5 participants