Skip to content

Commit

Permalink
Return accumulator from reduce function fix (#179)
Browse files Browse the repository at this point in the history
We haven't returned the accumulator from `contracts.reduce` function resulting in an `undefined` new array.
This PR fixes that error.
  • Loading branch information
dule-git committed Feb 6, 2024
1 parent f181842 commit 676045c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/silly-shirts-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tenderly/hardhat-tenderly": patch
---

Fix empty array to verify
5 changes: 3 additions & 2 deletions packages/tenderly-hardhat/src/Tenderly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ export class Tenderly {

const flatContracts: ContractByName[] = contracts.reduce(
(accumulator, value) => {
if (value.address !== ProxyPlaceholderName) {
accumulator.concat(value);
if (value.name !== ProxyPlaceholderName) {
accumulator = accumulator.concat(value);
}
return accumulator;
},
[],
);
Expand Down

0 comments on commit 676045c

Please sign in to comment.