@merkl/api 0.20.173 → 0.20.175
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -238,6 +238,8 @@ export class CampaignRepository {
|
|
238
238
|
},
|
239
239
|
subType: campaign.subType,
|
240
240
|
DistributionChain: { connect: { id: campaign.distributionChainId } },
|
241
|
+
parentCampaign: campaign.parentCampaignId ? { connect: { id: campaign.parentCampaignId } } : undefined,
|
242
|
+
rootCampaign: campaign.rootCampaignId ? { connect: { id: campaign.rootCampaignId } } : undefined,
|
241
243
|
};
|
242
244
|
return await apiDbClient.campaign.upsert({
|
243
245
|
where: {
|
@@ -32,11 +32,18 @@ export class MerklRootRepository {
|
|
32
32
|
return { live, tree, lastTree, endOfDisputePeriod, disputer };
|
33
33
|
}
|
34
34
|
catch (e) {
|
35
|
+
let errorMessage = null;
|
35
36
|
// If the error is a timeout, log a warning and return a void object
|
36
37
|
if (e.message === `Timed out after ${RPC_CALL_TIMEOUT}ms`) {
|
37
|
-
|
38
|
+
errorMessage = `fetching Merkle Root for chain ${NETWORK_LABELS[chainId]} timed out`;
|
39
|
+
}
|
40
|
+
// If the error is a rpc failure, log a warning and return a void object
|
41
|
+
if (e.message === "EVMDistributorService: fetchUpdateData multicall failed") {
|
42
|
+
errorMessage = `fetching Merkle Root for chain ${NETWORK_LABELS[chainId]} multicall failed`;
|
43
|
+
}
|
44
|
+
if (errorMessage) {
|
38
45
|
log.warn(errorMessage);
|
39
|
-
return {};
|
46
|
+
return {}; // Return an empty object to indicate failure and prevent further trials of fetching this
|
40
47
|
}
|
41
48
|
throw e;
|
42
49
|
}
|