Skip to content

Commit

Permalink
eslint adjustments
Browse files Browse the repository at this point in the history
Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
  • Loading branch information
svetoslav-nikol0v committed Nov 21, 2023
1 parent a4ffb17 commit 4a15578
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/cryptography/src/PrivateKey.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export default class PrivateKey extends Key {

if (data.length == 32) {
console.warn(
"WARNING: Consider using fromStringECDSA() or fromStringED2551() on a HEX-encoded string and fromStringDer() on a HEX-encoded string with DER prefix instead."
"WARNING: Consider using fromStringECDSA() or fromStringED2551() on a HEX-encoded string and fromStringDer() on a HEX-encoded string with DER prefix instead.",
);
}

Expand All @@ -165,7 +165,7 @@ export default class PrivateKey extends Key {
}

throw new BadKeyError(
`private key cannot be decoded from bytes: ${message}`
`private key cannot be decoded from bytes: ${message}`,
);
}

Expand Down Expand Up @@ -321,19 +321,19 @@ export default class PrivateKey extends Key {
const { keyData, chainCode } = await slip10.derive(
this.toBytesRaw(),
this._key._chainCode,
index
index,
);

return new PrivateKey(new Ed25519PrivateKey(keyData, chainCode));
} else {
const { keyData, chainCode } = await bip32.derive(
this.toBytesRaw(),
this._key._chainCode,
index
index,
);

return new PrivateKey(
new EcdsaPrivateKey(ecdsa.fromBytes(keyData), chainCode)
new EcdsaPrivateKey(ecdsa.fromBytes(keyData), chainCode),
);
}
}
Expand All @@ -346,7 +346,7 @@ export default class PrivateKey extends Key {
async legacyDerive(index) {
const keyBytes = await derive.legacy(
this.toBytesRaw().subarray(0, 32),
index
index,
);

/** @type {new (bytes: Uint8Array) => Ed25519PrivateKey | EcdsaPrivateKey} */
Expand Down Expand Up @@ -387,7 +387,7 @@ export default class PrivateKey extends Key {

if (transaction._signedTransactions.length != 1) {
throw new Error(
"`PrivateKey.signTransaction()` requires `Transaction` to have a single node `AccountId` set"
"`PrivateKey.signTransaction()` requires `Transaction` to have a single node `AccountId` set",
);
}

Expand Down Expand Up @@ -422,7 +422,7 @@ export default class PrivateKey extends Key {
}

const siganture = this.sign(
tx.bodyBytes != null ? tx.bodyBytes : new Uint8Array()
tx.bodyBytes != null ? tx.bodyBytes : new Uint8Array(),
);

/** @type {ProtoSignaturePair} */
Expand Down

0 comments on commit 4a15578

Please sign in to comment.