NaturalSelectionLabs/RSS3-SDK-for-JavaScript

Why this test case passed?

jukanntenn opened this issue · 2 comments

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?

You are right, it was fixed in 93dca7b

It passed because they both return a promise, which is pointless.

That's cool. So for jest, Promise equals Promise, at least in this test case.