Skip to content

Commit

Permalink
feat: add support for EraVM Extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
kiriyaga committed Dec 13, 2024
1 parent 0b1a667 commit a613059
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 1 deletion.
8 changes: 8 additions & 0 deletions packages/app/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,14 @@
},
"underline": "If you enabled optimization during compilation, select yes."
},
"enableEraVMExtensionsUsed": {
"label": "Enable EraVM Extensions",
"options": {
"yes": "Yes",
"no": "No"
},
"underline": "If you enabled EraVM Extensions during compilation, select yes."
},
"solcVersion": {
"label": "Solc Version",
"placeholder": "Choose version",
Expand Down
8 changes: 8 additions & 0 deletions packages/app/src/locales/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,14 @@
},
"underline": "Якщо ви ввімкнули оптимізацію під час компіляції, виберіть так."
},
"enableEraVMExtensionsUsed": {
"label": "Ввімкнути EraVM Extensions",
"options": {
"yes": "Так",
"no": "Ні"
},
"underline": "Якщо ви ввімкнули EraVM Extensions під час компіляції, виберіть так."
},
"solcVersion": {
"label": "Solc версія",
"placeholder": "Вибрати версію",
Expand Down
2 changes: 2 additions & 0 deletions packages/app/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export type ContractVerificationData = {
contractAddress: string;
contractName: string;
optimizationUsed: boolean;
enableEraVMExtensionsUsed: boolean;
sourceCode:
| string
| {
Expand All @@ -48,6 +49,7 @@ export type ContractVerificationData = {
};
};
settings: {
enableEraVMExtensions: boolean;
optimizer: {
enabled: boolean;
};
Expand Down
31 changes: 30 additions & 1 deletion packages/app/src/views/ContractVerificationView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,33 @@
</div>
<template #underline>{{ t("contractVerification.form.optimizationUsed.underline") }}</template>
</FormItem>

<FormItem
tag="fieldset"
:label="t('contractVerification.form.enableEraVMExtensionsUsed.label')"
label-tag="legend"
>
<div class="grid w-max grid-cols-2 items-center gap-4" :data-testid="$testId.enableEraVMExtensionsRadioButtons">
<RadioInput
id="enableEraVMExtensionsUsed-yes"
name="enableEraVMExtensionsUsed"
:disabled="isRequestPending"
:value="true"
v-model="form.enableEraVMExtensionsUsed"
>
{{ t("contractVerification.form.enableEraVMExtensionsUsed.options.yes") }}
</RadioInput>
<RadioInput
id="enableEraVMExtensionsUsed-no"
name="enableEraVMExtensionsUsed"
:disabled="isRequestPending"
:value="false"
v-model="form.enableEraVMExtensionsUsed"
>
{{ t("contractVerification.form.enableEraVMExtensionsUsed.options.no") }}
</RadioInput>
</div>
<template #underline>{{ t("contractVerification.form.enableEraVMExtensionsUsed.underline") }}</template>
</FormItem>
<h3 class="form-subheading">Contract info</h3>
<FormItem id="contractName" :label="t('contractVerification.form.contractName.label')">
<Input
Expand Down Expand Up @@ -403,6 +429,7 @@ const defaultValues = computed<
contractName: "",
contractPath: "",
optimizationUsed: true,
enableEraVMExtensionsUsed: false,
zkCompilerVersion: selectedZkCompiler.value.versions[0] || "",
compilerVersion: selectedCompiler.value.versions[0] || "",
sourceCode: "",
Expand Down Expand Up @@ -545,6 +572,7 @@ async function submitForm() {
codeFormat: ContractVerificationCodeFormatEnum[selectedCompilationType.value],
contractAddress: form.value.contractAddress,
optimizationUsed: form.value.optimizationUsed,
enableEraVMExtensionsUsed: form.value.enableEraVMExtensionsUsed,
zkCompilerVersion: form.value.zkCompilerVersion,
compilerVersion: form.value.compilerVersion,
constructorArguments: form.value.constructorArguments,
Expand Down Expand Up @@ -576,6 +604,7 @@ async function submitForm() {
optimizer: {
enabled: form.value.optimizationUsed,
},
enableEraVMExtensions: form.value.enableEraVMExtensionsUsed,
},
},
...commonData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ describe("useContractVerification:", () => {
contractAddress: "",
contractName: "",
optimizationUsed: false,
enableEraVMExtensionsUsed: false,
sourceCode: "",
zkCompilerVersion: "",
compilerVersion: "",
Expand Down
1 change: 1 addition & 0 deletions packages/app/tests/e2e/testId.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"initiatorsAddress": "initiators-address",
"fromAddress": "from-address",
"optimizationRadioButtons": "radio-buttons",
"enableEraVMExtensionsRadioButtons": "radio-buttons",
"pageTitle": "page-title",
"previousInstructionButton": "previous-instruction-navigation-button",
"showInstructionMetadataButton": "show-instruction-metadata-button",
Expand Down

0 comments on commit a613059

Please sign in to comment.