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

Add error messages for contradicting flags #330

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

betasve
Copy link

@betasve betasve commented Oct 29, 2024

Aims to fix the issue mentioned here #290

@betasve betasve mentioned this pull request Nov 4, 2024
Copy link
Contributor

@EnriqueL8 EnriqueL8 left a comment

Choose a reason for hiding this comment

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

A few typos and would recommend adding a test

cmd/init.go Outdated
@@ -260,6 +268,20 @@ func validatePrivateTransactionManagerBlockchainConnectorCombination(privateTran
return nil
}

func validateRemoteNodeVsBlockChainNodeFlags(remoteNodeUrl, blockchainNodePorvider string) error {
if len(remoteNodeUrl) != 0 && blockchainNodePorvider != "geth" {
return errors.New("`remote-noted-url` and `blockchain-node` can't both be specified")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return errors.New("`remote-noted-url` and `blockchain-node` can't both be specified")
return errors.New("Both flags `remote-node-url` and `blockchain-node` can't be specified")

Copy link
Author

Choose a reason for hiding this comment

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

hi @EnriqueL8, thanks for your review. I will correct the text and look for a place where to place the test.

Copy link
Author

Choose a reason for hiding this comment

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

hi @EnriqueL8, now that I took a deeper look, I remembered why I didn't provide tests initially. I didn't find any of the initCommon behavior to have been tested. Can you please let me know if I'm mistaken, or if not - and still a test needs to be written for this part - where, according to the practices of this repo, shall it be?

Thanks in advance for your help.

Copy link
Contributor

@EnriqueL8 EnriqueL8 Nov 19, 2024

Choose a reason for hiding this comment

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

okay this might be more significant work to establish a test framework for these

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants