Skip to content

Commit 3a5a54b

Browse files
authored
Merge pull request #218 from smartcontractkit/issue#214-response-listener-hangs
Update actions/checkout & actions/setup-node to v4 (#215)
2 parents 417f49e + c268f13 commit 3a5a54b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tasks/Functions-consumer/request.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,13 @@ task("functions-request", "Initiates an on-demand request from a Functions consu
214214
)
215215

216216
try {
217+
// localFunctionsTestnet needs 0 or 1 confirmations to work correctly as it's local.
218+
// If on live testnet or mainnet, setting to undefined then uses the functions-toolkit default of 2 confirmations.
219+
const NUM_CONFIRMATIONS = network.name === "localFunctionsTestnet" ? 1 : undefined
220+
217221
// Get response data
218222
const { requestId, totalCostInJuels, responseBytesHexstring, errorString, fulfillmentCode } =
219-
await responseListener.listenForResponseFromTransaction(requestTx.hash)
223+
await responseListener.listenForResponseFromTransaction(requestTx.hash, undefined, NUM_CONFIRMATIONS, undefined)
220224

221225
switch (fulfillmentCode) {
222226
case FulfillmentCode.FULFILLED:

0 commit comments

Comments
 (0)