From 3b356cfc95357490f453fd48d11f11053d8055fc Mon Sep 17 00:00:00 2001 From: Brent Conn Date: Tue, 3 Oct 2023 20:14:06 -0400 Subject: [PATCH 1/2] making fee record only required if private fee is selected --- website/src/tabs/develop/execute/index.jsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/website/src/tabs/develop/execute/index.jsx b/website/src/tabs/develop/execute/index.jsx index 1c3f8cf7a..e7c71def3 100644 --- a/website/src/tabs/develop/execute/index.jsx +++ b/website/src/tabs/develop/execute/index.jsx @@ -54,7 +54,6 @@ export const Execute = () => { }, []); const execute = async (values) => { - console.log(values) setModalModalOpen(true); setLoading(true); try { @@ -393,10 +392,10 @@ export const Execute = () => { { required: getFieldValue( - "execute_onchain" + "private_fee" ), message: - "Fee record needed for on-chain execution", + "Fee record needed for for private fee", }, ]} > From 55cd9b9c6544cc2a0fbba9e5881c571f87181d09 Mon Sep 17 00:00:00 2001 From: Brent Conn Date: Tue, 3 Oct 2023 20:23:53 -0400 Subject: [PATCH 2/2] prettier, spelling fix, requirement and visibility fix --- website/src/tabs/develop/execute/index.jsx | 24 ++++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/website/src/tabs/develop/execute/index.jsx b/website/src/tabs/develop/execute/index.jsx index e7c71def3..14c848596 100644 --- a/website/src/tabs/develop/execute/index.jsx +++ b/website/src/tabs/develop/execute/index.jsx @@ -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"); @@ -115,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") { @@ -193,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"]); }; @@ -271,7 +271,7 @@ export const Execute = () => { }); form.setFieldValue( "inputs", - JSON.stringify(translatedArray), + JSON.stringify(translatedArray) ); form.submit(); } @@ -349,7 +349,7 @@ export const Execute = () => { { required: getFieldValue( - "execute_onchain", + "execute_onchain" ), message: "Fee needed for on-chain execution", @@ -386,6 +386,9 @@ export const Execute = () => { hidden={ !getFieldValue( "private_fee" + ) || + !getFieldValue( + "execute_onchain" ) } rules={[ @@ -393,9 +396,12 @@ export const Execute = () => { required: getFieldValue( "private_fee" + ) && + getFieldValue( + "execute_onchain" ), message: - "Fee record needed for for private fee", + "Fee record needed for private fee", }, ]} > @@ -481,8 +487,8 @@ const renderInput = (input, inputIndex, nameArray = []) => { renderInput( member, memberIndex, - [].concat(nameArray).concat(input.name || inputIndex), - ), + [].concat(nameArray).concat(input.name || inputIndex) + ) )} ); @@ -510,7 +516,7 @@ const functionForm = (func, funcInputs) => { > {funcInputs.length > 0 ? ( funcInputs.map((input, inputIndex) => - renderInput(input, inputIndex, ["inputs"]), + renderInput(input, inputIndex, ["inputs"]) ) ) : (