Skip to content

Commit

Permalink
msgIdToStrFn: support Uint8Array (#5240)
Browse files Browse the repository at this point in the history
  • Loading branch information
twoeths authored Mar 7, 2023
1 parent 0006d86 commit a88c5b2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/beacon-node/src/network/gossip/encoding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {compress, uncompress} from "snappyjs";
import xxhashFactory from "xxhash-wasm";
import {Message} from "@libp2p/interface-pubsub";
import {digest} from "@chainsafe/as-sha256";
import {intToBytes} from "@lodestar/utils";
import {intToBytes, toHex} from "@lodestar/utils";
import {ForkName} from "@lodestar/params";
import {RPC} from "@chainsafe/libp2p-gossipsub/message";
import {MESSAGE_DOMAIN_VALID_SNAPPY} from "./constants.js";
Expand All @@ -27,8 +27,7 @@ export function fastMsgIdFn(rpcMsg: RPC.IMessage): string {
}

export function msgIdToStrFn(msgId: Uint8Array): string {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
return Buffer.prototype.toString.call(msgId, "base64");
return toHex(msgId);
}

/**
Expand Down

0 comments on commit a88c5b2

Please sign in to comment.