-
Notifications
You must be signed in to change notification settings - Fork 107
refactor(examples): modularize account_create_transaction_evm_alias #1031
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
base: main
Are you sure you want to change the base?
refactor(examples): modularize account_create_transaction_evm_alias #1031
Conversation
…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>
There was a problem hiding this 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>
|
Hi @adityashirsatrao007, please sign your commit with DCO. For more details, follow the Signing Guide |
exploreriii
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above please!
|
you've still got to merge this please |
Description
This PR refactors the \�ccount_create_transaction_evm_alias.py\ example to improve readability and maintainability.
Changes
Related Issue
Closes #1017
Checklist
Signed-off-by: Aditya Shirsatrao adityashirsatrao@gmail.com