Skip to content

Commit

Permalink
RC3 fixes (#69)
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Viénot <[email protected]>
  • Loading branch information
svienot authored Nov 7, 2023
1 parent a7cbac0 commit 923aec9
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
79 changes: 73 additions & 6 deletions hedera-patch/h5ai-nginx.patch
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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";
Expand All @@ -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(() => {
Expand Down Expand Up @@ -49,14 +49,81 @@ 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 @@
+ </li>
+ </ul>
+ <div id="view-hint"></div>
+- <div style="margin-top: 2rem; text-decoration: underline;">
+- <a id="open_in_remix" href="#" target="_blank" rel="noopener noreferrer">Open repo in Remix</a>
+- </div>
+ </div>`;
+ const itemTpl =
+ `<li class="item">
+@@ -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
<+>UTF-8
===================================================================
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",
Expand All @@ -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"
Expand Down
1 change: 0 additions & 1 deletion ui/src/pages/Verifier/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ const Verifier: React.FC = () => {
/>
</div>
<div className="text-center text-xs italic mx-2 mt-1 text-gray-400">
<p>Note: Once a contract is verified it can't be removed from the repository.</p>
{configuration.termsOfServiceUrl && (
<a href={configuration.termsOfServiceUrl}>See Terms of Service</a>
)}
Expand Down

0 comments on commit 923aec9

Please sign in to comment.