Add the revive tests in the browsers (#158)

This commit is contained in:
Sebastian Miasojed
2025-01-14 22:29:02 +01:00
committed by GitHub
parent 7f81f37e0c
commit 939138d0cd
7 changed files with 174 additions and 55 deletions
+1 -21
View File
@@ -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']);