This repository was archived by the owner on Feb 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +19
-14
lines changed Expand file tree Collapse file tree 1 file changed +19
-14
lines changed Original file line number Diff line number Diff line change @@ -263,21 +263,26 @@ class Console extends EventEmitter {
263
263
"utf8"
264
264
) ;
265
265
const json = JSON . parse ( body ) ;
266
- const metadata = JSON . parse ( json . metadata ) ;
267
- const sources = Object . keys ( metadata . sources ) ;
268
- // filter out Truffle's console.log. We don't want users to interact with in the REPL.
269
- // user contracts named console.log will be imported, and a warning will be issued.
270
- if (
271
- sources . length > 1 ||
272
- ( sources . length === 1 &&
273
- ! sources . some ( source => {
274
- return (
275
- source === "truffle/console.sol" ||
276
- source === "truffle/Console.sol"
277
- ) ;
278
- } ) )
279
- ) {
266
+ // Vyper contracts may not have metadata field included, just push them to json blobs
267
+ if ( json . metadata === undefined ) {
280
268
jsonBlobs . push ( json ) ;
269
+ } else {
270
+ const metadata = JSON . parse ( json . metadata ) ;
271
+ const sources = Object . keys ( metadata . sources ) ;
272
+ // filter out Truffle's console.log. We don't want users to interact with in the REPL.
273
+ // user contracts named console.log will be imported, and a warning will be issued.
274
+ if (
275
+ sources . length > 1 ||
276
+ ( sources . length === 1 &&
277
+ ! sources . some ( source => {
278
+ return (
279
+ source === "truffle/console.sol" ||
280
+ source === "truffle/Console.sol"
281
+ ) ;
282
+ } ) )
283
+ ) {
284
+ jsonBlobs . push ( json ) ;
285
+ }
281
286
}
282
287
} catch ( error ) {
283
288
throw new Error ( `Error parsing or reading ${ file } : ${ error . message } ` ) ;
You can’t perform that action at this time.
0 commit comments