Skip to content
Draft
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
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "16.0.0",
"version": "16.0.1-alpha.0",
"packages": ["packages/*"],
"npmClient": "npm"
}
14 changes: 7 additions & 7 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tkey/core",
"version": "16.0.0",
"version": "16.0.1-alpha.0",
"description": "TKey Core library",
"main": "dist/lib.cjs/index.js",
"module": "dist/lib.esm/index.js",
Expand Down
27 changes: 27 additions & 0 deletions packages/core/src/core.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import {
BNString,
CatchupToLatestShareResult,
Expand Down Expand Up @@ -335,6 +336,8 @@ class ThresholdKey implements ITKey {
throw CoreError.default("Input is not supported");
}

console.log("have shareStore from postboxkey for polynomial", shareStore.polynomialID);

// We determine the latest metadata on the SDK and if there has been
// needed transitions to include
let currentMetadata: Metadata;
Expand All @@ -353,6 +356,15 @@ class ThresholdKey implements ITKey {
}
}

console.log("latestShareDetails polyIDList", latestShareDetails.shareMetadata.polyIDList);
console.log("latestShareDetails latestShare polynomialID", latestShareDetails.latestShare.polynomialID);

console.log("reinitializing", reinitializing);
console.log("reinitializingWithNewKeyAssign", reinitializingWithNewKeyAssign);

console.log("reinitializing", reinitializing);
console.log("reinitializingWithNewKeyAssign", reinitializingWithNewKeyAssign);

// lets check if the cloud metadata has been updated or not from previously if we are reinitializing
if (reinitializing && !reinitializingWithNewKeyAssign) {
if (previouslyFetchedCloudMetadata.nonce < latestShareDetails.shareMetadata.nonce) {
Expand All @@ -375,11 +387,17 @@ class ThresholdKey implements ITKey {
currentMetadata = latestShareDetails.shareMetadata;
}

console.log("Final current Metadata polyIDList", currentMetadata.polyIDList);
console.log("Final current Metadata PublicPolynomial", currentMetadata.publicPolynomials);
console.log("Final current Metadata latestShare polynomialID", currentMetadata.getLatestPublicPolynomial().getPolynomialID());

this.lastFetchedCloudMetadata = latestCloudMetadata;
this.metadata = currentMetadata.clone();
const latestShare = latestShareDetails ? latestShareDetails.latestShare : shareStore;
this.inputShareStore(latestShare);

console.log("Final latest share polynomialID", latestShare.polynomialID);

if (importEd25519Seed && this.getEd25519PublicKey()) {
throw CoreError.default("Ed25119 key already exists");
}
Expand All @@ -402,8 +420,13 @@ class ThresholdKey implements ITKey {
}): Promise<CatchupToLatestShareResult> {
const { shareStore, polyID, includeLocalMetadataTransitions } = params;
let shareMetadata: Metadata;
console.log("catchupToLatestShare");
try {
console.log("shareStore PolynomialID", shareStore.polynomialID);
shareMetadata = await this.getAuthMetadata({ privKey: shareStore.share.share, includeLocalMetadataTransitions });
console.log("shareMetadata PolynomialID", shareMetadata.polyIDList);
console.log("shareMetadata PublicPolynomial", shareMetadata.publicPolynomials);
console.log("shareMetadata PublicPolynomial", shareMetadata.getLatestPublicPolynomial().getPolynomialID());
} catch (error: unknown) {
// delete share error
const err = error as Error & { code?: number };
Expand All @@ -422,6 +445,7 @@ class ThresholdKey implements ITKey {
}
}
const nextShare = await shareMetadata.getEncryptedShare(shareStore);
console.log("have nextShare for share", shareStore.polynomialID);
return await this.catchupToLatestShare({ shareStore: nextShare, polyID, includeLocalMetadataTransitions });
} catch (error: unknown) {
// delete share error
Expand Down Expand Up @@ -816,7 +840,10 @@ class ThresholdKey implements ITKey {
throw CoreError.metadataUndefined();
}
const poly = this.metadata.getLatestPublicPolynomial();
console.log("getKeyDetails polyIDList", poly);
const previousPolyID = poly.getPolynomialID();
console.log("share polynomialID", Object.keys(this.shares));

const requiredShares = poly.getThreshold() - Object.keys(this.shares[previousPolyID]).length;

let shareDescriptions = this.metadata.getShareDescription();
Expand Down
4 changes: 2 additions & 2 deletions packages/default/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tkey/default",
"version": "16.0.0",
"version": "16.0.1-alpha.0",
"description": "TKey default library",
"main": "dist/lib.cjs/index.js",
"module": "dist/lib.esm/index.js",
Expand Down Expand Up @@ -35,7 +35,7 @@
],
"dependencies": {
"@tkey/common-types": "^16.0.0",
"@tkey/core": "^16.0.0",
"@tkey/core": "^16.0.1-alpha.0",
"@tkey/security-questions": "^16.0.0",
"@tkey/service-provider-base": "^16.0.0",
"@tkey/service-provider-torus": "^16.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/tss/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tkey/tss",
"version": "16.0.0",
"version": "16.0.1-alpha.0",
"description": "Threshold signing for Tkey",
"main": "dist/lib.cjs/index.js",
"module": "dist/lib.esm/index.js",
Expand All @@ -22,7 +22,7 @@
"license": "ISC",
"dependencies": {
"@tkey/common-types": "^16.0.0",
"@tkey/core": "^16.0.0",
"@tkey/core": "^16.0.1-alpha.0",
"@tkey/service-provider-torus": "^16.0.0",
"@toruslabs/customauth": "^21.0.0",
"@toruslabs/http-helpers": "^8.1.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/web-storage/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tkey/web-storage",
"version": "16.0.0",
"version": "16.0.1-alpha.0",
"description": "TKey Web Storage Module",
"author": "Torus Labs",
"homepage": "https://github.com/tkey/tkey#readme",
Expand Down Expand Up @@ -48,7 +48,7 @@
"bn.js": "^5.2.1"
},
"devDependencies": {
"@tkey/core": "^16.0.0",
"@tkey/core": "^16.0.1-alpha.0",
"@tkey/service-provider-base": "^16.0.0",
"@tkey/storage-layer-torus": "^16.0.0",
"@types/filesystem": "^0.0.36"
Expand Down
Loading