fix duplicated event for all contracts

This commit is contained in:
Jonathan Rainville 2018-10-23 11:08:39 -04:00
parent ccd7a7c3c7
commit 5eaaa63216
1 changed files with 2 additions and 2 deletions

View File

@ -64,7 +64,7 @@ class ContractsManager {
self.events.emit('contractsState', self.contractsState());
});
self.events.setCommandHandler("contracts:all", (contractName, cb) => {
self.events.setCommandHandler("contracts:formatted:all", (cb) => {
const contracts = self.listContracts().map((contract, index) => (
{
className: contract.className,
@ -162,7 +162,7 @@ class ContractsManager {
'/embark-api/contracts',
(req, res) => {
const result = [];
self.events.request('contracts:all', null, (contracts) => {
self.events.request('contracts:formatted:all', (contracts) => {
contracts.forEach((contract) => {
self.events.request('contracts:contract', contract.className, (c) => (
result.push(Object.assign(contract, c))