diff --git a/src/lib/enr/enr.ts b/src/lib/enr/enr.ts index 990f7cdbfa..47c88f5ce8 100644 --- a/src/lib/enr/enr.ts +++ b/src/lib/enr/enr.ts @@ -20,7 +20,7 @@ import { IKeypair, KeypairType, } from "./keypair"; -import { mulitaddrFromFields } from "./multiaddr_from_fields"; +import { multiaddrFromFields } from "./multiaddr_from_fields"; import { decodeMultiaddrs, encodeMultiaddrs } from "./multiaddrs_codec"; import { ENRKey, ENRValue, NodeId, SequenceNumber } from "./types"; import * as v4 from "./v4"; @@ -367,7 +367,7 @@ export class ENR extends Map { return; } - return mulitaddrFromFields( + return multiaddrFromFields( isIpv6 ? "ip6" : "ip4", protoName, ipVal, diff --git a/src/lib/enr/multiaddr_from_fields.spec.ts b/src/lib/enr/multiaddr_from_fields.spec.ts index 959d2e511a..51250e2d3c 100644 --- a/src/lib/enr/multiaddr_from_fields.spec.ts +++ b/src/lib/enr/multiaddr_from_fields.spec.ts @@ -1,14 +1,14 @@ import { convertToBytes } from "@multiformats/multiaddr/convert"; import { expect } from "chai"; -import { mulitaddrFromFields } from "./multiaddr_from_fields"; +import { multiaddrFromFields } from "./multiaddr_from_fields"; describe("Multiaddr from fields", () => { it("tcp ip4 address", function () { const ipBytes = convertToBytes("ip4", "1.2.3.4"); const portBytes = convertToBytes("tcp", "3333"); - const ma = mulitaddrFromFields("ip4", "tcp", ipBytes, portBytes); + const ma = multiaddrFromFields("ip4", "tcp", ipBytes, portBytes); expect(ma.toString()).to.eq("/ip4/1.2.3.4/tcp/3333"); }); @@ -17,7 +17,7 @@ describe("Multiaddr from fields", () => { const ipBytes = convertToBytes("ip6", "2345:425:2ca1::5673:23b5"); const portBytes = convertToBytes("udp", "1111"); - const ma = mulitaddrFromFields("ip6", "udp", ipBytes, portBytes); + const ma = multiaddrFromFields("ip6", "udp", ipBytes, portBytes); expect(ma.toString()).to.eq("/ip6/2345:425:2ca1::5673:23b5/udp/1111"); }); diff --git a/src/lib/enr/multiaddr_from_fields.ts b/src/lib/enr/multiaddr_from_fields.ts index a93baa336c..f12bee403e 100644 --- a/src/lib/enr/multiaddr_from_fields.ts +++ b/src/lib/enr/multiaddr_from_fields.ts @@ -1,7 +1,7 @@ import { Multiaddr } from "@multiformats/multiaddr"; import { convertToString } from "@multiformats/multiaddr/convert"; -export function mulitaddrFromFields( +export function multiaddrFromFields( ipFamily: string, protocol: string, ipBytes: Uint8Array,