Skip to content

Commit

Permalink
Fix documentation (TrueFiEng#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
VladStarostenko authored May 25, 2020
1 parent 86276ef commit 0175b3e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 23 deletions.
6 changes: 3 additions & 3 deletions docs/source/basic-testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ You can also get an empty random wallet by calling:
Setup ENS
---------

To setup basic ENS use provider's function `setupENS()`.
To setup basic ENS use the provider's function :code:`setupENS()`.

.. code-block:: ts
Expand All @@ -67,9 +67,9 @@ To setup basic ENS use provider's function `setupENS()`.
const provider = new MockProvider();
await provider.setupENS();
By default this method use last `wallet` from provider's wallets, but you can pass your own `wallet` as argument for `setupENS(wallet)`.
This method employs the last of the provider's :code:`wallets` by default, but you can pass your own :code:`wallet` as an argument for :code:`setupENS(wallet)`.

Also `setupENS()` method sets ENS address to provider's networks.
Also :code:`setupENS()` method saves ENS address in the provider's networks.

Read more about ENS functions here :ref:`ens`.

Expand Down
22 changes: 12 additions & 10 deletions docs/source/ens.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _ens:

ENS
===

Expand All @@ -22,7 +24,7 @@ Also, if you use :code:`MockProvider`, you can use :code:`setupENS()` function i
Creating top level domain
-------------------------

Use :code:`createTopLevelDomain` function to creating top level domain:
Use :code:`createTopLevelDomain` function to create a top level domain:

.. code-block:: ts
Expand All @@ -31,35 +33,35 @@ Use :code:`createTopLevelDomain` function to creating top level domain:
Creating sub domain
-------------------

Use :code:`createSubDomain` function to creating sub domain:
Use :code:`createSubDomain` function for creating a sub domain:

.. code-block:: ts
await ensBuilder.createSubDomain('ethworks.test');
Also, it's possible to create sub domain recursively, if top domain doesn't exist, by specifying the appropriate option:
Also, it's possible to create a sub domain recursively, if the top domain doesn't exist, by specifying the appropriate option:

.. code-block:: ts
await ens.createSubDomain('waffle.ethworks.tld', {recursive: true});
await ens.createSubDomain('waffle.ethworks.tld', {recursive: true});
Setting address
---------------

Use :code:`setAddress` function for setting address for domain:
Use :code:`setAddress` function for setting address for the domain:

.. code-block:: ts
await ensBuilder.setAddress('vlad.ethworks.test', '0x001...03');
await ensBuilder.setAddress('vlad.ethworks.test', '0x001...03');
Also, it's possible to set address for domain recursively, if domain doesn't exist, by specifying the appropriate option:
Also, it's possible to set an address for domain recursively, if the domain doesn't exist, by specifying the appropriate option:

.. code-block:: ts
await ens.setAddress('vlad.waffle.ethworks.tld', '0x001...03', {recursive: true});
await ens.setAddress('vlad.waffle.ethworks.tld', '0x001...03', {recursive: true});
Use :code:`setAddressWithReverse` function for setting address for the domain and make this domain reverse. Add recursive option if domain doesn't exist:
Use :code:`setAddressWithReverse` function for setting address for the domain and make this domain reverse. Add recursive option if the domain doesn't exist:

.. code-block:: ts
await ens.setAddressWithReverse('vlad.ethworks.tld', wallet, {recursive: true});
await ens.setAddressWithReverse('vlad.ethworks.tld', wallet, {recursive: true});
16 changes: 8 additions & 8 deletions waffle-ens/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# @ethereum-waffle/ens

A simple ens builder for testing with ENS.
A simple `ENS` for testing.

## Installation

Expand All @@ -16,7 +16,7 @@ yarn add --dev ethereum-waffle
npm install --save-dev ethereum-waffle
```

If you want to use this package directly please install it via:
If you want to use this package directly, please install it via:
```
yarn add --dev @ethereum-waffle/ens
npm install --save-dev @ethereum-waffle/ens
Expand All @@ -37,7 +37,7 @@ To create `ENS`, you should submit your `wallet`, available in `MockProvider` cl
You can read more about ENS [in the ENS's documentation](https://docs.ens.domains/).

### Examples:
Creating of ENS:
Creating ENS:
```ts
import {MockProvider} from '@ethereum-waffle/provider';
import {deployENS, ENS} from '@ethereum-waffle/ens';
Expand All @@ -49,19 +49,19 @@ const ens: ENS = await deployENS(wallet);

### Usage

Use `createTopLevelDomain` function to creating top level domain:
Use `createTopLevelDomain` function to create a top level domain:

```ts
await ens.createTopLevelDomain('test');
```

Use `createSubDomain` function to creating sub domain:
Use `createSubDomain` function for creating a sub domain:

```ts
await ens.createSubDomain('ethworks.test');
```

Also, it's possible to create sub domain recursively, if top domain doesn't exist, by specifying the appropriate option:
Also, it's possible to create a sub domain recursively, if the top domain doesn't exist, by specifying the appropriate option:

```ts
await ens.createSubDomain('ethworks.tld', {recursive: true});
Expand All @@ -72,13 +72,13 @@ Use `setAddress` function for setting address for the domain:
```ts
await ens.setAddress('vlad.ethworks.test', '0x001...03');
```
Also, it's possible to set address for the domain recursively, if domain doesn't exist, by specifying the appropriate option:
Also, it's possible to set an address for the domain recursively, if the domain doesn't exist, by specifying the appropriate option:

```ts
await ens.setAddress('vlad.ethworks.tld', '0x001...03', {recursive: true});
```

Use `setAddressWithReverse` function for setting address for the domain and make this domain reverse. Add recursive option if domain doesn't exist:
Use `setAddressWithReverse` function for setting address for the domain and make this domain reverse. Add recursive option if the domain doesn't exist:

```ts
await ens.setAddressWithReverse('vlad.ethworks.tld', wallet, {recursive: true});
Expand Down
4 changes: 2 additions & 2 deletions waffle-provider/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ describe('waffle tests', async () => {
})
```

Use `setupENS` function to set up your `ens` and setting ens address to provider's networks. The function accepts
the `wallet` as an argument, and if you call it without an argument, it will use last `wallet` from `MockProvider`.
Use `setupENS` function to set up your `ens` and setting ens address to the provider's networks. The function accepts
the `wallet` as an argument, and if you call it without an argument, it will use the last `wallet` from `MockProvider`.

```ts
import {expect} from 'chai';
Expand Down

0 comments on commit 0175b3e

Please sign in to comment.