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 watchGas CLI command #412

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

gtsonevv
Copy link
Collaborator

@gtsonevv gtsonevv commented Sep 30, 2024

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • Commit messages follow the conventional commits spec
  • If this is a code change: I have written unit tests.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

Test Plan

Related issues/PRs

Comment on lines +89 to +102
.addCommand(
new Command("watchGas")
.usage("[target] [methodName params...] [methodName params...]")
.description(
"Measure gas used for a contract method. Run this command after deploying the contract."
)
.argument(
"[target]",
"Target file path and name. (e.g., ./build/counter.wasm)"
)
.argument(
"[...methodCalls]", "Method calls with their parameters (e.g., increase n=5 decrease n=2)"
)
.action(measureGas)
Copy link
Contributor

Choose a reason for hiding this comment

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

How is it different from using near.cli.rs and watching for "Gas burned" in the output?

image
$ near contract call-function as-transaction qq.frol8.testnet f1 json-args '{}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR'

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

All transactions here are executed on sandbox env. The idea of this command was to make it easier for new people to start working with near-sdk-js.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hey @frol, should we close this PR?

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

Successfully merging this pull request may close these issues.

2 participants