Skip to content
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

generalize ec cmd to gov any committee #8385

Merged
merged 3 commits into from
Sep 29, 2023
Merged

generalize ec cmd to gov any committee #8385

merged 3 commits into from
Sep 29, 2023

Conversation

turadg
Copy link
Member

@turadg turadg commented Sep 25, 2023

closes: #8384

Description

Generalizes the ec command to a gov command. To maintain backwards compatibility it aliases that back to ec and makes the default committee names that of the EC.

It also includes some code cleanup like shape validation and keyring options.

Security Considerations

n/a

Scaling Considerations

n/a

Documentation Considerations

Backwards compatible. Usage for the command comes from the CLI help.

Testing Considerations

We really should have a test. It can be exercised in #8388 (we should update that PR to use this version and re-run those tests to confirm it still works)

Upgrade Considerations

n/a

@turadg turadg marked this pull request as ready for review September 27, 2023 14:46
@turadg turadg requested a review from iomekam September 27, 2023 15:49
Copy link
Contributor

@Chris-Hibbert Chris-Hibbert left a comment

Choose a reason for hiding this comment

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

questions and comments only. No show-stoppers for me.

packages/agoric-cli/src/commands/gov.js Outdated Show resolved Hide resolved
* instanceName?: string,
* }} detail
* @param {Awaited<ReturnType<makeRpcUtils>>} [optUtils]
*/
const processOffer = async function ({ toOffer, sendFrom }, optUtils) {
const processOffer = async function (
Copy link
Contributor

Choose a reason for hiding this comment

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

can these use arrow function style as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

i believe Commander.js relies upon the this binding.

cmd
.command('committee')
.description('accept invitation to join a committee')
.requiredOption(
Copy link
Contributor

Choose a reason for hiding this comment

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

requiredOptions can have a default value? bizarre.

Copy link
Member Author

Choose a reason for hiding this comment

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

I did it that way in case someone adds the option and as an invalid value.

const votingRight = cont.find(
it => it.instance === agoricNames.instance.economicCommittee,
);
const votingRight = cont.find(it => it.instanceName === opts.instance);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm doing type-matching by eye, and it.instanceName doesn't look like the same kind of thing as opts.instance. Is this correct? I couldn't find an actual type declaration, nor any other use of opts.instance.

Copy link
Member Author

Choose a reason for hiding this comment

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

opts comes from the CLI options so it's this up above,

    .requiredOption(
      '--instance <string>',
      'Committee name under agoricNames.instances',
      String,
      'economicCommittee',
    )

That does match the instanceName out of the result set.

@turadg turadg added the automerge:rebase Automatically rebase updates, then merge label Sep 27, 2023
@github-actions
Copy link

@turadg - This PR appears to be stuck. It's had a merge label for > 24 hours

@turadg
Copy link
Member Author

turadg commented Sep 29, 2023

@Mergifyio requeue

@mergify
Copy link
Contributor

mergify bot commented Sep 29, 2023

requeue

✅ The queue state of this pull request has been cleaned. It can be re-embarked automatically

@mergify mergify bot merged commit ae21a7e into master Sep 29, 2023
71 checks passed
@mergify mergify bot deleted the 8384-gov-cmd branch September 29, 2023 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:rebase Automatically rebase updates, then merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support in agops for multiple committees
3 participants