Diff
Not logged in

Differences From Artifact [651ec6acbd]:

To Artifact [d20382e35c]:


2
3
4
5
6
7
8
9

10
11
12
13
14
15




16
17
18
19
20
21
22
import client from '../src/ffi/client_manager';

/* eslint-disable import/prefer-default-export */
export const getRandomCredentials = () => (
  /* eslint-disable import/prefer-default-export */
  {
    locator: crypto.randomBytes(32).toString('hex').slice(0, 15),
    secret: crypto.randomBytes(32).toString('hex').slice(0, 15)

  }
);

export const createRandomAccount = () => {
  const randomCredentials = getRandomCredentials();
  return client.createAccount(randomCredentials.locator, randomCredentials.secret)




    .then(() => randomCredentials);
};

export const clearAccount = () => {
  client.setNetworkListener(() => {});
  client.logout();
};







|
>





|
>
>
>
>







2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import client from '../src/ffi/client_manager';

/* eslint-disable import/prefer-default-export */
export const getRandomCredentials = () => (
  /* eslint-disable import/prefer-default-export */
  {
    locator: crypto.randomBytes(32).toString('hex').slice(0, 15),
    secret: crypto.randomBytes(32).toString('hex').slice(0, 15),
    invite: crypto.randomBytes(10).toString('hex')
  }
);

export const createRandomAccount = () => {
  const randomCredentials = getRandomCredentials();
  return client.createAccount(
    randomCredentials.locator,
    randomCredentials.secret,
    randomCredentials.invite
  )
    .then(() => randomCredentials);
};

export const clearAccount = () => {
  client.setNetworkListener(() => {});
  client.logout();
};