From 3af5c922b094ba4a44e1066592fce85e1b8ab30a Mon Sep 17 00:00:00 2001 From: Ivaylo Nikolov Date: Tue, 7 Jan 2025 00:23:16 +0200 Subject: [PATCH] fix: add missing props Signed-off-by: Ivaylo Nikolov --- examples/mirror-node-contract-queries-example.js | 2 +- src/query/MirrorNodeContractCallQuery.js | 10 +++++----- src/query/MirrorNodeContractEstimateQuery.js | 9 ++++----- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/examples/mirror-node-contract-queries-example.js b/examples/mirror-node-contract-queries-example.js index 7fa19d178..769ce2ecf 100644 --- a/examples/mirror-node-contract-queries-example.js +++ b/examples/mirror-node-contract-queries-example.js @@ -62,7 +62,7 @@ async function main() { // Step 5: Do the query against the consensus node using the estimated gas const callQuery = new ContractCallQuery() .setContractId(contractId) - .setGas(gas) + .setGas(Number(gas)) .setFunction("getMessage") .setQueryPayment(new Hbar(1)); diff --git a/src/query/MirrorNodeContractCallQuery.js b/src/query/MirrorNodeContractCallQuery.js index 81f727011..fb01e8150 100644 --- a/src/query/MirrorNodeContractCallQuery.js +++ b/src/query/MirrorNodeContractCallQuery.js @@ -15,13 +15,13 @@ export default class MirrorNodeContractCallQuery extends MirrorNodeContractQuery return { data: Buffer.from(this.callData).toString("hex"), - from: this.sender, + from: this.sender?.evmAddress, to: this.contractEvmAddress, estimate: false, - gasPrice: this.gasPrice, - gas: this.gasLimit, - blockNumber: this.blockNumber, - value: this.value, + gasPrice: this.gasPrice?.toString(), + gas: this.gasLimit?.toString(), + blockNumber: this.blockNumber?.toString(), + value: this.value?.toString(), }; } } diff --git a/src/query/MirrorNodeContractEstimateQuery.js b/src/query/MirrorNodeContractEstimateQuery.js index 63c1c6a3d..458e6ce53 100644 --- a/src/query/MirrorNodeContractEstimateQuery.js +++ b/src/query/MirrorNodeContractEstimateQuery.js @@ -1,4 +1,3 @@ -import Long from "long"; import MirrorNodeContractQuery from "./MirrorNodeContractQuery.js"; /** @@ -19,10 +18,10 @@ export default class MirrorNodeContractCallQuery extends MirrorNodeContractQuery from: this.senderEvmAddress, to: this.contractEvmAddress, estimate: true, - gasPrice: this.gasPrice, - blockNumber: this.blockNumber, - gasLimit: this.gasLimit, - value: this.value, + gasPrice: this.gasPrice?.toString(), + gas: this.gasLimit?.toString(), + blockNumber: this.blockNumber?.toString(), + value: this.value?.toString(), }; } }