Skip to content

Commit

Permalink
fix some tests to ensure non-repeating events
Browse files Browse the repository at this point in the history
  • Loading branch information
eburgos committed Jun 28, 2018
1 parent f22dcbc commit f88bc73
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/multipleArbitrableTransaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -808,8 +808,13 @@ contract("MultipleArbitrableTransaction", function(accounts) {
const contractHashEvent = multipleContract.ContractHash();

let currentResolve;
let lastTransactionEvent = -1;
const handler = contractHashEvent.watch((error, result) => {
currentResolve(result);
const eventTransaction = result.args._transactionId.toNumber();
if (eventTransaction > lastTransactionEvent) {
lastTransactionEvent = eventTransaction;
currentResolve(result);
}
});

const transaction1Promise = new Promise(resolve => {
Expand Down Expand Up @@ -905,8 +910,13 @@ contract("MultipleArbitrableTransaction", function(accounts) {
const contractHashEvent = multipleContract.ContractHash();

let currentResolve;
let lastTransactionEvent = -1;
const handler = contractHashEvent.watch((error, result) => {
currentResolve(result);
const eventTransaction = result.args._transactionId.toNumber();
if (eventTransaction > lastTransactionEvent) {
lastTransactionEvent = eventTransaction;
currentResolve(result);
}
});

const transaction1Promise = new Promise(resolve => {
Expand Down

0 comments on commit f88bc73

Please sign in to comment.