Skip to content

Commit

Permalink
chore: improve var name
Browse files Browse the repository at this point in the history
  • Loading branch information
fryorcraken committed May 6, 2023
1 parent 7198503 commit c781e49
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/message-hash/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,17 @@ export function messageHash(
const pubsubTopicBytes = utf8ToBytes(pubsubTopic);
const contentTopicBytes = utf8ToBytes(message.contentTopic);

let bytesToHash;
let bytes;

if (message.meta) {
bytesToHash = concat([
bytes = concat([
pubsubTopicBytes,
message.payload,
contentTopicBytes,
message.meta,
]);
} else {
bytesToHash = concat([
pubsubTopicBytes,
message.payload,
contentTopicBytes,
]);
bytes = concat([pubsubTopicBytes, message.payload, contentTopicBytes]);
}
return sha256(bytesToHash);
return sha256(bytes);
}

0 comments on commit c781e49

Please sign in to comment.