Skip to content

Commit

Permalink
Fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
smiasojed committed Nov 21, 2024
1 parent 262a118 commit e7ad234
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
44 changes: 22 additions & 22 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import solc from 'solc'
import path from 'path'
import createRevive from "./resolc.js"
import createRevive from './resolc.js'
import { existsSync, readFileSync } from 'fs'

type SolcInput = {
Expand Down Expand Up @@ -90,34 +90,34 @@ export async function compile(sources: SolcInput): Promise<SolcOutput> {
sources = resolveInputs(sources)

const input = JSON.stringify({
language: 'Solidity',
sources,
settings: {
optimizer: { enabled: false, runs: 200 },
outputSelection: {
'*': {
'*': ['abi'],
},
language: 'Solidity',
sources,
settings: {
optimizer: { enabled: false, runs: 200 },
outputSelection: {
'*': {
'*': ['abi'],
},
},
});
},
})

const revive = await createRevive();
revive.solc = solc;
revive.setStdinData(input);
const revive = await createRevive()
revive.solc = solc
revive.setStdinData(input)

let stdout = "";
revive.setStdoutCallback(function(char: string) {
stdout += char;
});
let stdout = ''
revive.setStdoutCallback(function (char: string) {
stdout += char
})

let stderr = "";
revive.setStderrCallback(function(char: string) {
stderr += char;
});
let stderr = ''
revive.setStderrCallback(function (char: string) {
stderr += char
})

// Compile the Solidity source code
const result = revive.callMain(['--standard-json']);
const result = revive.callMain(['--standard-json'])

if (result) {
throw new Error(stderr)
Expand Down
4 changes: 2 additions & 2 deletions src/resolc.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export = createRevive;
declare function createRevive(...args): Promise;
export = createRevive
declare function createRevive(...args): Promise

0 comments on commit e7ad234

Please sign in to comment.