Skip to content

Commit

Permalink
fix: passing empty vks
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszjasiuk committed Dec 20, 2024
1 parent 16db255 commit 7a0eeb5
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 18 deletions.
10 changes: 0 additions & 10 deletions apps/namadillo/src/App/WorkerTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,6 @@ export function WorkerTest(): JSX.Element {
],
});

const vks = accounts
?.filter((acc) => acc.type === "shielded-keys")
.map((a) => a.viewingKey!);

const disposableSigner = (await refetch()).data;

const msg: Unshield = {
Expand All @@ -163,7 +159,6 @@ export function WorkerTest(): JSX.Element {
},
unshieldingProps: [shieldingMsgValue],
chain: chain!,
vks: vks!,
},
};

Expand Down Expand Up @@ -208,10 +203,6 @@ export function WorkerTest(): JSX.Element {
],
});

const vks = accounts
?.filter((acc) => acc.type === "shielded-keys")
.map((a) => a.viewingKey!);

const disposableSigner = (await refetch()).data;

const msg: ShieldedTransfer = {
Expand All @@ -228,7 +219,6 @@ export function WorkerTest(): JSX.Element {
},
props: [shieldingMsgValue],
chain: chain!,
vks: vks!,
},
};

Expand Down
2 changes: 0 additions & 2 deletions apps/namadillo/src/atoms/shield/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ export const submitUnshieldTx = async (
gasConfig,
unshieldingProps: [unshieldingMsgValue],
chain,
vks: [],
},
};

Expand Down Expand Up @@ -203,7 +202,6 @@ export const submitShieldedTx = async (
gasConfig,
props: [shieldedTransferMsgValue],
chain,
vks: [],
},
};

Expand Down
2 changes: 0 additions & 2 deletions apps/namadillo/src/workers/MaspTxMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ type UnshieldPayload = {
gasConfig: GasConfig;
unshieldingProps: UnshieldingTransferMsgValue[];
chain: ChainSettings;
vks: string[];
};
export type Unshield = WebWorkerMessage<"unshield", UnshieldPayload>;
export type UnshieldDone = WebWorkerMessage<
Expand All @@ -49,7 +48,6 @@ type ShieldedTransferPayload = {
gasConfig: GasConfig;
props: ShieldedTransferMsgValue[];
chain: ChainSettings;
vks: string[];
};
export type ShieldedTransfer = WebWorkerMessage<
"shielded-transfer",
Expand Down
6 changes: 2 additions & 4 deletions apps/namadillo/src/workers/MaspTxWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ async function unshield(
sdk: Sdk,
payload: Unshield["payload"]
): Promise<EncodedTxData<UnshieldingTransferMsgValue>> {
const { account, gasConfig, chain, unshieldingProps, vks } = payload;
const { account, gasConfig, chain, unshieldingProps } = payload;

await sdk.rpc.shieldedSync(vks);
await sdk.masp.loadMaspParams("");

const encodedTxData = await buildTx<UnshieldingTransferMsgValue>(
Expand All @@ -125,9 +124,8 @@ async function shieldedTransfer(
sdk: Sdk,
payload: ShieldedTransfer["payload"]
): Promise<EncodedTxData<ShieldedTransferMsgValue>> {
const { account, gasConfig, chain, props, vks } = payload;
const { account, gasConfig, chain, props } = payload;

await sdk.rpc.shieldedSync(vks);
await sdk.masp.loadMaspParams("");

const encodedTxData = await buildTx<ShieldedTransferMsgValue>(
Expand Down

0 comments on commit 7a0eeb5

Please sign in to comment.