diff --git a/src/io.ts b/src/io.ts index acf6ceb4..f97a98ef 100644 --- a/src/io.ts +++ b/src/io.ts @@ -66,67 +66,18 @@ export type EpochInput = // AO/IO Contract export type AoBalances = Record; -export type AoFees = Record; - -export type AoArNSNameLengths = - | 1 - | 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 - | 28 - | 29 - | 30 - | 31 - | 32 - | 33 - | 34 - | 35 - | 36 - | 37 - | 38 - | 39 - | 40 - | 41 - | 42 - | 43 - | 44 - | 45 - | 46 - | 47 - | 48 - | 49 - | 50 - | 51; -export type AoRegistrationFeeList = Record< - 1 | 2 | 3 | 4 | 5 | 'permabuy', - number ->; +const nameLengthArray = [ + 1, 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, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, +] as const; +const leaseLengthArray = [1, 2, 3, 4, 5] as const; export type AoRegistrationFees = Record< - AoArNSNameLengths, - AoRegistrationFeeList + (typeof nameLengthArray)[number], + { + lease: Record<(typeof leaseLengthArray)[number], number>; + permabuy: number; + } >; export type AoObservations = Record; export type AoEpochIndex = number; diff --git a/tests/e2e/cjs/index.test.js b/tests/e2e/cjs/index.test.js index 1641c874..9375c1c6 100644 --- a/tests/e2e/cjs/index.test.js +++ b/tests/e2e/cjs/index.test.js @@ -315,12 +315,13 @@ describe('IO', async () => { assert(registrationFees); assert.equal(Object.keys(registrationFees).length, 51); for (const nameLength of Object.keys(registrationFees)) { - assert(registrationFees[nameLength]['1']); - assert(registrationFees[nameLength]['2']); - assert(registrationFees[nameLength]['3']); - assert(registrationFees[nameLength]['4']); - assert(registrationFees[nameLength]['5']); - assert(registrationFees[nameLength]['permabuy']); + // assert lease is length of 5 + assert(registrationFees[nameLength]['lease']['1'] > 0); + assert(registrationFees[nameLength]['lease']['2'] > 0); + assert(registrationFees[nameLength]['lease']['3'] > 0); + assert(registrationFees[nameLength]['lease']['4'] > 0); + assert(registrationFees[nameLength]['lease']['5'] > 0); + assert(registrationFees[nameLength]['permabuy'] > 0); } }); it('should be able to create IOWriteable with valid signers', async () => { diff --git a/tests/e2e/esm/index.test.js b/tests/e2e/esm/index.test.js index 92f7a68b..1007b1a1 100644 --- a/tests/e2e/esm/index.test.js +++ b/tests/e2e/esm/index.test.js @@ -318,12 +318,13 @@ describe('IO', async () => { assert(registrationFees); assert.equal(Object.keys(registrationFees).length, 51); for (const nameLength of Object.keys(registrationFees)) { - assert(registrationFees[nameLength]['1']); - assert(registrationFees[nameLength]['2']); - assert(registrationFees[nameLength]['3']); - assert(registrationFees[nameLength]['4']); - assert(registrationFees[nameLength]['5']); - assert(registrationFees[nameLength]['permabuy']); + // assert lease is length of 5 + assert(registrationFees[nameLength]['lease']['1'] > 0); + assert(registrationFees[nameLength]['lease']['2'] > 0); + assert(registrationFees[nameLength]['lease']['3'] > 0); + assert(registrationFees[nameLength]['lease']['4'] > 0); + assert(registrationFees[nameLength]['lease']['5'] > 0); + assert(registrationFees[nameLength]['permabuy'] > 0); } }); diff --git a/tests/e2e/web/src/App.test.tsx b/tests/e2e/web/src/App.test.tsx index 3a36b143..241211bd 100644 --- a/tests/e2e/web/src/App.test.tsx +++ b/tests/e2e/web/src/App.test.tsx @@ -52,21 +52,4 @@ describe('ESM browser validation', () => { const result = screen.getByTestId('load-registry-result'); expect(result).toHaveTextContent('true'); }); - - it('should retrieve registration fees', async () => { - await act(async () => render()); - - await waitFor( - () => { - screen.getByTestId('load-registration-fees-result'); - }, - { - interval: 5_000, - timeout: 60_000, - }, - ); - - const result = screen.getByTestId('load-registration-fees-result'); - expect(result).toHaveTextContent('true'); - }); });