mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-25 08:17:58 +00:00
Add the revive tests in the browsers (#158)
This commit is contained in:
committed by
GitHub
parent
7f81f37e0c
commit
939138d0cd
@@ -4,32 +4,12 @@ importScripts('./resolc.js');
|
||||
|
||||
// Handle messages from the main thread
|
||||
onmessage = async function (e) {
|
||||
const contractCode = e.data.contractCode
|
||||
const sourceCode = {
|
||||
language: 'Solidity',
|
||||
sources: {
|
||||
contract: {
|
||||
content: contractCode,
|
||||
}
|
||||
},
|
||||
settings: {
|
||||
optimizer: {
|
||||
enabled: true,
|
||||
runs: 200,
|
||||
},
|
||||
outputSelection: {
|
||||
'*': {
|
||||
'*': ['abi'],
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
const m = createRevive();
|
||||
|
||||
m.soljson = Module;
|
||||
|
||||
// Set input data for stdin
|
||||
m.writeToStdin(JSON.stringify(sourceCode));
|
||||
m.writeToStdin(e.data);
|
||||
|
||||
// Compile the Solidity source code
|
||||
m.callMain(['--standard-json']);
|
||||
|
||||
Reference in New Issue
Block a user