@@ -20,6 +20,7 @@ var globalRegistry = require('./global/registry')
2020var modalDialog = require ( './app/ui/modaldialog' )
2121var typeConversion = remixLib . execution . typeConversion
2222var confirmDialog = require ( './app/execution/confirmDialog' )
23+ const debLog = require ( './lib/debuglogger' )
2324
2425function UniversalDApp ( opts , localRegistry ) {
2526 this . event = new EventManager ( )
@@ -168,7 +169,6 @@ UniversalDApp.prototype.getBalance = function (address, cb) {
168169 return cb ( 'No accounts?' )
169170 }
170171 if ( executionContext . chainsql ( ) . api . isConnected ( ) ) {
171- console . log ( address )
172172 executionContext . chainsql ( ) . api . getBalances ( address ) . then ( balanceObj => {
173173 for ( let item of balanceObj ) {
174174 if ( item . currency === "ZXC" ) {
@@ -241,8 +241,8 @@ UniversalDApp.prototype.call = function (isUserAction, args, value, lookupOnly,
241241 }
242242 }
243243 // contractsDetails is used to resolve libraries
244-
245- console . log ( value )
244+ debLog ( 'function call args:' , args )
245+ debLog ( 'function call params:' , value )
246246 txFormat . buildData ( args . contractName , args . contractAbi , self . data . contractsDetails , false , args . funABI , value , ( error , data ) => {
247247 if ( ! error ) {
248248 if ( isUserAction ) {
@@ -253,8 +253,7 @@ UniversalDApp.prototype.call = function (isUserAction, args, value, lookupOnly,
253253 }
254254 }
255255 self . callFunction ( args . address , data , args . funABI , ( error , txResult ) => {
256- console . log ( error )
257- console . log ( txResult )
256+ debLog ( 'function call ret:' , txResult )
258257 if ( ! error ) {
259258 var isVM = executionContext . isVM ( )
260259 if ( isVM ) {
@@ -313,9 +312,6 @@ UniversalDApp.prototype.createContract = function (data, callback) {
313312 * @param {Function } callback - callback.
314313 */
315314UniversalDApp . prototype . callFunction = function ( to , data , funAbi , callback ) {
316- // console.log(funAbi)
317- // console.log(data)
318- // let funAbiName = funAbi.name + "(" + data.params + ")";
319315 data . funAbi = funAbi
320316 this . runTx ( { to : to , data : data , useCall : funAbi . constant , isDeploy : false } , ( error , txResult ) => {
321317 // see universaldapp.js line 660 => 700 to check possible values of txResult (error case)
@@ -376,7 +372,6 @@ UniversalDApp.prototype.runTx = function (args, cb) {
376372 return next ( null , 0 , gasLimit )
377373 }
378374 self . transactionContextAPI . getValue ( function ( err , value ) {
379- console . log ( err )
380375 next ( err , value , gasLimit )
381376 } )
382377 } ,
@@ -399,8 +394,7 @@ UniversalDApp.prototype.runTx = function (args, cb) {
399394 if ( executionContext . isVM ( ) && ! self . accounts [ address ] ) {
400395 return next ( 'Invalid account selected' )
401396 }
402- console . log ( address )
403- console . log ( self . chainsqlAccounts )
397+ debLog ( 'all Accounts:' , self . chainsqlAccounts )
404398 executionContext . chainsql ( ) . as ( self . chainsqlAccounts [ address ] )
405399 next ( null , address , value , gasLimit )
406400 } )
@@ -495,7 +489,7 @@ UniversalDApp.prototype.runTx = function (args, cb) {
495489 } ,
496490 function ( error , result ) {
497491 let eventName = ( tx . useCall ? 'callExecuted' : 'transactionExecuted' )
498- console . log ( '[In runTransaction], origin tx:' , tx )
492+ debLog ( '[In runTransaction], origin tx:' , tx )
499493 self . event . trigger ( eventName , [ error , tx . from , tx . to , tx . data , tx . useCall , result , timestamp , payLoad ] )
500494
501495 if ( error && ( typeof ( error ) !== 'string' ) ) {
0 commit comments