Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Addressed lingering review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jalextowle committed Feb 5, 2020
1 parent 1b64f79 commit 3331a95
Showing 1 changed file with 11 additions and 24 deletions.
35 changes: 11 additions & 24 deletions browser/conversion-tests/conversion_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,30 +80,17 @@ window.addEventListener(loadEventName, () => {
// Start compiling the WebAssembly as soon as the script is loaded. This lets
// us initialize as quickly as possible.
const go = new Go();
fetch('conversion_test.wasm')
.then(wasm => {
WebAssembly.instantiateStreaming(wasm, go.importObject)
.then(module => {
go.run(module.instance);
})
.catch(err => {
// tslint:disable-next-line no-console
console.error('Could not load Wasm');
// tslint:disable-next-line no-console
console.error(err);
// If the Wasm bytecode didn't compile, Mesh won't work. We have no
// choice but to throw an error.
setImmediate(() => {
throw err;
});
});

WebAssembly.instantiateStreaming(fetch('conversion_test.wasm'), go.importObject)
.then(module => {
go.run(module.instance);
})
.catch(err => {
// tslint:disable-next-line no-console
console.error('Could not fetch Wasm');
console.error('Could not load Wasm');
// tslint:disable-next-line no-console
console.error(err);
// If the Wasm bytecode wasn't fetched, Mesh won't work. We have no
// If the Wasm bytecode didn't compile, Mesh won't work. We have no
// choice but to throw an error.
setImmediate(() => {
throw err;
Expand Down Expand Up @@ -141,15 +128,15 @@ fetch('conversion_test.wasm')
await waitForLoadAsync();
const contractEvents = conversionTestCases.contractEvents();
testContractEvents(contractEvents);
const getOrdersResponse = await conversionTestCases.getOrdersResponse();
const getOrdersResponse = conversionTestCases.getOrdersResponse();
testGetOrdersResponse(getOrdersResponse);
const orderEvents = await conversionTestCases.orderEvents();
const orderEvents = conversionTestCases.orderEvents();
testOrderEvents(orderEvents);
const signedOrders = await conversionTestCases.signedOrders();
const signedOrders = conversionTestCases.signedOrders();
testSignedOrders(signedOrders);
const stats = await conversionTestCases.stats();
const stats = conversionTestCases.stats();
testStats(stats);
const validationResults = await conversionTestCases.validationResults();
const validationResults = conversionTestCases.validationResults();
testValidationResults(validationResults);

// This special #jsFinished div is used to signal the headless Chrome driver
Expand Down

0 comments on commit 3331a95

Please sign in to comment.