diff --git a/packages/crypto/src/constants.ts b/packages/crypto/src/constants.ts index d3fe154111..d028d3523f 100644 --- a/packages/crypto/src/constants.ts +++ b/packages/crypto/src/constants.ts @@ -4,8 +4,8 @@ export enum KeyType { SECP256K1 = 1, } -export enum KeySize { - SECRET_KEY = 32, - ED25519_PUBLIC_KEY = 32, - SECP256k1_PUBLIC_KEY = 64, -} \ No newline at end of file +export const KeySize = { + SECRET_KEY: 32, + ED25519_PUBLIC_KEY: 32, + SECP256k1_PUBLIC_KEY: 64, +}; diff --git a/packages/crypto/src/public_key.ts b/packages/crypto/src/public_key.ts index 06984cf83c..5aaf8e457e 100644 --- a/packages/crypto/src/public_key.ts +++ b/packages/crypto/src/public_key.ts @@ -30,7 +30,7 @@ function resolveEnumKeyName(keyType: KeyType) { return 'ed25519Key'; } case KeyType.SECP256K1: { - return 'secp256k1Key' + return 'secp256k1Key'; } default: { throw Error(`unknown type ${keyType}`); diff --git a/packages/keystores-browser/test/browser_keystore.test.ts b/packages/keystores-browser/test/browser_keystore.test.ts index 3b20fb7636..5b5541bbde 100644 --- a/packages/keystores-browser/test/browser_keystore.test.ts +++ b/packages/keystores-browser/test/browser_keystore.test.ts @@ -15,7 +15,7 @@ describe('Browser keystore', () => { }); describe('Browser multi keystore', () => { - let ctx: any = {}; + const ctx: any = {}; beforeAll(async () => { ctx.keyStore = new MultiContractBrowserLocalStorageKeyStore(LocalStorageMemory); diff --git a/packages/transactions/src/signature.ts b/packages/transactions/src/signature.ts index 573bdf2b47..e803450472 100644 --- a/packages/transactions/src/signature.ts +++ b/packages/transactions/src/signature.ts @@ -10,7 +10,7 @@ function resolveEnumKeyName(keyType: KeyType) { return 'ed25519Signature'; } case KeyType.SECP256K1: { - return 'secp256k1Signature' + return 'secp256k1Signature'; } default: { throw Error(`unknown type ${keyType}`); diff --git a/packages/utils/test/rpc-errors.test.ts b/packages/utils/test/rpc-errors.test.ts index 0f72a85469..6ed55094de 100644 --- a/packages/utils/test/rpc-errors.test.ts +++ b/packages/utils/test/rpc-errors.test.ts @@ -46,7 +46,7 @@ describe('rpc-errors', () => { }); test('test ShardCongested error', async () => { - let rpc_error = { + const rpc_error = { TxExecutionError: { InvalidTxError: { ShardCongested: { @@ -56,7 +56,7 @@ describe('rpc-errors', () => { } } }; - let error: any = parseRpcError(rpc_error); + const error: any = parseRpcError(rpc_error); expect(error.type === 'ShardCongested').toBe(true); expect(error.shard_id).toBe(2); expect(error.congestion_level).toBe(0.4); @@ -66,7 +66,7 @@ describe('rpc-errors', () => { }); test('test ShardStuck error', async () => { - let rpc_error = { + const rpc_error = { TxExecutionError: { InvalidTxError: { ShardStuck: { @@ -76,7 +76,7 @@ describe('rpc-errors', () => { } } }; - let error: any = parseRpcError(rpc_error); + const error: any = parseRpcError(rpc_error); expect(error.type === 'ShardStuck').toBe(true); expect(error.shard_id).toBe(2); expect(error.missed_chunks).toBe(5); @@ -86,7 +86,7 @@ describe('rpc-errors', () => { }); test('test ReceiptSizeExceeded error', async () => { - let rpc_error = { + const rpc_error = { TxExecutionError: { InvalidTxError: { ReceiptValidationError: { @@ -98,12 +98,12 @@ describe('rpc-errors', () => { } } }; - let error: any = parseRpcError(rpc_error); + const error: any = parseRpcError(rpc_error); expect(error.type === 'ReceiptSizeExceeded').toBe(true); expect(error.limit).toBe(100); expect(error.size).toBe(101); expect(formatError(error.type, error)).toBe( - '{\"type\":\"ReceiptSizeExceeded\",\"limit\":100,\"size\":101,\"kind\":{\"limit\":100,\"size\":101}}' + '{"type":"ReceiptSizeExceeded","limit":100,"size":101,"kind":{"limit":100,"size":101}}' ); });