Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it(JSON.stringify(t), function () {
var localHash = makeReports.makeHash(t.salt, t.report, t.event, t.from, t.isScalar, t.isIndeterminate);
if (t.expected) {
assert.strictEqual(localHash, t.expected);
} else {
assert.strictEqual(localHash, augur.MakeReports.makeHash(abi.hex(t.salt), abi.hex(t.report), t.event, t.from));
}
});
};
it(JSON.stringify(t), function () {
var localHash = makeReports.makeHash(t.salt, t.report, t.event, t.from, t.isScalar, t.isIndeterminate);
assert.strictEqual(localHash, augur.MakeReports.makeHash(abi.hex(t.salt), abi.hex(t.report), t.event, t.from));
});
};
sumTrades: function (trade_ids) {
var i, numTrades, trades = new BigNumber(0);
for (i = 0, numTrades = trade_ids.length; i < numTrades; ++i) {
trades = abi.wrap(trades.plus(abi.bignum(trade_ids[i], null, true)));
}
return abi.hex(trades, true);
},
function sumTrades(trade_ids) {
var i, numTrades, trades = new BigNumber(0);
for (i = 0, numTrades = trade_ids.length; i < numTrades; ++i) {
trades = abi.wrap(trades.plus(abi.bignum(trade_ids[i], null, true)));
}
return abi.hex(trades, true);
}