-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: implement validators commands #162
base: main
Are you sure you want to change the base?
Conversation
…-version-is-released
…-released' into 59-implement-validators-commands
} | ||
} | ||
|
||
private async confirmPrompt(message: string): Promise<void> { |
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.
@epsjunior this seems like a generic function that could be part of a super Action class inherited by all the actions
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.
done
} | ||
} | ||
|
||
public async createValidator(options: CreateValidatorOptions): Promise<void> { |
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.
@epsjunior I like this interactive approach, but we also need to provide a way to pass all the parameters from the command itself. Otherwise, implementing other tools without human interaction that use the CLI to perform actions on GenLayer wouldn't be possible.
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.
done
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.
sorry, I missed this one in the previous review
.command("create-random") | ||
.description("Create random validators") | ||
.option("--count <count>", "Number of validators to create", "1") // Default to "1" | ||
.option( |
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.
@epsjunior we are also missing the --models option to match the endpoint full parameters: https://github.com/yeagerai/genlayer-studio/blob/main/backend/protocol_rpc/endpoints.py#L190
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #162 +/- ##
========================================
Coverage ? 100.00%
========================================
Files ? 26
Lines ? 1266
Branches ? 311
========================================
Hits ? 1266
Misses ? 0
Partials ? 0 ☔ View full report in Codecov by Sentry. |
Summary
This PR introduces new features, bug fixes, and comprehensive tests for validator commands and the JSON RPC client. It also resolves a critical bug that prevented proper error handling in JSON RPC requests, causing related commands to fail silently.
Changes Introduced
New Features
Validator Commands:
create
,update
,delete
,count
,create-random
, andget
.Enhanced JSON RPC Client:
Simulator Service Improvements:
createRandomValidators
anddeleteAllValidators
to match the correct RPC API.Bug Fixes
JSON RPC Client:
Simulator Service:
Validators Action:
create
,update
, andcreate-random
.Tests Added
Notes
How to Test
create
,update
,delete
, etc.) to ensure correct operation.Related Links
ebdeeef