Skip to content

Commit

Permalink
feat(arns stats): include arns stats type on epoch PE-7562
Browse files Browse the repository at this point in the history
  • Loading branch information
fedellen committed Feb 4, 2025
1 parent 9e904d9 commit f92ee91
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/types/io.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ export type AoEpochData = {
distributionTimestamp: Timestamp;
/** @deprecated - use `getDistributions` to get distribution data for a given epoch **/
distributions: AoEpochDistributionData;
arnsStats: {
totalReturnedNames: number;
totalActiveNames: number;
totalGracePeriodNames: number;
totalReservedNames: number;
};
};
export type AoTokenSupplyData = {
total: number;
Expand Down Expand Up @@ -333,8 +339,6 @@ export type AoAllGatewayVaults = AoGatewayVault & {
};

// Input types

// TODO: confirm what is required or if all can be optional and defaults will be provided
export type AoJoinNetworkParams = Pick<AoGateway, 'operatorStake'> &
Partial<AoGatewaySettings> & {
observerAddress?: WalletAddress;
Expand Down
12 changes: 12 additions & 0 deletions tests/e2e/esm/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,18 @@ describe('e2e esm tests', async () => {
it('should be able to get the current epoch', async () => {
const epoch = await ario.getCurrentEpoch();
assert.ok(epoch);
assert.equal(typeof epoch.epochIndex, 'number');
assert.equal(typeof epoch.startHeight, 'number');
assert.equal(typeof epoch.endTimestamp, 'number');
assert.equal(typeof epoch.distributionTimestamp, 'number');
assert.equal(typeof epoch.arnsStats.totalReservedNames, 'number');
assert.equal(typeof epoch.arnsStats.totalActiveNames, 'number');
assert.equal(typeof epoch.arnsStats.totalReturnedNames, 'number');
assert.equal(typeof epoch.arnsStats.totalGracePeriodNames, 'number');
assert(Array.isArray(epoch.prescribedObservers));
assert(Array.isArray(epoch.prescribedNames));
assert(Array.isArray(epoch.observations.failureSummaries));
assert(Array.isArray(epoch.observations.reports));
});

it('should be able to get epoch-settings', async () => {
Expand Down

0 comments on commit f92ee91

Please sign in to comment.