ApeWorX / ethpm-types

Implementation of EIP-2678
Apache License 2.0
14 stars 8 forks source link

fix: allow empty-string content #49

Closed ghost closed 2 years ago

ghost commented 2 years ago

What I did

Allow Source.content to be "", and only disallow None

fixes: #48

How I did it

Change content checks to check for None. If we happen to read in a source file that's empty, it's still a valid file but won't have content. Previously the conditional would cause it to fail and, since the source did not also have urls, would result in a ValueError

How to verify it

A test project with at least one empty source should be testable, and not throw the ValueError about missing content

Checklist