@@ -152,7 +152,7 @@ const Transaction = module.exports = class Transaction {
152
152
}
153
153
}
154
154
get abi ( ) {
155
- return this . _abi || { } ;
155
+ return this . _abi || [ ] ;
156
156
}
157
157
get abiString ( ) {
158
158
if ( this . type === 2 ) {
@@ -342,8 +342,10 @@ const Transaction = module.exports = class Transaction {
342
342
path : '/' + network . config . apiVersion + network . config . routes . transactionStatus + this . id
343
343
}
344
344
) . then ( ( d ) => {
345
- if ( d . status === 'Ok' ) {
346
- this . address = d . data . contractAddress ;
345
+ if ( d . data && d . data . status ) {
346
+ if ( d . data . contractAddress ) {
347
+ this . address = d . data . contractAddress ;
348
+ }
347
349
resolve ( d . data ) ;
348
350
} else {
349
351
reject ( d ) ;
@@ -485,13 +487,15 @@ const Transaction = module.exports = class Transaction {
485
487
errors : [ ] ,
486
488
warnings : [ ]
487
489
} ;
488
- Object . keys ( compiled . contracts . source ) . forEach ( ( k ) => {
489
- ret . contracts . push ( {
490
- contract : k ,
491
- bytecode : compiled . contracts . source [ k ] . evm . bytecode . object ,
492
- abi : compiled . contracts . source [ k ] . abi
490
+ if ( compiled . contracts . source ) {
491
+ Object . keys ( compiled . contracts . source ) . forEach ( ( k ) => {
492
+ ret . contracts . push ( {
493
+ contract : k ,
494
+ bytecode : compiled . contracts . source [ k ] . evm . bytecode . object ,
495
+ abi : compiled . contracts . source [ k ] . abi
496
+ } ) ;
493
497
} ) ;
494
- } ) ;
498
+ }
495
499
( compiled . errors || [ ] ) . forEach ( ( e ) => {
496
500
if ( e . severity === 'warning' ) {
497
501
ret . warnings . push ( e ) ;
@@ -531,7 +535,7 @@ const Transaction = module.exports = class Transaction {
531
535
'*' : [ 'abi' , 'evm.bytecode.object' ]
532
536
}
533
537
}
534
- } , input . settings ) ;
538
+ } , input . settings || { } ) ;
535
539
const ret = solc . compileStandardWrapper ( JSON . stringify ( input ) , find ) ;
536
540
return JSON . parse ( ret ) ;
537
541
}
0 commit comments