Skip to content

Commit

Permalink
fix: add check for legacy network with keyType ed25519
Browse files Browse the repository at this point in the history
  • Loading branch information
ieow committed Feb 27, 2025
1 parent 6d824dc commit 11e91be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/torus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ class Torus {
const localKeyType = keyType ?? this.keyType;
const localEc = getKeyCurve(localKeyType);

if (localKeyType === KEY_TYPE.ED25519 && LEGACY_NETWORKS_ROUTE_MAP[this.network as TORUS_LEGACY_NETWORK_TYPE]) {
throw new Error(`keyType: ${keyType} is not supported by ${this.network} network`);
}

const keyAssignResult = await GetPubKeyOrKeyAssign({
endpoints,
network: this.network,
Expand Down

0 comments on commit 11e91be

Please sign in to comment.