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 async builders for view_* functions #218

Merged
merged 26 commits into from
Oct 31, 2022
Merged

Conversation

ChaoticTempest
Copy link
Member

This adds the async builder Query which allows doing view calls into contract state, account, access keys, code, the view function call, and block. This uses IntoFuture to allow calling into .await at any point in the builder. Note, that Query builder takes a generic <T> for the method like ViewState since we can define custom builder functions per method type by doing impl Query<ViewState> { ... }

cc @matklad if you want to review my use of IntoFuture since you initially suggested it

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
workspaces/src/rpc/query.rs Outdated Show resolved Hide resolved
workspaces/src/rpc/query.rs Outdated Show resolved Hide resolved
workspaces/src/worker/impls.rs Show resolved Hide resolved
workspaces/tests/deploy.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@matklad matklad left a comment

Choose a reason for hiding this comment

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

IntoFuture stuff looks correct to me.

What caught my eye is that we are enduring some pain (and even causing the users paint) to be generic over &str vs String. Did we measured that using &str gives us a measurable performance improvements? If we did not, I suggest sticking with owned String and clone, and removing extra generics from the API.

examples/src/status_message.rs Show resolved Hide resolved
workspaces/Cargo.toml Outdated Show resolved Hide resolved
workspaces/src/operations.rs Outdated Show resolved Hide resolved
workspaces/src/rpc/query.rs Outdated Show resolved Hide resolved
workspaces/src/rpc/query.rs Outdated Show resolved Hide resolved
workspaces/src/operations.rs Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
@ChaoticTempest ChaoticTempest merged commit fdd2864 into main Oct 31, 2022
@ChaoticTempest ChaoticTempest deleted the feat/view-builders branch October 31, 2022 23:11
@ChaoticTempest ChaoticTempest mentioned this pull request Aug 11, 2023
3 tasks
@frol frol mentioned this pull request Oct 4, 2023
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