Skip to content

Commit

Permalink
Fix duplicate name tags in events (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
zemse committed Mar 6, 2021
1 parent bbddf78 commit 38b9be7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ export function setInNameTags(
(hre.tracer.nameTags[ethers.utils.getAddress(address)] = value);

function replaceIfExists(key: string, value: string) {
if (hre.tracer.nameTags[key]) {
if (
hre.tracer.nameTags[key] &&
!hre.tracer.nameTags[key].split(" / ").includes(value)
) {
hre.tracer.nameTags[key] = `${value} / ${hre.tracer.nameTags[key]}`;
return true;
} else {
Expand Down

0 comments on commit 38b9be7

Please sign in to comment.