Skip to content

Commit

Permalink
use default import for verify functions
Browse files Browse the repository at this point in the history
  • Loading branch information
MHHukiewitz committed Jan 4, 2024
1 parent a54626a commit f8c8f78
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/accounts/avalanche.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { BaseProviderWallet } from "./providers/BaseProviderWallet";
import { providers } from "ethers";

import { ProviderEncryptionLabel, ProviderEncryptionLib } from "./providers/ProviderEncryptionLib";
import { verifyAvalanche } from "../utils/signature/verifyAvalanche";
import verifyAvalanche from "../utils/signature/verifyAvalanche";

/**
* AvalancheAccount implements the Account class for the Avalanche protocol.
Expand Down
2 changes: 1 addition & 1 deletion src/accounts/ethereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ethers } from "ethers";
import { ECIESAccount } from "./account";
import { GetVerificationBuffer } from "../messages";
import { BaseMessage, Chain } from "../messages/types";
import { verifyEthereum } from "../utils/signature/verifyEthereum";
import verifyEthereum from "../utils/signature/verifyEthereum";
import { BaseProviderWallet } from "./providers/BaseProviderWallet";
import { decrypt as secp256k1_decrypt, encrypt as secp256k1_encrypt } from "eciesjs";
import { ChangeRpcParam, JsonRPCWallet, RpcChainType } from "./providers/JsonRPCWallet";
Expand Down
2 changes: 1 addition & 1 deletion src/accounts/solana.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { GetVerificationBuffer } from "../messages";
import { Keypair, PublicKey } from "@solana/web3.js";
import nacl from "tweetnacl";
import base58 from "bs58";
import { verifySolana } from "../utils/signature/verifySolana";
import verifySolana from "../utils/signature/verifySolana";

type WalletSignature = {
signature: Uint8Array;
Expand Down
2 changes: 1 addition & 1 deletion src/accounts/substrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Keyring } from "@polkadot/keyring";
import { KeyringPair } from "@polkadot/keyring/types";
import { cryptoWaitReady } from "@polkadot/util-crypto";
import { generateMnemonic } from "@polkadot/util-crypto/mnemonic/bip39";
import { verifySubstrate } from "../utils/signature/verifySubstrate";
import verifySubstrate from "../utils/signature/verifySubstrate";
import { stringToHex } from "@polkadot/util";

/**
Expand Down
12 changes: 6 additions & 6 deletions src/utils/signature/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { verifyEthereum } from "./verifyEthereum";
import { verifyAvalanche } from "./verifyAvalanche";
import { verifySolana } from "./verifySolana";
import { verifySubstrate } from "./verifySubstrate";
import { verifyTezos } from "./verifyTezos";
import { verifyCosmos } from "./verifyCosmos";
import verifyEthereum from "./verifyEthereum";
import verifyAvalanche from "./verifyAvalanche";
import verifySolana from "./verifySolana";
import verifySubstrate from "./verifySubstrate";
import verifyTezos from "./verifyTezos";
import verifyCosmos from "./verifyCosmos";

export { verifyEthereum, verifyAvalanche, verifySolana, verifySubstrate, verifyTezos, verifyCosmos };
2 changes: 1 addition & 1 deletion src/utils/signature/verifyAvalanche.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ async function verifyAvalanche(message: Buffer | BaseMessage, signature: string,
return signerPKey === recovered.toString("hex");
}

export { verifyAvalanche };
export default verifyAvalanche;
2 changes: 1 addition & 1 deletion src/utils/signature/verifyCosmos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ async function verifyCosmos(message: Buffer | BaseMessage, serializedSignature:
}
}

export { verifyCosmos };
export default verifyCosmos;
2 changes: 1 addition & 1 deletion src/utils/signature/verifyEthereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ function verifyEthereum(message: Buffer | BaseMessage, signature: string, signer
}
}

export { verifyEthereum };
export default verifyEthereum;
2 changes: 1 addition & 1 deletion src/utils/signature/verifySolana.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ function verifySolana(message: Buffer | BaseMessage, serializedSignature: string
}
}

export { verifySolana };
export default verifySolana;
2 changes: 1 addition & 1 deletion src/utils/signature/verifySubstrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ function verifySubstrate(message: Buffer | BaseMessage, signature: string, signe
}
}

export { verifySubstrate };
export default verifySubstrate;
2 changes: 1 addition & 1 deletion src/utils/signature/verifyTezos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ function verifyTezos(message: BaseMessage, signature: string): boolean {
return verifySignature(payloadBytes, publicKey, parsedSignature);
}

export { verifyTezos };
export default verifyTezos;
2 changes: 1 addition & 1 deletion tests/accounts/avalanche.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { avalanche, post } from "../index";
import { ItemType, MessageType } from "../../src/messages/types";
import { EthereumProvider } from "../providers/ethereumProvider";
import { GetVerificationBuffer } from "../../src/messages";
import { verifyAvalanche } from "../index";
import verifyAvalanche from "../index";
import { EphAccountList } from "../testAccount/entryPoint";
import fs from "fs";

Expand Down
2 changes: 1 addition & 1 deletion tests/accounts/ethereum.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { MessageType, ItemType } from "../../src/messages/types";
import { EphAccountList } from "../testAccount/entryPoint";
import fs from "fs";
import { GetVerificationBuffer } from "../../src/messages";
import { verifyEthereum } from "../index";
import verifyEthereum from "../index";

describe("Ethereum accounts", () => {
let ephemeralAccount: EphAccountList;
Expand Down
2 changes: 1 addition & 1 deletion tests/accounts/solana.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ItemType, MessageType } from "../../src/messages/types";
import { post, solana } from "../index";
import { Keypair } from "@solana/web3.js";
import { panthomLikeProvider, officialLikeProvider } from "../providers/solanaProvider";
import { verifySolana } from "../index";
import verifySolana from "../index";
import { GetVerificationBuffer } from "../../src/messages";
import { EphAccountList } from "../testAccount/entryPoint";
import fs from "fs";
Expand Down
2 changes: 1 addition & 1 deletion tests/accounts/tezos.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { DEFAULT_API_V2 } from "../../src/global";
import { b58cencode, prefix, validateSignature } from "@taquito/utils";
import { EphAccountList } from "../testAccount/entryPoint";
import fs from "fs";
import { verifyTezos } from "../../src/utils/signature/verifyTezos";
import verifyTezos from "../../src/utils/signature/verifyTezos";

if (!window) {
require("localstorage-polyfill");
Expand Down
6 changes: 3 additions & 3 deletions tests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import * as forget from "../src/messages/forget/index";
import * as program from "../src/messages/program/index";
import * as any from "../src/messages/any/index";

import { verifyEthereum } from "../src/utils/signature/verifyEthereum";
import { verifySolana } from "../src/utils/signature/verifySolana";
import { verifyAvalanche } from "../src/utils/signature/verifyAvalanche";
import verifyEthereum from "../src/utils/signature/verifyEthereum";
import verifySolana from "../src/utils/signature/verifySolana";
import verifyAvalanche from "../src/utils/signature/verifyAvalanche";

export {
avalanche,
Expand Down
2 changes: 1 addition & 1 deletion testsAuto/accounts/substrate.auto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { testsFunc } from "../index";
import { accounts, messages } from "../../src";
import { Chain, ItemType, MessageType } from "../../src/messages/types";
import fs from "fs";
import { verifySubstrate } from "../../src/utils/signature";
import verifySubstrate from "../../src/utils/signature";

/**
* This is the first test of the test bach for substrate.
Expand Down

0 comments on commit f8c8f78

Please sign in to comment.