Skip to content

Commit

Permalink
Merge pull request #148 from Proof-Of-Humanity/testnets
Browse files Browse the repository at this point in the history
Testnets
  • Loading branch information
martillansky authored Nov 13, 2024
2 parents 42cfc4b + 4bc1ac6 commit c55bac3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 30 deletions.
1 change: 1 addition & 0 deletions env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ declare global {
LOGTAIL_SOURCE_TOKEN: string;
REACT_APP_IPFS_GATEWAY: string;
DEPLOYED_APP: string;
WALLET_CONNECT_PROJECT_ID: string;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const nextConfig = {
SEPOLIA_RPC: process.env.SEPOLIA_RPC,
GNOSIS_RPC: process.env.GNOSIS_RPC,
MAINNET_RPC: process.env.MAINNET_RPC,
WALLET_CONNECT_PROJECT_ID: process.env.WALLET_CONNECT_PROJECT_ID,
},
images: {
remotePatterns: [
Expand Down
40 changes: 13 additions & 27 deletions src/app/[pohid]/[chain]/[request]/ActionBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,9 @@ export default withClientConnected<ActionBarProps>(function ActionBar({
toast.success("Request advanced to resolving state");
},
onFail() {
!errorRef.current &&
toast.error("No vouch is valid. Advance is not possible");
!errorRef.current && toast.error("Advance is not possible");
errorRef.current = true;
setAction(ActionType.VOUCH);
//setAction(ActionType.VOUCH);
},
}),
[loading],
Expand Down Expand Up @@ -240,28 +239,7 @@ export default withClientConnected<ActionBarProps>(function ActionBar({
);

useEffect(() => {
//useEffectOnce(() => {
if (action === ActionType.ADVANCE && !revocation) {
// if (advanceRequestsOnChainVouches) {
// prepareMulticallAdvance({
// args: [
// [
// {
// target: Contract.ProofOfHumanity[chain.id],
// callData: encodeClaimToAdvance(requester, []),
// },
// ...advanceRequestsOnChainVouches!
// .map((vouch) => ({
// target: Contract.ProofOfHumanity[chain.id],
// callData: encodeClaimToAdvance(vouch.claimer, vouch.vouchers),
// }))
// .slice(0, 1),
// ],
// ],
// });
// } else {
// }

prepareAdvance({
args: [
requester,
Expand All @@ -281,7 +259,15 @@ export default withClientConnected<ActionBarProps>(function ActionBar({

if (action === ActionType.EXECUTE)
prepareExecute({ args: [pohId, BigInt(index)] });
}, [action]);
}, [
address,
prepareExecute,
action,
requester,
revocation,
chain,
userChainId,
]);

useEffect(() => {
if (
Expand Down Expand Up @@ -419,7 +405,7 @@ export default withClientConnected<ActionBarProps>(function ActionBar({
/>
) : null}
<button
disabled={pending}
disabled={pending || userChainId !== chain.id}
className="btn-main mb-2"
onClick={advance}
>
Expand All @@ -433,7 +419,7 @@ export default withClientConnected<ActionBarProps>(function ActionBar({
<span className="text-slate-400">Ready to finalize.</span>
<div className="flex flex-col justify-between gap-4 font-normal md:flex-row md:items-center">
<button
disabled={pending}
disabled={pending || userChainId !== chain.id}
className="btn-main mb-2"
onClick={execute}
>
Expand Down
6 changes: 3 additions & 3 deletions src/components/HighOrder/withClientConnected.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Web3Modal } from "@web3modal/react";
import { WagmiConfig, configureChains, createConfig } from "wagmi";
import {
EthereumClient,
w3mConnectors,
w3mProvider,
} from "@web3modal/ethereum";
import { Web3Modal } from "@web3modal/react";
import { supportedChains } from "config/chains";
import { WagmiConfig, configureChains, createConfig } from "wagmi";

const projectId = "9185f693b1bc3d1d3440300c1559a202";
const projectId = process.env.WALLET_CONNECT_PROJECT_ID;

const { publicClient } = configureChains(supportedChains as any, [
w3mProvider({ projectId }),
Expand Down

0 comments on commit c55bac3

Please sign in to comment.