Skip to content

Commit

Permalink
refactor: apply-review-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Harman-singh-waraich committed Jun 4, 2024
1 parent e4986f9 commit 6db296c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
10 changes: 4 additions & 6 deletions subgraph/scripts/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ function update() #hardhatNetwork #graphNetwork #dataSourceIndex #contract

# Set the ABIs path for this Hardhat network
abiIndex=0
for f in $(yq e .dataSources[$dataSourceIndex].mapping.abis[].file subgraph.yaml -o json -I 0 | jq -sr '.[]')
for f in "$(yq e .dataSources[$dataSourceIndex].mapping.abis[].file subgraph.yaml -o json -I 0 | jq -sr '.[]')"
do
f2=$(echo $f | sed "s|\(.*\/deployments\/\).*\/|\1$hardhatNetwork\/|")
f2=$(echo "$f" | sed "s|\(.*\/deployments\/\).*\/|\1$hardhatNetwork\/|")
yq -i ".dataSources[$dataSourceIndex].mapping.abis[$abiIndex].file=\"$f2\"" "$SCRIPT_DIR"/../subgraph.yaml
(( ++abiIndex ))
done
Expand All @@ -40,10 +40,9 @@ function updateTemplates() #hardhatNetwork #templateIndex #contract

# Set the ABIs path for this Hardhat network
abiIndex=0
for f in $(yq e .templates[$templateIndex].mapping.abis[].file subgraph.yaml -o json -I 0 | jq -sr '.[]')
for f in "$(yq e .templates[$templateIndex].mapping.abis[].file subgraph.yaml -o json -I 0 | jq -sr '.[]')"
do
f2=$(echo $f | sed "s|\(.*\/deployments\/\).*\/|\1$hardhatNetwork\/|")
echo "$f2"
f2=$(echo "$f" | sed "s|\(.*\/deployments\/\).*\/|\1$hardhatNetwork\/|")
yq -i ".templates[$templateIndex].mapping.abis[$abiIndex].file=\"$f2\"" "$SCRIPT_DIR"/../subgraph.yaml
(( ++abiIndex ))
done
Expand All @@ -61,7 +60,6 @@ cp "$SCRIPT_DIR"/../subgraph.yaml "$SCRIPT_DIR"/../subgraph.yaml.bak.$(date +%s)

for contract in $(yq .dataSources[].name "$SCRIPT_DIR"/../subgraph.yaml)
do
echo "$i"
update $hardhatNetwork $graphNetwork $i $contract
(( ++i ))
done
Expand Down
9 changes: 4 additions & 5 deletions web/scripts/generateBuildInfo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,17 @@ QUERY='{"query":"{\n mainCurate(id:\"0\"){\n address\n }\n}","varia
OUTPUT_FILE="src/generatedMainCurateAddress.json"

TEMP_FILE=$(mktemp)
curl "$REACT_APP_ARBSEPOLIA_SUBGRAPH" -s -X POST -H "Content-Type: application/json" --data "$QUERY" -o $TEMP_FILE

if [ $? -eq 0 ]; then
ADDRESS=$(jq -r '.data.mainCurate.address' $TEMP_FILE)
echo "{\"mainCurateAddress\": \"$ADDRESS\"}" > $OUTPUT_FILE
if curl "$REACT_APP_ARBSEPOLIA_SUBGRAPH" -s -X POST -H "Content-Type: application/json" --data "$QUERY" -o "$TEMP_FILE"; then
ADDRESS=$(jq -r '.data.mainCurate.address' "$TEMP_FILE")
echo "{\"mainCurateAddress\": \"$ADDRESS\"}" > "$OUTPUT_FILE"

echo -e "✔ Main Curate address fetched and saved to $OUTPUT_FILE"
else
echo -e "❌ Error fetching Main curate address from $REACT_APP_ARBSEPOLIA_SUBGRAPH"
exit 1
fi

rm $TEMP_FILE
rm "$TEMP_FILE"

node "$SCRIPT_DIR/gitInfo.js"
2 changes: 1 addition & 1 deletion web/src/components/ActionButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const ActionButton: React.FC<IActionButton> = ({ status, registryAddress, itemId
return <ExecuteButton {...{ registryAddress, itemId, refetch }} />;

return <Button variant="secondary" text={getModalButtonText(status ?? 0, isItem)} onClick={toggleModal} />;
}, [isExecutable, registryAddress, status, itemId, isLoading, disputeId]);
}, [isExecutable, registryAddress, status, itemId, isLoading, disputeId, isItem, toggleModal, refetch]);

return (
<>
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/Home/Highlights/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const HighlightedLists = () => {

const sortedRegstries = useMemo(
() => (registriesData?.registries ? sortRegistriesByIds(registryIds, registriesData?.registries) : []),
[registriesData]
[registriesData, registryIds]
);

const combinedListsData = useMemo(() => {
Expand Down

0 comments on commit 6db296c

Please sign in to comment.