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

[Fix] fee record only required if private fee is selected #760

Merged
merged 2 commits into from
Oct 4, 2023
Merged
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
25 changes: 15 additions & 10 deletions website/src/tabs/develop/execute/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const Execute = () => {
" input r0 as u32.public;\n" +
" input r1 as u32.private;\n" +
" add r0 r1 into r2;\n" +
" output r2 as u32.private;\n",
" output r2 as u32.private;\n"
);
form.setFieldValue("manual_input", true);
form.setFieldValue("functionName", "hello");
Expand All @@ -54,7 +54,6 @@ export const Execute = () => {
}, []);

const execute = async (values) => {
console.log(values)
setModalModalOpen(true);
setLoading(true);
try {
Expand Down Expand Up @@ -116,7 +115,7 @@ export const Execute = () => {
function spawnWorker() {
let worker = new Worker(
new URL("../../../workers/worker.js", import.meta.url),
{ type: "module" },
{ type: "module" }
);
worker.addEventListener("message", (ev) => {
if (ev.data.type == "OFFLINE_EXECUTION_COMPLETED") {
Expand Down Expand Up @@ -194,7 +193,7 @@ export const Execute = () => {
const generateKey = () => {
form.setFieldValue(
"private_key",
new aleoWASM.PrivateKey().to_string(),
new aleoWASM.PrivateKey().to_string()
);
form.validateFields(["private_key"]);
};
Expand Down Expand Up @@ -272,7 +271,7 @@ export const Execute = () => {
});
form.setFieldValue(
"inputs",
JSON.stringify(translatedArray),
JSON.stringify(translatedArray)
);
form.submit();
}
Expand Down Expand Up @@ -350,7 +349,7 @@ export const Execute = () => {
{
required:
getFieldValue(
"execute_onchain",
"execute_onchain"
),
message:
"Fee needed for on-chain execution",
Expand Down Expand Up @@ -387,16 +386,22 @@ export const Execute = () => {
hidden={
!getFieldValue(
"private_fee"
) ||
!getFieldValue(
"execute_onchain"
)
}
rules={[
{
required:
getFieldValue(
"private_fee"
) &&
getFieldValue(
"execute_onchain"
),
message:
"Fee record needed for on-chain execution",
"Fee record needed for private fee",
},
]}
>
Expand Down Expand Up @@ -482,8 +487,8 @@ const renderInput = (input, inputIndex, nameArray = []) => {
renderInput(
member,
memberIndex,
[].concat(nameArray).concat(input.name || inputIndex),
),
[].concat(nameArray).concat(input.name || inputIndex)
)
)}
</div>
);
Expand Down Expand Up @@ -511,7 +516,7 @@ const functionForm = (func, funcInputs) => {
>
{funcInputs.length > 0 ? (
funcInputs.map((input, inputIndex) =>
renderInput(input, inputIndex, ["inputs"]),
renderInput(input, inputIndex, ["inputs"])
)
) : (
<Form.Item
Expand Down
Loading