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

Adaptor for executing smart contract queries #395

Merged
merged 3 commits into from
Mar 7, 2024
Merged

Conversation

popenta
Copy link
Contributor

@popenta popenta commented Mar 6, 2024

No description provided.

@popenta popenta self-assigned this Mar 6, 2024
@@ -21,14 +20,19 @@ interface ILegacyQuery {
getEncodedArguments(): string[];
}

interface IQueryRunner {
networkProvider: INetworkProvider;
Copy link
Contributor

Choose a reason for hiding this comment

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

This should not be needed. Generally speaking, now, the queries controller should not know about any network provider.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, removed

}

export class SmartContractQueriesAdapter {
networkProvider: INetworkProvider;
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 private, readonly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

made it private, readonly

import { SmartContractQuery, SmartContractQueryResponse } from "../smartContractQuery";

interface INetworkProvider {
queryContract(query: ILegacyQuery): Promise<IContractQueryResponse>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed.

this.networkProvider = options.networkProvider;
}

async queryContract(query: SmartContractQuery): Promise<SmartContractQueryResponse> {
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

src/adapters/smartContractQueriesAdapter.ts Outdated Show resolved Hide resolved
@@ -21,14 +20,19 @@ interface ILegacyQuery {
getEncodedArguments(): string[];
}

interface IQueryRunner {
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@popenta popenta merged commit 7cd9085 into feat/next Mar 7, 2024
1 check passed
@popenta popenta deleted the sc-query-adapter branch March 7, 2024 10:07
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