Skip to content

Commit

Permalink
Merge pull request #218 from smartcontractkit/issue#214-response-list…
Browse files Browse the repository at this point in the history
…ener-hangs

Update actions/checkout & actions/setup-node to v4 (#215)
  • Loading branch information
zeuslawyer authored Aug 9, 2024
2 parents 417f49e + c268f13 commit 3a5a54b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tasks/Functions-consumer/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,13 @@ task("functions-request", "Initiates an on-demand request from a Functions consu
)

try {
// localFunctionsTestnet needs 0 or 1 confirmations to work correctly as it's local.
// If on live testnet or mainnet, setting to undefined then uses the functions-toolkit default of 2 confirmations.
const NUM_CONFIRMATIONS = network.name === "localFunctionsTestnet" ? 1 : undefined

// Get response data
const { requestId, totalCostInJuels, responseBytesHexstring, errorString, fulfillmentCode } =
await responseListener.listenForResponseFromTransaction(requestTx.hash)
await responseListener.listenForResponseFromTransaction(requestTx.hash, undefined, NUM_CONFIRMATIONS, undefined)

switch (fulfillmentCode) {
case FulfillmentCode.FULFILLED:
Expand Down

0 comments on commit 3a5a54b

Please sign in to comment.