Skip to content

Commit

Permalink
Merge pull request #12 from TradeTrust/feat/add-amoy-network
Browse files Browse the repository at this point in the history
feat: add support for polygon Amoy testnet
  • Loading branch information
isaackps committed Mar 7, 2024
2 parents 3ccb184 + 85a6ac6 commit 4557d19
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
32 changes: 24 additions & 8 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,16 +257,32 @@ describe("queryDns", () => {
});

describe("getDocumentStoreRecords for Hedera", () => {
const sampleDnsTextRecord = {
type: "openatts",
net: "hedera",
netId: "296",
dnssec: false,
addr: "0x3DE43bfd3D771931E46CbBd4EDE0D3d95C85f81A",
};
const sampleDnsTextRecord = [
{
type: "openatts",
net: "hedera",
netId: "296",
dnssec: false,
addr: "0x3DE43bfd3D771931E46CbBd4EDE0D3d95C85f81A",
},
{
addr: "0x222B69788e2e9B7FB93a3a0fE258D4604Dc7df21",
dnssec: false,
net: "hedera",
netId: "295",
type: "openatts",
},
{
addr: "0x222B69788e2e9B7FB93a3a0fE258D4604Dc7df21",
dnssec: false,
net: "hedera",
netId: "296",
type: "openatts",
},
];

test("it should work with trustlv.org", async () => {
const records = await getDocumentStoreRecords("trustlv.org");
expect(records).toStrictEqual([sampleDnsTextRecord]);
expect(records).toStrictEqual(sampleDnsTextRecord);
});
});
2 changes: 2 additions & 0 deletions src/records/dnsTxt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export enum EthereumNetworks {
sepolia = "11155111",
polygon = "137",
polygonMumbai = "80001",
polygonAmoy = "80002",
local = "1337",
xdc = "50",
xdcapothem = "51",
Expand All @@ -41,6 +42,7 @@ export const EthereumNetworkIdT = Union(
Literal(EthereumNetworks.sepolia),
Literal(EthereumNetworks.polygon),
Literal(EthereumNetworks.polygonMumbai),
Literal(EthereumNetworks.polygonAmoy),
Literal(EthereumNetworks.xdc),
Literal(EthereumNetworks.xdcapothem),
Literal(EthereumNetworks.stabilityTestnet),
Expand Down

0 comments on commit 4557d19

Please sign in to comment.