Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
blockiosaurus authored and github-actions[bot] committed Aug 12, 2024
1 parent f3d99c8 commit 326e19c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
4 changes: 3 additions & 1 deletion packages/umi-eddsa-web3js/src/createWeb3JsEddsa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
17 changes: 10 additions & 7 deletions packages/umi-eddsa-web3js/test/Web3JsEddsa.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
});

Expand All @@ -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");
});
t.true(
keypair.publicKey.toString() ==
'HUaeN9AVCpTU6QvEmE48wAttKmQEh6RsRd5cWaXqkhVk'
);
});
7 changes: 6 additions & 1 deletion packages/umi-eddsa-web3js/test/test.json
Original file line number Diff line number Diff line change
@@ -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]
[
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
]

0 comments on commit 326e19c

Please sign in to comment.