Skip to content

Commit

Permalink
fix: add missing props
Browse files Browse the repository at this point in the history
Signed-off-by: Ivaylo Nikolov <[email protected]>
  • Loading branch information
ivaylonikolov7 committed Jan 7, 2025
1 parent c72e210 commit 3af5c92
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion examples/mirror-node-contract-queries-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down
10 changes: 5 additions & 5 deletions src/query/MirrorNodeContractCallQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
};
}
}
9 changes: 4 additions & 5 deletions src/query/MirrorNodeContractEstimateQuery.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Long from "long";
import MirrorNodeContractQuery from "./MirrorNodeContractQuery.js";

/**
Expand All @@ -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(),
};
}
}

0 comments on commit 3af5c92

Please sign in to comment.