Skip to content

Commit

Permalink
fix: use formattedParams when overriding lit action code instead of i…
Browse files Browse the repository at this point in the history
…pfs id
  • Loading branch information
FedericoAmura committed Dec 30, 2024
1 parent 2916a14 commit 8bb94c9
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -924,19 +924,19 @@ export class LitNodeClientNodeJs

// Check if IPFS options are provided and if the code should be fetched from IPFS and overwrite the current code.
// This will fetch the code from the specified IPFS gateway using the provided ipfsId,
// and update the params with the fetched code, removing the ipfsId afterward.
// and update the formattedParams with the fetched code, removing the ipfsId afterward.
const overwriteCode =
params.ipfsOptions?.overwriteCode ||
GLOBAL_OVERWRITE_IPFS_CODE_BY_NETWORK[this.config.litNetwork];

if (overwriteCode && params.ipfsId) {
if (overwriteCode && formattedParams.ipfsId) {
const code = await this._getFallbackIpfsCode(
params.ipfsOptions?.gatewayUrl,
params.ipfsId
formattedParams.ipfsOptions?.gatewayUrl,
formattedParams.ipfsId
);

formattedParams = {
...params,
...formattedParams,
code: code,
ipfsId: undefined,
};
Expand All @@ -946,7 +946,7 @@ export class LitNodeClientNodeJs
// ========== Get Node Promises ==========
// Handle promises for commands sent to Lit nodes
const getNodePromises = async () => {
if (params.useSingleNode) {
if (formattedParams.useSingleNode) {
return this.getRandomNodePromise((url: string) =>
this.executeJsNodeRequest(url, formattedParams, requestId)
);
Expand All @@ -962,7 +962,7 @@ export class LitNodeClientNodeJs
const res = await this.handleNodePromises(
nodePromises,
requestId,
params.useSingleNode ? 1 : this.connectedNodes.size
formattedParams.useSingleNode ? 1 : this.connectedNodes.size
);

// -- case: promises rejected
Expand Down

0 comments on commit 8bb94c9

Please sign in to comment.