Ejemplo n.º 1
0
    it('generates a valid address', () => {
      const phrase = randomPhrase(12);

      return phraseToAddress(phrase).then((address) => {
        expect(address.length).to.be.equal(42);
        expect(address.slice(0, 4)).to.be.equal('0x00');
      });
    });
Ejemplo n.º 2
0
    it('generates a valid wallet object', () => {
      const phrase = randomPhrase(12);

      return phraseToWallet(phrase).then((wallet) => {
        expect(wallet.address.length).to.be.equal(42);
        expect(wallet.secret.length).to.be.equal(66);
        expect(wallet.public.length).to.be.equal(130);

        expect(wallet.address.slice(0, 4)).to.be.equal('0x00');
        expect(wallet.secret.slice(0, 2)).to.be.equal('0x');
        expect(wallet.public.slice(0, 2)).to.be.equal('0x');
      });
    });
Ejemplo n.º 3
0
 register('parity_generateSecretPhrase', () => {
   return randomPhrase(12);
 });