Skip to content

Commit

Permalink
chore(docs): update readme for current epoch
Browse files Browse the repository at this point in the history
  • Loading branch information
dtfiedler committed Oct 15, 2024
1 parent 24959b3 commit 78cf932
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ const demandFactor = await io.getDemandFactor();

#### `getObservations({ epochIndex })`

Returns the epoch-indexed observation list.
Returns the epoch-indexed observation list. If no epoch index is provided, the current epoch is used.

```typescript
const io = IO.init();
Expand Down Expand Up @@ -625,7 +625,7 @@ const observations = await io.getObservations();

#### `getDistributions({ epochIndex })`

Returns the current rewards distribution information.
Returns the current rewards distribution information. If no epoch index is provided, the current epoch is used.

```typescript
const io = IO.init();
Expand Down Expand Up @@ -661,7 +661,7 @@ const distributions = await io.getDistributions({ epochIndex: 0 });

#### `getEpoch({ epochIndex })`

Returns the epoch data for the specified block height.
Returns the epoch data for the specified block height. If no epoch index is provided, the current epoch is used.

```typescript
const io = IO.init();
Expand Down
7 changes: 6 additions & 1 deletion tests/e2e/cjs/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,16 @@ describe('IO', async () => {
assert.ok(arns);
});

it('should be able to get the current epoch', async () => {
it('should be able to get the current epoch using getCurrentEpoch', async () => {
const epoch = await io.getCurrentEpoch();
assert.ok(epoch);
});

it('should be able to get the current epoch using getEpoch', async () => {
const epoch = await io.getEpoch({ epochIndex: 0 });
assert.ok(epoch);
});

it('should be able to get epoch-settings', async () => {
const epochSettings = await io.getEpochSettings();
assert.ok(epochSettings);
Expand Down

0 comments on commit 78cf932

Please sign in to comment.