Skip to content

Commit

Permalink
fix: [request|response]ToBytes() should be implemented on Query a…
Browse files Browse the repository at this point in the history
…nd `CostQuery`

Signed-off-by: Daniel Akhterov <[email protected]>
  • Loading branch information
janaakhterov committed Jun 21, 2022
1 parent 002af4e commit 686a486
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
16 changes: 16 additions & 0 deletions src/query/CostQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,22 @@ export default class CostQuery extends Executable {
);
}
}

/**
* @param {HashgraphProto.proto.Query} request
* @returns {Uint8Array}
*/
_requestToBytes(request) {
return this._query._requestToBytes(request);
}

/**
* @param {HashgraphProto.proto.Response} response
* @returns {Uint8Array}
*/
_responseToBytes(response) {
return this._query._responseToBytes(response);
}
}

COST_QUERY.push((query) => new CostQuery(query));
4 changes: 2 additions & 2 deletions src/query/Query.js
Original file line number Diff line number Diff line change
Expand Up @@ -562,15 +562,15 @@ export default class Query extends Executable {
* @param {HashgraphProto.proto.Query} request
* @returns {Uint8Array}
*/
_reqestToBytes(request) {
_requestToBytes(request) {
return HashgraphProto.proto.Query.encode(request).finish();
}

/**
* @param {HashgraphProto.proto.Response} response
* @returns {Uint8Array}
*/
_logResponse(response) {
_responseToBytes(response) {
return HashgraphProto.proto.Response.encode(response).finish();
}
}
Expand Down

0 comments on commit 686a486

Please sign in to comment.