mirror of
https://github.com/0xbow-io/privacy-pools-core.git
synced 2026-01-10 09:58:00 -05:00
fix: linting
This commit is contained in:
@@ -46,16 +46,16 @@ export class AccountService {
|
||||
try {
|
||||
this.logger.debug("Initializing account with mnemonic");
|
||||
|
||||
let masterNullifierSeed = bytesToNumber(
|
||||
const masterNullifierSeed = bytesToNumber(
|
||||
mnemonicToAccount(mnemonic, { accountIndex: 0 }).getHdKey().privateKey!,
|
||||
);
|
||||
|
||||
let masterSecretSeed = bytesToNumber(
|
||||
const masterSecretSeed = bytesToNumber(
|
||||
mnemonicToAccount(mnemonic, { accountIndex: 1 }).getHdKey().privateKey!,
|
||||
);
|
||||
|
||||
let masterNullifier = poseidon([BigInt(masterNullifierSeed)]) as Secret;
|
||||
let masterSecret = poseidon([BigInt(masterSecretSeed)]) as Secret;
|
||||
const masterNullifier = poseidon([BigInt(masterNullifierSeed)]) as Secret;
|
||||
const masterSecret = poseidon([BigInt(masterSecretSeed)]) as Secret;
|
||||
|
||||
return {
|
||||
masterKeys: [masterNullifier, masterSecret],
|
||||
|
||||
@@ -3,7 +3,6 @@ import {
|
||||
createPublicClient,
|
||||
http,
|
||||
parseAbiItem,
|
||||
type Address,
|
||||
} from "viem";
|
||||
import {
|
||||
ChainConfig,
|
||||
|
||||
@@ -45,16 +45,16 @@ export function generateMasterKeys(mnemonic: string): MasterKeys {
|
||||
);
|
||||
}
|
||||
|
||||
let key1 = bytesToNumber(
|
||||
const key1 = bytesToNumber(
|
||||
mnemonicToAccount(mnemonic, { accountIndex: 0 }).getHdKey().privateKey!,
|
||||
);
|
||||
|
||||
let key2 = bytesToNumber(
|
||||
const key2 = bytesToNumber(
|
||||
mnemonicToAccount(mnemonic, { accountIndex: 1 }).getHdKey().privateKey!,
|
||||
);
|
||||
|
||||
let masterNullifier = poseidon([BigInt(key1)]) as Secret;
|
||||
let masterSecret = poseidon([BigInt(key2)]) as Secret;
|
||||
const masterNullifier = poseidon([BigInt(key1)]) as Secret;
|
||||
const masterSecret = poseidon([BigInt(key2)]) as Secret;
|
||||
|
||||
return { masterNullifier, masterSecret };
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@ import { Hex } from "viem";
|
||||
import { generatePrivateKey } from "viem/accounts";
|
||||
|
||||
export function genMasterKeys(seed?: Hex): [Secret, Secret] {
|
||||
let preimage = seed ? poseidon([BigInt(seed)]) : BigInt(generatePrivateKey());
|
||||
const preimage = seed ? poseidon([BigInt(seed)]) : BigInt(generatePrivateKey());
|
||||
|
||||
let masterKey1 = poseidon([preimage, BigInt(1)]) as Secret;
|
||||
let masterKey2 = poseidon([preimage, BigInt(2)]) as Secret;
|
||||
const masterKey1 = poseidon([preimage, BigInt(1)]) as Secret;
|
||||
const masterKey2 = poseidon([preimage, BigInt(2)]) as Secret;
|
||||
|
||||
return [masterKey1, masterKey2];
|
||||
}
|
||||
@@ -24,8 +24,8 @@ export function getDepositSecrets(
|
||||
scope: Hash,
|
||||
index: bigint,
|
||||
): { nullifier: Secret; secret: Secret } {
|
||||
let depositNullifier = poseidon([masterKey[0], scope, index]) as Secret;
|
||||
let depositSecret = poseidon([masterKey[1], scope, index]) as Secret;
|
||||
const depositNullifier = poseidon([masterKey[0], scope, index]) as Secret;
|
||||
const depositSecret = poseidon([masterKey[1], scope, index]) as Secret;
|
||||
|
||||
return { nullifier: depositNullifier, secret: depositSecret };
|
||||
}
|
||||
@@ -35,8 +35,8 @@ export function getWithdrawalSecrets(
|
||||
label: Hash,
|
||||
index: bigint,
|
||||
): { nullifier: Secret; secret: Secret } {
|
||||
let withdrawalNullifier = poseidon([masterKey[0], label, index]) as Secret;
|
||||
let withdrawalSecret = poseidon([masterKey[1], label, index]) as Secret;
|
||||
const withdrawalNullifier = poseidon([masterKey[0], label, index]) as Secret;
|
||||
const withdrawalSecret = poseidon([masterKey[1], label, index]) as Secret;
|
||||
|
||||
return { nullifier: withdrawalNullifier, secret: withdrawalSecret };
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Hash, Secret } from "./commitment.js";
|
||||
import { Address, Hex } from "viem";
|
||||
import { Hex } from "viem";
|
||||
|
||||
export interface PoolAccount {
|
||||
label: Hash;
|
||||
|
||||
Reference in New Issue
Block a user