mirror of https://github.com/embarklabs/embark.git
fix duplicated event for all contracts
This commit is contained in:
parent
ccd7a7c3c7
commit
5eaaa63216
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue