Skip to content

add CLI command verifyValidator#4933

Closed
chrlschwb wants to merge 47 commits intoJoystream:masterfrom
chrlschwb:fix/4930-addCommandValidatorVerify
Closed

add CLI command verifyValidator#4933
chrlschwb wants to merge 47 commits intoJoystream:masterfrom
chrlschwb:fix/4930-addCommandValidatorVerify

Conversation

@chrlschwb
Copy link
Copy Markdown
Contributor

@chrlschwb chrlschwb commented Oct 15, 2023

Copy link
Copy Markdown
Collaborator

@thesan thesan left a comment

Choose a reason for hiding this comment

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

TBH I don't know anything about the CLI. @zeeshanakram3 could you check this PR please ?

@thesan thesan requested a review from zeeshanakram3 October 18, 2023 17:37
@thesan thesan added CLI Command Line Interface Tool community-dev and removed query-node labels Nov 30, 2023
Comment on lines +8 to +19
static args = [{
name: "memberId",
required: true,
description: 'Membership ID of the validator to verify',
},
{

name: "isVerified",
required: true,
description: 'Verification state of the validator',
}
]
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.

Please use flags instead of args. Using flags you have to explicitly write each flag name before providing the value, so less chance of errors, as compared to args which are just order dependant positional arguments

if (!worker) {
this.error('Only membership WG lead/worker can perform this command')
} else {
this.getOriginalApi().tx.membershipWorkingGroup.workerRemark(Number(worker), message)
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.

This line just only prepares the encodedtx. It actually does not sends/broadcasts it.

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.

This comment is still not resolved, please look at any example CLI implementation (e.g. memberRemark) to see how transactions are being constructed & dispatched

if (!worker) {
this.error('Only membership WG lead/worker can perform this command')
} else {
this.getOriginalApi().tx.membershipWorkingGroup.workerRemark(Number(worker), message)
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.

worker is a type of GroupMember, while you are converting it to Number. Which is obviously incorrect.

Copy link
Copy Markdown
Contributor

@zeeshanakram3 zeeshanakram3 left a comment

Choose a reason for hiding this comment

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

  • Please see this comment #4933 (comment)
  • I don't think this PR should alter yarn.lock file? Can you explain why changes are being made to yarn.lock file?

Comment on lines +36 to +38
const nowGroup = this.group

await this.setPreservedState({ defaultWorkingGroup: WorkingGroups.Membership })
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hey @zeeshanakram3 it looks to me like the code from this PR should work. I'm just wondering whether these 2 lines and the line 59 are necessary.

Could you have another look please ? This is blocking the validator dashboard QA

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.

Right, we can actually specify the working group using --group flag, so this is not necessary at all. Please remove these

description: 'Membership ID of the validator to verify',
}),
isVerified: flags.boolean({
required: true,
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.

Suggested change
required: true,
default: false,

We can't specify boolean flags as isVerified=true or isVerified=false, so the only way to signal that isVerified is true/false is by presence/absence of the flag itself, i.e.

./bin/run working-groups:verifyValidator --memberId=2 --isVerified # isVerified is 'true'
./bin/run working-groups:verifyValidator --memberId=2                     # isVerified is 'false'

Since we would define the default value of isVerified false so if we omit the flag then it was be assumed false in the command.

@thesan
Copy link
Copy Markdown
Collaborator

thesan commented Jan 24, 2024

I'm closing this one in favour of #5057

@thesan thesan closed this Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLI Command Line Interface Tool community-dev scope:validator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants