mirror of https://github.com/waku-org/js-waku.git
chore: improve function name
By describe why one would use it.
This commit is contained in:
parent
a513087637
commit
031f4c0c21
|
@ -194,7 +194,7 @@ describe("ENR", function () {
|
|||
privateKey = hexToBytes(
|
||||
"b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291"
|
||||
);
|
||||
record = await ENR.createV4(secp.getPublicKey(privateKey));
|
||||
record = await ENR.createFromPublicKey(secp.getPublicKey(privateKey));
|
||||
record.setLocationMultiaddr(multiaddr("/ip4/127.0.0.1/udp/30303"));
|
||||
record.seq = seq;
|
||||
await record.encodeTxt(privateKey);
|
||||
|
@ -239,7 +239,7 @@ describe("ENR", function () {
|
|||
privateKey = hexToBytes(
|
||||
"b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291"
|
||||
);
|
||||
record = await ENR.createV4(secp.getPublicKey(privateKey));
|
||||
record = await ENR.createFromPublicKey(secp.getPublicKey(privateKey));
|
||||
});
|
||||
|
||||
it("should get / set UDP multiaddr", () => {
|
||||
|
|
|
@ -69,7 +69,7 @@ export class ENR extends Map<ENRKey, ENRValue> implements IEnr {
|
|||
return enr;
|
||||
}
|
||||
|
||||
static createV4(
|
||||
static createFromPublicKey(
|
||||
publicKey: Uint8Array,
|
||||
kvs: Record<ENRKey, ENRValue> = {}
|
||||
): Promise<ENR> {
|
||||
|
@ -90,7 +90,7 @@ export class ENR extends Map<ENRKey, ENRValue> implements IEnr {
|
|||
): Promise<ENR> {
|
||||
switch (peerId.type) {
|
||||
case "secp256k1":
|
||||
return ENR.createV4(getPublicKeyFromPeerId(peerId), kvs);
|
||||
return ENR.createFromPublicKey(getPublicKeyFromPeerId(peerId), kvs);
|
||||
default:
|
||||
throw new Error();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue