Skip to content

Commit

Permalink
fix(tests): update tests with new name
Browse files Browse the repository at this point in the history
  • Loading branch information
Atticus committed Mar 21, 2024
1 parent f02d83f commit 2cd1b5c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/common/ar-io.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ export class ArIO implements ArIOContract, BaseContract<ArIOState> {
evaluationOptions,
}: EvaluationParameters = {}): Promise<Record<string, ArNSNameData>> {
const state = await this.contract.getState({ evaluationOptions });
console.log(state);
return state.records;
}

Expand Down
4 changes: 1 addition & 3 deletions src/common/contracts/remote-contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ export class RemoteContract<T> implements ContractInteractionProvider<T> {
{ state: T }
>({
endpoint: ``,
params: {
...evaluationOptions?.evalTo,
},
params: evaluationOptions?.evalTo,
});
return state;
}
Expand Down
20 changes: 13 additions & 7 deletions tests/ar-io.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const arweave = Arweave.init({
port: 443,
});
const gatewayAddress = '1H7WZIWhzwTH9FIcnuMqYkTsoyv1OTfGa_amvuYwrgo';
const domain = 'ar-io';
const domain = 'uniswap';
const evaluateToBlockHeight = 1377100;
const evaluateToSortKey = new SmartWeaveSortKey(
'000001376946,0000000000000,18d52956c8e13ae1f557b4e67f6f298b8ffd2a5cd96e42ec24ca649b7401510f',
Expand All @@ -36,12 +36,18 @@ describe('ArIO Client', () => {
expect(arIO).toBeInstanceOf(ArIO);
});

// it('should connect and return a valid instance', async () => {
// const jwk = await arweave.wallets.generate();
// const signer = new ArweaveSigner(jwk);
// expect(arIO.connect(signer)).toBeDefined();
// expect(arIO).toBeInstanceOf(ArIO);
// });
it('should connect and return a valid instance', async () => {
const jwk = await arweave.wallets.generate();
const signer = new ArweaveSigner(jwk);
const client = new ArIO({
contract: new RemoteContract<ArIOState>({
contractTxId: ARNS_DEVNET_REGISTRY_TX,
url: process.env.REMOTE_CACHE_URL || 'http://localhost:3000',
}),
});
expect(client.connect(signer)).toBeDefined();
expect(client).toBeInstanceOf(ArIO);
});

it('should should return undefined for non existent gateway', async () => {
const nonExistent = await arIO.getGateway({
Expand Down

0 comments on commit 2cd1b5c

Please sign in to comment.