Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/celeste migration #140

Merged
merged 6 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 39 additions & 39 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"@babel/runtime": "7.x"
},
"dependencies": {
"@toruslabs/constants": "^13.2.0",
"@toruslabs/constants": "^13.4.0",
"@toruslabs/eccrypto": "^4.0.0",
"@toruslabs/http-helpers": "^6.1.0",
"@toruslabs/http-helpers": "^6.1.1",
"bn.js": "^5.2.1",
"elliptic": "^6.5.5",
"ethereum-cryptography": "^2.1.3",
Expand All @@ -34,12 +34,12 @@
},
"devDependencies": {
"@babel/register": "^7.23.7",
"@babel/runtime": "^7.24.0",
"@babel/runtime": "^7.24.5",
"@toruslabs/config": "^2.0.2",
"@toruslabs/eslint-config-typescript": "^3.2.0",
"@toruslabs/fetch-node-details": "^13.2.0",
"@toruslabs/torus-scripts": "^5.3.0",
"@types/chai": "^4.3.12",
"@toruslabs/fetch-node-details": "^13.4.0",
"@toruslabs/torus-scripts": "^5.3.1",
"@types/chai": "^4.3.16",
"@types/elliptic": "^6.4.18",
"@types/faker": "^5.5.3",
"@types/json-stable-stringify": "^1.0.36",
Expand All @@ -54,12 +54,12 @@
"husky": "^9.0.11",
"jsonwebtoken": "^9.0.2",
"lint-staged": "^15.2.2",
"mocha": "^10.3.0",
"mocha": "^10.4.0",
"prettier": "^3.2.5",
"rimraf": "^5.0.5",
"sinon": "^17.0.1",
"ts-node": "^10.9.2",
"typescript": "^5.4.2"
"typescript": "^5.4.5"
},
"repository": {
"type": "git",
Expand Down
22 changes: 1 addition & 21 deletions src/helpers/common.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Ecies } from "@toruslabs/eccrypto";
import JsonStringify from "json-stable-stringify";

import { EciesHex, LegacyVerifierLookupResponse, VerifierLookupResponse } from "../interfaces";
import { EciesHex, VerifierLookupResponse } from "../interfaces";

// this function normalizes the result from nodes before passing the result to threshold check function
// For ex: some fields returns by nodes might be different from each other
Expand All @@ -25,26 +25,6 @@ export const normalizeKeysResult = (result: VerifierLookupResponse) => {
return finalResult;
};

// this function normalizes the result from nodes before passing the result to threshold check function
// For ex: some fields returns by nodes might be different from each other
// like key_index which may differ on sapphire_network for each queried node
export const normalizeLegacyKeysResult = (result: LegacyVerifierLookupResponse) => {
const finalResult: Pick<LegacyVerifierLookupResponse, "keys"> = {
keys: [],
};
if (result && result.keys && result.keys.length > 0) {
const finalKey = result.keys[0];
finalResult.keys = [
{
pub_key_X: finalKey.pub_key_X,
pub_key_Y: finalKey.pub_key_Y,
address: finalKey.address,
},
];
}
return finalResult;
};

export const kCombinations = (s: number | number[], k: number): number[][] => {
let set = s;
if (typeof set === "number") {
Expand Down
Loading
Loading