Skip to content

Conversation

@adityashirsatrao007
Copy link
Contributor

Description

This PR refactors the \�ccount_create_transaction_evm_alias.py\ example to improve readability and maintainability.

Changes

  • Split the monolithic \create_account_with_alias()\ function into focused, modular functions:
    • \generate_alias_key()\ - Generates the ECDSA key and derives the EVM alias
    • \create_account_with_alias()\ - Creates the account with the EVM address alias
    • \ etch_account_info()\ - Fetches account information from the network
    • \print_account_summary()\ - Displays the account details in a formatted way
  • Updated \main()\ to orchestrate calls to these modular functions
  • Added CHANGELOG entry

Related Issue

Closes #1017

Checklist

  • Code follows the project's coding standards
  • Example is functional and demonstrates the intended use case
  • CHANGELOG updated

Signed-off-by: Aditya Shirsatrao adityashirsatrao@gmail.com

…iero-ledger#1017)

Split monolithic create_account_with_alias() into separate functions:
- generate_alias_key(): Generate ECDSA key pair for alias
- create_account_with_alias(): Create account with EVM alias
- fetch_account_info(): Query account information
- print_account_summary(): Display account details

These functions are now called from main() for better readability and maintainability.

Signed-off-by: Aditya Shirsatrao <adityashirsatrao007@gmail.com>
Signed-off-by: adityashirsatrao007 <adityashirsatrao007@gmail.com>
Copilot AI review requested due to automatic review settings December 10, 2025 17:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR successfully refactors the account_create_transaction_evm_alias.py example to improve code organization and maintainability by breaking down a monolithic function into smaller, focused modules.

  • Split the original create_account_with_alias() function into four distinct functions with clear responsibilities
  • Improved error handling by moving exception handling to the main() function and adding explicit validation for account creation
  • Enhanced code documentation with proper docstrings for all new functions

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
examples/account/account_create_transaction_evm_alias.py Refactored into modular functions: generate_alias_key() for key generation, create_account_with_alias() for account creation, fetch_account_info() for querying, and print_account_summary() for display
CHANGELOG.md Added entry documenting the refactoring of the example

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Add newline to STEP 3 for consistent formatting
- Fix return type to AccountInfo in docstring
- Update main docstring to reflect 5 steps
- Add 'and' before last item in CHANGELOG

Signed-off-by: adityashirsatrao007 <adityashirsatrao007@gmail.com>
- Add AccountInfo import
- Add return type annotation to fetch_account_info
- Add type annotation to print_account_summary parameter

Signed-off-by: adityashirsatrao007 <adityashirsatrao007@gmail.com>
@tech0priyanshu
Copy link
Contributor

Hi @adityashirsatrao007, please sign your commit with DCO. For more details, follow the Signing Guide

@exploreriii exploreriii marked this pull request as draft December 11, 2025 08:22
Copy link
Contributor

@exploreriii exploreriii left a comment

Choose a reason for hiding this comment

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

as above please!

@exploreriii
Copy link
Contributor

you've still got to merge this please

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.

[Good First Issue]: Refactor examples/account/account_create_transaction_evm_alias.py

3 participants