Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,50 @@ describe("parseDocumentStoreResults", () => {
];
expect(parseDocumentStoreResults(sampleRecord, true)).toStrictEqual([]);
});

test("it should accept Mantle mainnet (netId 5000)", () => {
const addr = "0x2f60375e8144e16Adf1979936301D8341D58C36C";
const sampleRecord = [
{
name: "example.example.com.",
type: 16,
TTL: 110,
data: `"openatts net=ethereum netId=5000 addr=${addr}"`,
dnssec: false,
},
];
expect(parseDocumentStoreResults(sampleRecord, false)).toStrictEqual([
{
type: "openatts",
net: "ethereum",
netId: "5000",
addr,
dnssec: false,
},
]);
});

test("it should accept Mantle testnet (netId 5003)", () => {
const addr = "0x2f60375e8144e16Adf1979936301D8341D58C36C";
const sampleRecord = [
{
name: "example.example.com.",
type: 16,
TTL: 110,
data: `"openatts net=ethereum netId=5003 addr=${addr}"`,
dnssec: false,
},
];
expect(parseDocumentStoreResults(sampleRecord, false)).toStrictEqual([
{
type: "openatts",
net: "ethereum",
netId: "5003",
addr,
dnssec: false,
},
]);
});
});

describe("queryDns", () => {
Expand Down Expand Up @@ -321,6 +365,13 @@ describe("getDocumentStoreRecords for Astron", () => {
addr: "0x18bc0127Ae33389cD96593a1a612774fD14c0737",
dnssec: false,
},
{
type: "openatts",
net: "ethereum",
netId: "1338",
addr: "0x94FD21A026E29E0686583b8be71Cb28a8ca1A8d4",
dnssec: false,
},
{
type: "openatts",
net: "ethereum",
Expand Down
6 changes: 5 additions & 1 deletion src/records/dnsTxt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export enum EthereumNetworks {
stability = "101010",
astronTestnet = "21002",
astron = "1338",
mantle = "5000",
mantleTestnet = "5003",
}

export const EthereumNetworkIdT = Union(
Expand All @@ -39,7 +41,9 @@ export const EthereumNetworkIdT = Union(
Literal(EthereumNetworks.stability),
Literal(EthereumNetworks.local),
Literal(EthereumNetworks.astronTestnet),
Literal(EthereumNetworks.astron)
Literal(EthereumNetworks.astron),
Literal(EthereumNetworks.mantle),
Literal(EthereumNetworks.mantleTestnet)
);

export const OpenAttestationDNSTextRecordT = Record({
Expand Down