Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Add --from to global command options #5451

Merged
merged 2 commits into from
Aug 19, 2022

Conversation

sukanyaparashar
Copy link
Contributor

@sukanyaparashar sukanyaparashar commented Aug 17, 2022

This PR adds --from option to truffle global command options list, which can be used to specify an account to make calls or send transactions. This is related to #5330, where it was discussed to be a separate PR.

@sukanyaparashar sukanyaparashar marked this pull request as draft August 17, 2022 20:04
@sukanyaparashar sukanyaparashar marked this pull request as ready for review August 17, 2022 20:49
Copy link
Contributor

@gnidan gnidan left a comment

Choose a reason for hiding this comment

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

Leaving this approval for you after you decide how you feel about my suggestion :)

from: {
option: "--from <account>",
description:
"Specify the account from which to make calls or send transactions."
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if it's worth adding this word here:

Suggested change
"Specify the account from which to make calls or send transactions."
"Specify the default account from which to make calls or send transactions."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding the default word makes sense. Thanks for the suggestion, @gnidan.

@gnidan
Copy link
Contributor

gnidan commented Aug 17, 2022

Although actually we may want this PR to include the removal of from from the options in each command separately

@sukanyaparashar
Copy link
Contributor Author

Although actually we may want this PR to include the removal of from from the options in each command separately

We have the allowedGlobalOptions property for each command. Am I missing something what you meant by removal of --from from the options separately, @gnidan?

@sukanyaparashar
Copy link
Contributor Author

Hey @gnidan. I checked the commands in the core package and couldn't find any other command having --from option. I think truffle call is the only one that will use this option for now.

@gnidan
Copy link
Contributor

gnidan commented Aug 18, 2022

Hey @gnidan. I checked the commands in the core package and couldn't find any other command having --from option. I think truffle call is the only one that will use this option for now.

Oh, interesting. Most commands do support this flag today... like truffle test --from=<account> will override things, but I guess it's just not listed as an explicit option everywhere, so you'll get a warning. This is probably fine for now, but might want to revisit this later.

@sukanyaparashar
Copy link
Contributor Author

sukanyaparashar commented Aug 18, 2022

I didn't know about that. Thanks @gnidan for letting me know about it. I think we should later on(in a separate PR) add the--from option to the allowedGlobalOptions array for the commands that support it so that the warning goes away.

@sukanyaparashar sukanyaparashar merged commit f770ace into develop Aug 19, 2022
@gnidan gnidan deleted the add-from-to-global-options branch August 19, 2022 00:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants