Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszjasiuk committed Oct 3, 2024
1 parent e2b91eb commit 5dc4f19
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 29 deletions.
25 changes: 0 additions & 25 deletions apps/namadillo/src/App/App.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import { Toasts } from "App/Common/Toast";
import { AppLayout } from "App/Layout/AppLayout";
import { maspIndexerUrlAtom, rpcUrlAtom } from "atoms/settings";
import { createBrowserHistory } from "history";
import { useExtensionEvents } from "hooks/useExtensionEvents";
import { useOnNamadaExtensionAttached } from "hooks/useOnNamadaExtensionAttached";
import { useTransactionCallback } from "hooks/useTransactionCallbacks";
import { useTransactionNotifications } from "hooks/useTransactionNotifications";
import { useAtomValue } from "jotai";
import { Outlet } from "react-router-dom";
import { ChainLoader } from "./Setup/ChainLoader";
import { ShieldedSyncMessageType } from "./worker";
import Worker from "./worker?worker";

export const history = createBrowserHistory({ window });

Expand All @@ -19,27 +15,6 @@ export function App(): JSX.Element {
useOnNamadaExtensionAttached();
useTransactionNotifications();
useTransactionCallback();

const worker = new Worker();
const rpcUrl = useAtomValue(rpcUrlAtom);
const maspIndexerUrl = useAtomValue(maspIndexerUrlAtom);

// eslint-disable-next-line @typescript-eslint/no-explicit-any
(window as any).shieldedSync = () => {
const msg: ShieldedSyncMessageType = {
type: "shielded-sync-singlecore",
payload: {
rpcUrl,
maspIndexerUrl,
vks: [
"zvknam1qvgwgy79qqqqpq88yru6n3f3ugfme002t7272a0ke8zdr2kt80jhnjwmgxkwm7yc6ydp8tfh8lmd28n8hrmcvqszjm3tnytryaf4qhwu645xks4nnx64m3fnpm8yr6hrpd8jtsupyzz4knqleuy7jdjz32jcz9ual56vrf3estg0e6kew0g9aqs4vg2d6n569c78ttqw4zw6mvjkhwfprcc804qt3yewsrxf8l67p87ltnqjtjkr35pfnnxavs9c5wqpr2t2lf3husqn4zvux",
],
},
};

worker.postMessage(msg);
};

return (
<>
<Toasts />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getSdk } from "@heliax/namada-sdk/web";
export type ShiededSyncPayload = {
vks: string[];
rpcUrl: string;
maspIndexerUrl: string;
maspIndexerUrl?: string;
};

export type ShieldedSyncMulticore = {
Expand Down Expand Up @@ -56,10 +56,10 @@ async function shieldedSync(
const sdk = getSdk(
cryptoMemory,
rpcUrl,
maspIndexerUrl,
maspIndexerUrl || "",
"",
// TODO: not really used, but required by the SDK, as long as it's valid address it's fine
"tnam1q9k4a0a7cgprwdj8epn28kmv9s5ntu098c3ua875"
// Not really used, but required by the SDK, as long as it's valid address it's fine
"tnam1qxfj3sf6a0meahdu9t6znp05g8zx4dkjtgyn9gfu"
);
await sdk.rpc.shieldedSync(payload.vks);
}
1 change: 1 addition & 0 deletions apps/namadillo/src/workers/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./ShieldedSyncWorker";

0 comments on commit 5dc4f19

Please sign in to comment.