-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Fix: truffle console
crash when metadata is missing in JSON artifact
#5819
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, @dPreininger. There are two small comment nits I'd like updated.
Co-authored-by: cds-amal <[email protected]>
Co-authored-by: cds-amal <[email protected]>
I have committed the suggestions. |
truffle console
crashed if JSON blob file didn't contain metadatatruffle console
crash when metadata is missing in JSON artifact
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for finding and fixing this bug, @dPreininger !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems like it does the job - I wonder what limitations we have in using these artifacts when they don't contain metadata
, I'm not sure where we use this field in Truffle
@eggplantzzz I have actually looked through the code and found only 2 instances of metadata being used (besides this console.js file): and 2 more test files: I might have missed some more usages, but it seems to me that it was only really used to filter out Console contract. |
PR description
As per the issue #5812 ,
truffle console
command would throw an error and exit, if the metadata field was not present in all JSON blob files generated in the build process. The metadata field is not present in JSON files derived from Vyper source files.Testing instructions
truffle migrate
. IMPORTANT: do not run truffle develop, as some configurations (truffle-config.js) were not affected by this bug (see issue for more details).truffle console
. The command executes without errors.Documentation, breaking changes and new features
This PR does not introduce any breaking changes or new features. The documentation does not need to be changed either.