-
Notifications
You must be signed in to change notification settings - Fork 157
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
fix(cli) - fix wrong condition check in contracts deployment #763
Conversation
let initialVoiceCreditProxyContractAddress: string | ||
if (initialVoiceCreditProxy === undefined) { | ||
// check if we have the amount of credits to set, or use the default | ||
const initialVoiceCredits = args.initial_voice_credits ? args.initial_voice_credits : DEFAULT_INITIAL_VOICE_CREDITS |
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.
Keep in mind that DEFAULT_INITIAL_VOICE_CREDITS
is being imported fromdefaults.ts
. Even though it's intended to serve as a default value here, there's no guarantee that it will always be defined in the external file. It's worth ensuring that there's a safeguard or check in place to handle potential undefined values from external imports.
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.
if someone goes out of their way to remove the entry from defaults.ts
then the code will not compile as create.ts it's importing something that does not exist
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.
yeah this isn't a major issue, but optionally, for the sake of robustness, you might consider adding a safeguard for DEFAULT_INITIAL_VOICE_CREDITS
. Even if defaults.ts
is present and being imported, there's no strict guarantee that DEFAULT_INITIAL_VOICE_CREDITS
will be consistently defined within that file. A safeguard or a check could make the code more resilient and aligned with best practices of treating external dependencies with caution.
…to fix/voice-credits-cli
Re-triggered the failed e2e test. Once that passes, this PR should be good to go for merging. |
I'm debugging the failure, so will probably fail again. will let you know once it's fixed. |
…to fix/voice-credits-cli
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.
LGTM
fix #762