Skip to content

Commit

Permalink
Fix some typos and old comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienGllmt committed Feb 16, 2024
1 parent 320fb10 commit 5c6c9ca
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions packages/batcher/address-validator/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import { ethers } from 'ethers';

// todo: should be in @paima/crypto
export class EthersEvmCrypto implements IVerify {
constructor() {}

verifyAddress = async (address: string): Promise<boolean> => {
// TODO: improve
return await Promise.resolve(/^0x[0-9A-Fa-f]+$/.test(address));
Expand All @@ -37,7 +35,7 @@ export class EthersEvmCrypto implements IVerify {
const recoveredAddr = ethers.verifyMessage(message, signature);
return await Promise.resolve(recoveredAddr.toLowerCase() === userAddress.toLowerCase());
} catch (err) {
console.error('[address-validator] error verifying cardano signature:', err);
console.error('[address-validator] error verifying evm signature:', err);
return await Promise.resolve(false);
}
};
Expand Down
2 changes: 1 addition & 1 deletion packages/batcher/utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,6 @@ export async function getWalletWeb3AndAddress(
gameName: 'foo',
gameChainId: undefined,
},
signer // todo: wallet should be a signer, but this fails for some reason
signer
);
}
2 changes: 1 addition & 1 deletion packages/paima-sdk/paima-crypto/src/evm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class EvmCrypto implements IVerify {
const recoveredAddr = this.web3.eth.accounts.recover(message, signature);
return await Promise.resolve(recoveredAddr.toLowerCase() === userAddress.toLowerCase());
} catch (err) {
doLog('[address-validator] error verifying cardano signature:', err);
doLog('[address-validator] error verifying evm signature:', err);
return await Promise.resolve(false);
}
};
Expand Down

0 comments on commit 5c6c9ca

Please sign in to comment.