Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should call signMessageWithPassphrase', () => {
cryptography.signMessage(input);
return expect(
cryptographyModule.signMessageWithPassphrase,
).to.be.calledWithExactly(input.message, input.passphrase);
});
});
export const signMessage = ({ message, passphrase }: SignMessageInputs) =>
cryptography.signMessageWithPassphrase(message, passphrase);
const processInputs = (message?: string) => ({
passphrase,
data,
}: InputFromSourceOutput) => {
const targetMessage = message || data;
if (!targetMessage) {
throw new ValidationError('No message was provided.');
}
if (!passphrase) {
throw new ValidationError('No passphrase was provided.');
}
return signMessageWithPassphrase(targetMessage, passphrase);
};