-
Notifications
You must be signed in to change notification settings - Fork 37
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
Conversation
@@ -21,14 +20,19 @@ interface ILegacyQuery { | |||
getEncodedArguments(): string[]; | |||
} | |||
|
|||
interface IQueryRunner { | |||
networkProvider: INetworkProvider; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be private, readonly.
There was a problem hiding this comment.
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>; |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -21,14 +20,19 @@ interface ILegacyQuery { | |||
getEncodedArguments(): string[]; | |||
} | |||
|
|||
interface IQueryRunner { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
No description provided.