diff --git a/packages/umi-eddsa-web3js/src/createWeb3JsEddsa.ts b/packages/umi-eddsa-web3js/src/createWeb3JsEddsa.ts index 260fa12..2566dbb 100644 --- a/packages/umi-eddsa-web3js/src/createWeb3JsEddsa.ts +++ b/packages/umi-eddsa-web3js/src/createWeb3JsEddsa.ts @@ -31,7 +31,9 @@ export function createWeb3JsEddsa(): EddsaInterface { fromWeb3JsKeypair(Web3JsKeypair.fromSeed(seed)); const createKeypairFromFile = (path: string): Keypair => - createKeypairFromSecretKey(new Uint8Array(JSON.parse(readFileSync(path).toString()))); + createKeypairFromSecretKey( + new Uint8Array(JSON.parse(readFileSync(path).toString())) + ); const createKeypairFromSolanaConfig = (): Keypair => fromWeb3JsKeypair(SolanaCliConfig.load().loadKeypair()); diff --git a/packages/umi-eddsa-web3js/test/Web3JsEddsa.test.ts b/packages/umi-eddsa-web3js/test/Web3JsEddsa.test.ts index 15d469d..e7d7f24 100644 --- a/packages/umi-eddsa-web3js/test/Web3JsEddsa.test.ts +++ b/packages/umi-eddsa-web3js/test/Web3JsEddsa.test.ts @@ -16,10 +16,10 @@ test('it can create a new private key', async (t) => { // And the secret key is valid. t.true( typeof keypair.secretKey === 'object' && - typeof keypair.secretKey.BYTES_PER_ELEMENT === 'number' && - typeof keypair.secretKey.length === 'number' && - keypair.secretKey.BYTES_PER_ELEMENT === 1 && - keypair.secretKey.length === 64 + typeof keypair.secretKey.BYTES_PER_ELEMENT === 'number' && + typeof keypair.secretKey.length === 'number' && + keypair.secretKey.BYTES_PER_ELEMENT === 1 && + keypair.secretKey.length === 64 ); }); @@ -40,8 +40,11 @@ test('it can sign and verify messages', async (t) => { test('it can create a keypair from a file', async (t) => { // Given a keypair file. const eddsa = createWeb3JsEddsa(); - const keypair = eddsa.createKeypairFromFile("test/test.json"); + const keypair = eddsa.createKeypairFromFile('test/test.json'); // Then we expect the signature to be valid. - t.true(keypair.publicKey.toString() == "HUaeN9AVCpTU6QvEmE48wAttKmQEh6RsRd5cWaXqkhVk"); -}); \ No newline at end of file + t.true( + keypair.publicKey.toString() == + 'HUaeN9AVCpTU6QvEmE48wAttKmQEh6RsRd5cWaXqkhVk' + ); +}); diff --git a/packages/umi-eddsa-web3js/test/test.json b/packages/umi-eddsa-web3js/test/test.json index b2a3e51..c2ef5bc 100644 --- a/packages/umi-eddsa-web3js/test/test.json +++ b/packages/umi-eddsa-web3js/test/test.json @@ -1 +1,6 @@ -[52,164,75,60,77,252,108,145,74,181,35,32,89,22,231,157,245,70,255,49,225,78,203,55,121,240,77,246,224,78,24,79,244,203,182,220,132,185,2,89,57,34,151,38,211,134,214,168,177,118,159,131,163,161,198,114,45,178,239,183,160,72,46,91] \ No newline at end of file +[ + 52, 164, 75, 60, 77, 252, 108, 145, 74, 181, 35, 32, 89, 22, 231, 157, 245, + 70, 255, 49, 225, 78, 203, 55, 121, 240, 77, 246, 224, 78, 24, 79, 244, 203, + 182, 220, 132, 185, 2, 89, 57, 34, 151, 38, 211, 134, 214, 168, 177, 118, 159, + 131, 163, 161, 198, 114, 45, 178, 239, 183, 160, 72, 46, 91 +]