fix(@embark/debugger): Re-enable debugger

Re-enable debugger for cockpit and console.

Add missing request `blockchain:getTransaction` required to start a debugging session.

Fix error in console when stopping a debug session.
This commit is contained in:
emizzle 2019-12-04 16:26:32 +11:00 committed by Iuri Matias
parent bd4b110a78
commit 8e0f8b44d1
4 changed files with 10 additions and 2 deletions

View File

@ -162,6 +162,7 @@ class EmbarkController {
engine.registerModuleGroup("storage");
engine.registerModuleGroup("cockpit");
engine.registerModulePackage('embark-deploy-tracker', { plugins: engine.plugins });
engine.registerModulePackage("embark-debugger");
// load custom plugins
engine.loadDappPlugins();
@ -391,6 +392,7 @@ class EmbarkController {
engine.registerModuleGroup("cockpit");
}
engine.registerModulePackage('embark-deploy-tracker', { plugins: engine.plugins });
engine.registerModulePackage("embark-debugger");
callback();
},

View File

@ -275,9 +275,9 @@ class TransactionDebugger {
this.embark.logger.warn(NO_DEBUG_SESSION);
return callback();
}
this.cmdDebugger = null;
this.embark.logger.info(__('The debug session has been stopped'));
this.cmdDebugger.unload();
this.cmdDebugger = null;
callback(undefined, __('The debug session has been stopped'));
},
usage: ' stop debugger/sd',
});

View File

@ -44,6 +44,7 @@ export default class EthereumAPI {
this.embark.events.request("blockchain:request:register", this.blockchainName, "getBlock", this.getBlock.bind(this));
this.embark.events.request("blockchain:request:register", this.blockchainName, "getGasPrice", this.getGasPrice.bind(this));
this.embark.events.request("blockchain:request:register", this.blockchainName, "getNetworkId", this.getNetworkId.bind(this));
this.embark.events.request("blockchain:request:register", this.blockchainName, "getTransaction", this.getTransactionByHash.bind(this));
this.embark.events.request("blockchain:request:register", this.blockchainName, "contractObject", this.contractObject.bind(this));
}

View File

@ -114,6 +114,11 @@ export default class BlockchainAPI {
cb(getNetworkId);
});
this.events.setCommandHandler("blockchain:getTransaction", async (txId, cb) => {
const getTransaction = this.getRequestForBlockchain(blockchainName, "getTransaction");
getTransaction(txId, cb);
});
this.events.setCommandHandler("blockchain:contract:create", (params, cb) => {
const contractObject = this.getRequestForBlockchain(blockchainName, "contractObject")(params);
cb(contractObject);