Why this test case passed?
jukanntenn opened this issue · 2 comments
jukanntenn commented
test('Account.sign with singer', () => {
const signer = ethers.Wallet.createRandom();
const rss3 = new RSS3({
endpoint: '',
mnemonic: signer.mnemonic.phrase,
});
expect(
rss3.account.sign({
agent_id: 'test',
test1: 'r',
}),
).toEqual(
signer.signMessage(
object.stringifyObj({
test1: 'r',
}),
),
);
});
It seems that Account.sign
returns nothing while signer.signMessage
return the signature it signed. Could the results to be equal?
DIYgod commented
You are right, it was fixed in 93dca7b
It passed because they both return a promise, which is pointless.
jukanntenn commented
That's cool. So for jest, Promise equals Promise, at least in this test case.