ethers.js/src.ts/_tests/test-providers-wildcard.ts

21 lines
827 B
TypeScript
Raw Normal View History

2022-09-16 05:20:48 +03:00
import assert from "assert";
import { connect } from "./create-provider.js";
describe("Test EIP-2544 ENS wildcards", function() {
2022-10-20 12:00:49 +03:00
const provider = connect("goerli");
2022-09-16 05:20:48 +03:00
it("Resolves recursively", async function() {
const resolver = await provider.getResolver("ricmoose.hatch.eth");
assert.ok(resolver, "failed to get resolver");
2022-10-20 12:00:49 +03:00
assert.equal(resolver.address, "0x15abA1fa74Bfdecd63A71218DC632d4328Db8168", "address");
2022-09-16 05:20:48 +03:00
assert.equal(await resolver.supportsWildcard(), true, "supportsWildcard()");
// Test pass-through avatar
assert.equal(await resolver.getAvatar(), "https:/\/static.ricmoo.com/uploads/profile-06cb9c3031c9.jpg", "getAvatar()");
2022-10-20 12:00:49 +03:00
assert.equal(await resolver.getAddress(), "0x4B711A377B1b3534749FBe5e59Bcf7F94d92EA98", "getAddress()");
2022-09-16 05:20:48 +03:00
});
});