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

feat: move some flags into configs for provider and deploy #635

Merged
merged 17 commits into from
Nov 29, 2023
Merged

Conversation

shamsartem
Copy link
Collaborator

No description provided.

@shamsartem shamsartem self-assigned this Nov 23, 2023
Comment on lines +69 to +73
collateralPerWorker: Number(flags["collateral-per-worker"]),
minWorkers: flags["min-workers"],
targetWorkers: flags["target-workers"],
maxWorkersPerProvider: flags["max-workers-per-provider"],
pricePerWorkerEpoch: flags["price-per-worker-epoch"],
pricePerWorkerEpoch: Number(flags["price-per-worker-epoch"]),
Copy link
Contributor

@akim-bow akim-bow Nov 28, 2023

Choose a reason for hiding this comment

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

Do you validate Number conversion somehow? What if string contains float value for example?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this command is hidden from users and only for development purposes, so I don't validate anything here

Comment on lines 146 to 149
assert(
deal !== undefined,
"Unreachable. All worker names are checked above",
);
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like this assert. If you made validation already, probably your validating function should return refined fluenceConfig.deals like a proof of validation? Probably every validation should either throw or return refined value e. g. without union with undefined or null.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can't do that easilly because as you can see the value I am itterating on comes from aqua, so the only way to avoid the assert is to pass all this to aqua just so aqua will return all of this back as a result (without actually using any of it)

return getConfigInitFunction(getInitConfigOptions())();
}

export function initReadonlyProviderConfig() {
export function initReadonlyProviderConfig(name?: string | undefined) {
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
export function initReadonlyProviderConfig(name?: string | undefined) {
export function initReadonlyProviderConfig(name?: string) {

Looks like in js omitting argument is the same as passing undefined directly

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah for function params this seems to be true, will apply this imporvement. This is not true for objects though, cause for objects a new key might be created with undefined inside, which would a different runtime behaviour

src/lib/multiaddres.ts Outdated Show resolved Hide resolved
@shamsartem shamsartem added the e2e label Nov 28, 2023
@shamsartem shamsartem enabled auto-merge (squash) November 28, 2023 14:45
@akim-bow
Copy link
Contributor

Looks nice!

@shamsartem shamsartem merged commit 93a3588 into main Nov 29, 2023
10 of 11 checks passed
@shamsartem shamsartem deleted the improve-ux branch November 29, 2023 13:08
shamsartem added a commit that referenced this pull request Dec 8, 2023
* feat: move some flags into configs for provider and deploy

* Apply automatic changes

* set correct default, forbid unknown properties

* fix?

* fix?

* Apply automatic changes

* fix?

* fix

* fixes

* Apply automatic changes

* fixes

* Apply automatic changes

* fixes

---------

Co-authored-by: shamsartem <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants