Skip to content

Commit

Permalink
Bug: In order to resolve #73; I push each activity sent to DCR graphs…
Browse files Browse the repository at this point in the history
… along with verdict into a list in the monitor
  • Loading branch information
mojtaba-eshghie committed Mar 9, 2024
1 parent ae62eb0 commit 0ee1e74
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Empty file.
10 changes: 6 additions & 4 deletions monitor/monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Monitor extends EventEmitter {
constructor(configs) {

super();
this.receivedActivities = [];
this.configs = configs;

// Initialize the contract watcher, translator, and executor for this instance
Expand Down Expand Up @@ -48,7 +49,8 @@ class Monitor extends EventEmitter {
this.contractWatcher.on('error', this.handleError.bind(this));
// Start watching for contract events
this.contractWatcher.startWatching();
// ... other setup as needed ...

// TODO: other setup steps
}

handleContractEvent(tx) {
Expand All @@ -73,8 +75,9 @@ class Monitor extends EventEmitter {
dcrActivity.dcrType
)
.then(result => {
// Handle successful execution
console.log('DCR Activity executed:', result);
// Handle the execution result (+verdict)
console.log('DCR Activity sent for execution:', result);
this.receivedActivities.push(result);
})
.catch(error => {
// Handle errors
Expand All @@ -87,7 +90,6 @@ class Monitor extends EventEmitter {
console.error('Error in ContractWatcher:', error);
}


}

module.exports = Monitor;

0 comments on commit 0ee1e74

Please sign in to comment.