Skip to content

Commit 6c52773

Browse files
Fix metis (#3624)
* fix lit for unsupported chain on builder * fix lit for unsupported chain on manager
1 parent 1806aad commit 6c52773

File tree

6 files changed

+11
-4
lines changed

6 files changed

+11
-4
lines changed

packages/builder/src/actions/grantsMetadata.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export const fetchGrantData =
132132
alloVersion: config.allo.version,
133133
});
134134

135-
if (!result?.project) {
135+
if (!result?.project || !result?.project.metadata.title) {
136136
return;
137137
}
138138

packages/builder/src/actions/projects.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,9 @@ export const loadProjects =
187187

188188
if (projects && withMetaData) {
189189
projects.forEach((project) => {
190-
dispatch<any>(transformAndDispatchProject(project.id, project));
190+
if (project.metadata.title) {
191+
dispatch<any>(transformAndDispatchProject(project.id, project));
192+
}
191193
});
192194
}
193195

packages/builder/src/actions/roundApplication.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ export const submitApplication =
330330

331331
deterministicApplication = objectToDeterministicJSON(application as any);
332332
} catch (error) {
333+
console.error("error building round application", error);
333334
dispatchAndLogApplicationError(
334335
dispatch,
335336
roundId,

packages/builder/src/utils/RoundApplicationBuilder.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import {
22
RoundApplicationAnswers,
33
RoundApplicationMetadata,
44
} from "data-layer/dist/roundApplication.types";
5+
import { isLitUnavailable } from "common";
56
import Lit from "../services/lit";
67
import { Project, RoundApplication } from "../types";
8+
import { global } from "../global";
79

810
export default class RoundApplicationBuilder {
911
enableEncryption: boolean;
@@ -98,7 +100,7 @@ export default class RoundApplicationBuilder {
98100
let answer;
99101
// eslint-disable-next-line
100102
let encryptedAnswer;
101-
if (question.encrypted) {
103+
if (question.encrypted && !isLitUnavailable(global.chainID!)) {
102104
// eslint-disable-next-line
103105
encryptedAnswer = await this.encryptAnswer(
104106
(formInputs[question.id] as string) ?? ""

packages/common/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ export function isLitUnavailable(chainId: number) {
483483
42, // LUKSO,
484484
713715, // SEI_DEVNET,
485485
1329, // SEI_MAINNET,
486+
1088, // METIS
486487
].includes(chainId);
487488
}
488489

packages/round-manager/src/features/round/ViewApplicationPage.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ import {
5858
formatDateWithOrdinal,
5959
getRoundStrategyType,
6060
getUTCTime,
61+
isLitUnavailable,
6162
useAllo,
6263
VerifiedCredentialState,
6364
} from "common";
@@ -333,7 +334,7 @@ export default function ViewApplicationPage() {
333334

334335
if (application?.answers && application.answers.length > 0) {
335336
for (let _answerBlock of application.answers) {
336-
if (_answerBlock.encryptedAnswer) {
337+
if (_answerBlock.encryptedAnswer && !isLitUnavailable(round.chainId!)) {
337338
try {
338339
const encryptedAnswer = _answerBlock.encryptedAnswer;
339340
const base64EncryptedString = [

0 commit comments

Comments
 (0)