Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for EraVM Extensions #357

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/app/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,14 @@
},
"underline": "If you enabled optimization during compilation, select yes."
},
"enableEraVMExtensions": {
"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 @@ -266,6 +266,14 @@
},
"underline": "Якщо ви ввімкнули оптимізацію під час компіляції, виберіть так."
},
"enableEraVMExtensions": {
"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;
enableEraVMExtensions: boolean;
sourceCode:
| string
| {
Expand All @@ -48,6 +49,7 @@ export type ContractVerificationData = {
};
};
settings: {
enableEraVMExtensions: boolean;
optimizer: {
enabled: boolean;
};
Expand Down
27 changes: 26 additions & 1 deletion packages/app/src/views/ContractVerificationView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,29 @@
</div>
<template #underline>{{ t("contractVerification.form.optimizationUsed.underline") }}</template>
</FormItem>

<FormItem tag="fieldset" :label="t('contractVerification.form.enableEraVMExtensions.label')" label-tag="legend">
<div class="grid w-max grid-cols-2 items-center gap-4" :data-testid="$testId.enableEraVMExtensionsRadioButtons">
<RadioInput
id="enableEraVMExtensions-yes"
name="enableEraVMExtensions"
:disabled="isRequestPending"
:value="true"
v-model="form.enableEraVMExtensions"
>
{{ t("contractVerification.form.enableEraVMExtensions.options.yes") }}
</RadioInput>
<RadioInput
id="enableEraVMExtensions-no"
name="enableEraVMExtensions"
:disabled="isRequestPending"
:value="false"
v-model="form.enableEraVMExtensions"
>
{{ t("contractVerification.form.enableEraVMExtensions.options.no") }}
</RadioInput>
</div>
<template #underline>{{ t("contractVerification.form.enableEraVMExtensions.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 +425,7 @@ const defaultValues = computed<
contractName: "",
contractPath: "",
optimizationUsed: true,
enableEraVMExtensions: false,
zkCompilerVersion: selectedZkCompiler.value.versions[0] || "",
compilerVersion: selectedCompiler.value.versions[0] || "",
sourceCode: "",
Expand Down Expand Up @@ -545,6 +568,7 @@ async function submitForm() {
codeFormat: ContractVerificationCodeFormatEnum[selectedCompilationType.value],
contractAddress: form.value.contractAddress,
optimizationUsed: form.value.optimizationUsed,
enableEraVMExtensions: form.value.enableEraVMExtensions,
zkCompilerVersion: form.value.zkCompilerVersion,
compilerVersion: form.value.compilerVersion,
constructorArguments: form.value.constructorArguments,
Expand Down Expand Up @@ -576,6 +600,7 @@ async function submitForm() {
optimizer: {
enabled: form.value.optimizationUsed,
},
enableEraVMExtensions: form.value.enableEraVMExtensions,
},
},
...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
21 changes: 11 additions & 10 deletions packages/app/tests/e2e/features/artifacts/artifactsSet1.feature
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,14 @@ Feature: Main Page
Then Element with "<Selector type>" "<Element>" should be "<Assertion>"

Examples:
| Selector type | Element | Assertion |
| id | contractAddress | visible |
| id | contractName | visible |
| testId | radio-buttons | visible |
| id | compilerVersion | visible |
| id | zkCompilerVersion | visible |
| id | sourceCode | visible |
| id | constructorArguments | visible |
| text | Verify Smart Contract | clickable |
| text | Clear | clickable |
| Selector type | Element | Assertion |
| id | contractAddress | visible |
| id | contractName | visible |
| testId | radio-buttons-optimization | visible |
| testId | radio-buttons-enable-era-extensions | visible |
| id | compilerVersion | visible |
| id | zkCompilerVersion | visible |
| id | sourceCode | visible |
| id | constructorArguments | visible |
| text | Verify Smart Contract | clickable |
| text | Clear | clickable |
3 changes: 2 additions & 1 deletion packages/app/tests/e2e/testId.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"direction": "direction",
"initiatorsAddress": "initiators-address",
"fromAddress": "from-address",
"optimizationRadioButtons": "radio-buttons",
"optimizationRadioButtons": "radio-buttons-optimization",
"enableEraVMExtensionsRadioButtons": "radio-buttons-enable-era-extensions",
"pageTitle": "page-title",
"previousInstructionButton": "previous-instruction-navigation-button",
"showInstructionMetadataButton": "show-instruction-metadata-button",
Expand Down
Loading