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: add wait_until flag, drop check_tx method #136

Merged
merged 6 commits into from
Apr 19, 2024
Merged

Conversation

telezhnaya
Copy link
Contributor

@telezhnaya telezhnaya commented Jan 11, 2024

Updated the code to match with 1.37 nearcore release
https://github.com/near/nearcore/blob/447572bb775a5954ca7a5a4b65c85b45aab9e499/chain/jsonrpc/CHANGELOG.md#023
TLDR:

  • dropped EXPERIMENTAL_check_tx method, we won't support it anymore
  • added support of new send_tx method
  • added example for send_tx
  • added support for wait_until flag to few places

We need to merge it only after 1.37 will be released

@telezhnaya telezhnaya requested a review from miraclx January 11, 2024 14:46
Copy link
Collaborator

@frol frol left a comment

Choose a reason for hiding this comment

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

@telezhnaya Thank you for contributing it ahead of time!!!

examples/query_tx.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@miraclx miraclx left a comment

Choose a reason for hiding this comment

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

lgtm ✨

src/methods/send_tx.rs Outdated Show resolved Hide resolved
let signer_account_id = utils::input("Enter the signer Account ID: ")?.parse()?;
let signer_secret_key = utils::input("Enter the signer's private key: ")?.parse()?;
let wait_until_str = utils::input("Enter the desired guaranteed execution status: ")?;
let wait_until = serde_json::from_str(&("\"".to_owned() + &wait_until_str + "\""))?;
Copy link
Contributor

@miraclx miraclx Jan 11, 2024

Choose a reason for hiding this comment

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

btw, this can be simplified:

Suggested change
let wait_until = serde_json::from_str(&("\"".to_owned() + &wait_until_str + "\""))?;
let wait_until = serde_json::from_value(json!(wait_until_str))?;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, it's not true.
I also need to put my str into quotes to create a valid json. With adding quotes, your option is the same as mine.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@telezhnaya Are you sure you tried from_value (not from_str) and pass json!(value) instead of String value? This code should work as far as I can tell.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

value should be a valid json in json!(value). If it's string, it should be quoted.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@telezhnaya This is what we meant here: a4f27a4

@telezhnaya telezhnaya force-pushed the telezhnaya/wait_until branch from 615021f to e92e6f8 Compare January 16, 2024 13:34
@telezhnaya
Copy link
Contributor Author

The only failing test fails because it really sends RPC request to mainnet which is not upgraded yet (so, the method does not work as we expect).

examples/create_account.rs Outdated Show resolved Hide resolved
@telezhnaya telezhnaya force-pushed the telezhnaya/wait_until branch 3 times, most recently from 599369b to ddc30f0 Compare January 29, 2024 22:08
@telezhnaya telezhnaya force-pushed the telezhnaya/wait_until branch from ddc30f0 to 781fa5d Compare January 29, 2024 22:10
@telezhnaya
Copy link
Contributor Author

Updated. As before, one of the tests fails because mainnet and testnet still has 1.36, waiting for the release

@khorolets
Copy link
Member

I am curious about the best approach to releasing this soon. With the ReadRPC project, we are working on a version compatible with 1.37.x nearcore that is already run on testnet. We use near-jsonrpc-client-rs heavily and would like to run on the released version rather than fork.

And for the future, we'd like to be able to use newer versions of the client before the nearcore update on the mainnet. Do you think we can adjust the release process of this crate somehow?

cc @frol @telezhnaya @kobayurii

@khorolets
Copy link
Member

Update:

We've agreed with the change on the nearcore release process to enable release candidates (RC) for the nearcore's workspace crates. Since the next testnet release we expect to have all the crates like near-jsonrpc-primitives, near-primitives and others to be released with the same *-rc.{\d} as nearcore.

The mainnet 1.37.0 release is anticipated this week, so we're not getting the necessary crates beforehand this time, but the next time it should be available 🎉

@frol
Copy link
Collaborator

frol commented Mar 11, 2024

@jaswinder6991
Copy link
Contributor

Are there any new changes needed here other than just running the CI again?
I can help if anything, we needed this merged for a project.

@frol
Copy link
Collaborator

frol commented Apr 18, 2024

I will re-open this PR to trigger CI

@frol frol closed this Apr 18, 2024
@frol frol reopened this Apr 18, 2024
@frol frol enabled auto-merge (squash) April 18, 2024 22:36
@jaswinder6991
Copy link
Contributor

jaswinder6991 commented Apr 19, 2024

Thanks Vlad, I can see that doc tests failed again. I made a PR to wait_until branch to fix this.
#139

As an aside, I see that you fixed it a month ago as well. Does the archival node only keep a months old data? or is it failing because of some other reason.
Would it be a good idea to change the test somehow rather than fixing it every month (not a big deal though but still)

@frol frol merged commit 2b4ad7b into master Apr 19, 2024
3 checks passed
@frol frol deleted the telezhnaya/wait_until branch April 19, 2024 13:11
@frol frol mentioned this pull request Apr 19, 2024
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.

5 participants