Skip to content

Commit

Permalink
skip constructor when parsing functions
Browse files Browse the repository at this point in the history
  • Loading branch information
unstoppablecarl committed Sep 16, 2020
1 parent b35a287 commit 5148a11
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Ethereum/ABI/Contract.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ public function __construct(
$this->json = $json;

foreach ($json as $item) {
$name = $item['name'];
$type = $item['type'] ?? 'function';
if ($type == 'constructor') {
continue;
}
$name = $item['name'];
if ($type === 'function') {
$this->functionsMeta[$name] = $item;
} elseif ($type === 'event') {
Expand Down Expand Up @@ -98,7 +101,7 @@ public function functions(): array
}, $names);
}

public function function(string $name): ContractFunction
public function function (string $name): ContractFunction
{
$this->validateFunctionName($name);

Expand Down

0 comments on commit 5148a11

Please sign in to comment.