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

Implemented config reset command #401

Merged
merged 7 commits into from
Jan 19, 2024
Merged

Implemented config reset command #401

merged 7 commits into from
Jan 19, 2024

Conversation

popenta
Copy link
Contributor

@popenta popenta commented Jan 18, 2024

Implemented a new command mxpy config reset that can be used to delete the mxpy.json config file.

@popenta popenta self-assigned this Jan 18, 2024
Comment on lines 115 to 116
answer = input(f"The file `{str(file)}` will be deleted. Do you want to continue? (y/n)")
if answer.lower() not in ["y", "yes"]:
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe also strip spaces in answer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

proxy = ProxyNetworkProvider("https://devnet-api.multiversx.com")
proxy = ProxyNetworkProvider("https://testnet-api.multiversx.com")
Copy link
Contributor

Choose a reason for hiding this comment

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

so do we change to testnet in tests? or it was just temporarly for testing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because of the devnet situation, the tests we're failing, so that's why I switched to testnet. We can switch for now because it seems it'a a little bit more stable.

pyproject.toml Outdated
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "multiversx-sdk-cli"
version = "9.3.0"
version = "9.3.1"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be 9.4.0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

logger.info("Successfully deleted the config file")


def confirm_continuation(file: Path):
Copy link
Contributor

Choose a reason for hiding this comment

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

The function can be renamed to contain the specific action (e.g. deletion of the file), or it can be changed to receive the message as a parameter - and then it will be a more generic function (e.g. maybe for ux.py).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved the function in ux.py and made it more generic.

"--value", "1250000000000000000000",
"--total-delegation-cap", "10000000000000000000000",
"--service-fee", "100",
"--proxy", "https://testnet-api.multiversx.com"
"--chain", "T"
Copy link
Contributor

Choose a reason for hiding this comment

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

Proxy not needed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, because we are not sending the transaction. We used the proxy just to get the nonce which in our test it's not really relevant.

@popenta popenta merged commit a7588b8 into feat/next Jan 19, 2024
11 checks passed
@popenta popenta deleted the mxpy-config-reset branch January 19, 2024 14:01
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.

3 participants