From 923aec97bbc8718887240648ebb2b44e458e4291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Vi=C3=A9not?= Date: Tue, 7 Nov 2023 19:15:45 +0100 Subject: [PATCH] RC3 fixes (#69) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon ViƩnot --- README.md | 2 +- hedera-patch/h5ai-nginx.patch | 79 ++++++++++++++++++++++++++++++--- ui/src/pages/Verifier/index.tsx | 1 - 3 files changed, 74 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b3e7df06..4c0c2c8a 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Make sure the repository submodule h5ai-nginx is present: - `git submodule update --init --recursive` Apply the Hedera patch to the `h5ai-nginx` submodule (execute this only once). -- `./scripts/hedera-apply-patch.sh` +- `./scripts/hedera-apply-h5ai-nginx-patch.sh` ## Local build for development diff --git a/hedera-patch/h5ai-nginx.patch b/hedera-patch/h5ai-nginx.patch index 692b471f..12c88c2e 100644 --- a/hedera-patch/h5ai-nginx.patch +++ b/hedera-patch/h5ai-nginx.patch @@ -1,4 +1,4 @@ -Subject: [PATCH] h5ai-nginx gets value of SERVER_URL from config.json file. +Subject: [PATCH] h5ai-nginx --- Index: select-contract-form/src/App.js IDEA additional info: @@ -7,7 +7,7 @@ Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP =================================================================== diff --git a/select-contract-form/src/App.js b/select-contract-form/src/App.js --- a/select-contract-form/src/App.js (revision 453a6681ef93a7a43ee339b5301743e27d7a3b62) -+++ b/select-contract-form/src/App.js (date 1695221204280) ++++ b/select-contract-form/src/App.js (date 1699367507735) @@ -2,6 +2,7 @@ import { useEffect, useRef, useState } from "react"; import { Alert, Button, Card, Form, Spinner } from "react-bootstrap"; @@ -16,7 +16,7 @@ diff --git a/select-contract-form/src/App.js b/select-contract-form/src/App.js function App() { const [selectedMatch, setSelectedMatch] = useState("full_match"); -@@ -20,13 +21,26 @@ +@@ -20,17 +21,33 @@ ]; useEffect(() => { @@ -49,6 +49,73 @@ diff --git a/select-contract-form/src/App.js b/select-contract-form/src/App.js return chainsArray; }; getSourcifyChains() +- .then((chains) => setChains(chains)) ++ .then((chains) => { ++ setChains(chains) ++ setChainId(chains[0].chainId) ++ }) + .catch((err) => alert(err)); + }, []); + +Index: Dockerfile +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/Dockerfile b/Dockerfile +--- a/Dockerfile (revision 453a6681ef93a7a43ee339b5301743e27d7a3b62) ++++ b/Dockerfile (date 1699367072922) +@@ -1,6 +1,8 @@ + FROM node:14-alpine + RUN apk add --no-cache git + RUN git clone https://github.com/sourcifyeth/h5ai.git ++COPY h5ai.patch /h5ai.patch ++RUN cd h5ai && git apply /h5ai.patch + RUN cd h5ai && npm install && npm run build + RUN mv $(ls -1 /h5ai/build/*.zip) /h5ai/build/h5ai.zip + RUN ls /h5ai/build/ +Index: h5ai.patch +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/h5ai.patch b/h5ai.patch +new file mode 100644 +--- /dev/null (date 1699293561021) ++++ b/h5ai.patch (date 1699293561021) +@@ -0,0 +1,32 @@ ++Subject: [PATCH] suppress link to remix ++--- ++Index: src/_h5ai/public/js/lib/view/view.js ++IDEA additional info: ++Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP ++<+>UTF-8 ++=================================================================== ++diff --git a/src/_h5ai/public/js/lib/view/view.js b/src/_h5ai/public/js/lib/view/view.js ++--- a/src/_h5ai/public/js/lib/view/view.js (revision 15173ca22fcd4e9b2c0d11bdacc509428dba1bcd) +++++ b/src/_h5ai/public/js/lib/view/view.js (date 1699289694771) ++@@ -32,9 +32,6 @@ ++ ++ ++
++-
++- Open repo in Remix ++-
++ `; ++ const itemTpl = ++ `
  • ++@@ -49,11 +46,9 @@ ++ const $view = dom(viewTpl); ++ const $items = $view.find('#items'); ++ const $hint = $view.find('#view-hint'); ++-const $remix_link = $view.find('#open_in_remix'); ++ const $path = global.window.location.href.split('/'); ++ const $address = $path[6]; ++ const $chainId = $path[5]; ++-$remix_link.attr('href', `https://remix.ethereum.org/?#activate=sourcify&call=sourcify//fetchAndSave//${$address}//${$chainId}`); ++ ++ ++ const cropSize = (size, min, max) => Math.min(max, Math.max(min, size)); Index: select-contract-form/package.json IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP @@ -56,7 +123,7 @@ Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP =================================================================== diff --git a/select-contract-form/package.json b/select-contract-form/package.json --- a/select-contract-form/package.json (revision 453a6681ef93a7a43ee339b5301743e27d7a3b62) -+++ b/select-contract-form/package.json (date 1695221204280) ++++ b/select-contract-form/package.json (date 1699359289868) @@ -6,6 +6,7 @@ "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.1.0", @@ -72,8 +139,8 @@ Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP =================================================================== diff --git a/select-contract-form/public/config.json b/select-contract-form/public/config.json new file mode 100644 ---- /dev/null (date 1695221304211) -+++ b/select-contract-form/public/config.json (date 1695221304211) +--- /dev/null (date 1699359289869) ++++ b/select-contract-form/public/config.json (date 1699359289869) @@ -0,0 +1,3 @@ + { + "SERVER_URL": "http://localhost:5002" diff --git a/ui/src/pages/Verifier/index.tsx b/ui/src/pages/Verifier/index.tsx index aa8339fc..d96eef42 100644 --- a/ui/src/pages/Verifier/index.tsx +++ b/ui/src/pages/Verifier/index.tsx @@ -228,7 +228,6 @@ const Verifier: React.FC = () => { />
    -

    Note: Once a contract is verified it can't be removed from the repository.

    {configuration.termsOfServiceUrl && ( See Terms of Service )}