Skip to content

Commit

Permalink
tests updated
Browse files Browse the repository at this point in the history
  • Loading branch information
quasisamurai committed Oct 31, 2018
1 parent c932e93 commit b83db58
Show file tree
Hide file tree
Showing 3 changed files with 182 additions and 172 deletions.
5 changes: 5 additions & 0 deletions blockchain/source/test/blacklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ contract('Blacklist', async function (accounts) {
let token;
let oracle;
let pr;
let administratum;
let orders;
let deals;
let changeRequests;

const owner = accounts[0];
const creeper = accounts[1];
Expand All @@ -30,6 +34,7 @@ contract('Blacklist', async function (accounts) {
oracle = await OracleUSD.new();
pr = await ProfileRegistry.new();
await blacklist.AddMaster(master, { from: owner });
administratum = await Administratum.new();
orders = await Orders.new();
deals = await Deals.new();
changeRequests = await ChangeRequests.new();
Expand Down
14 changes: 7 additions & 7 deletions blockchain/source/test/helpers/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ export async function checkBenchmarks (info, benchmarks) {
assert.equal(JSON.stringify(benchmarks), JSON.stringify(b), 'Incorrect benchmarks');
}

export async function checkOrderStatus (market, key, orderId, status) {
let res = await market.GetOrderParams(orderId, { from: key });
export async function checkOrderStatus (orders, key, orderId, status) {
let res = await orders.GetOrderParams(orderId, { from: key });
assert.equal(status, res[0], 'Incorrect order status');
}

export async function getDealIdFromOrder (market, key, orderId) {
let orderParams = await market.GetOrderParams(orderId, { from: key });
export async function getDealIdFromOrder (orders, key, orderId) {
let orderParams = await orders.GetOrderParams(orderId, { from: key });
return orderParams[1].toNumber(10);
}

export async function getDealInfoFromOrder (market, key, orderId) {
let dealId = await getDealIdFromOrder(market, key, orderId);
return market.GetDealInfo(dealId, { from: key });
export async function getDealInfoFromOrder (deals, orders, key, orderId) {
let dealId = await getDealIdFromOrder(orders, key, orderId);
return deals.GetDealInfo(dealId, { from: key });
}
Loading

0 comments on commit b83db58

Please sign in to comment.