fix linting for circuit-compiler

pull/4771/head
lianahus 7 months ago
parent 47624a555e
commit e5be10a5d3
  1. 4
      apps/circuit-compiler/src/app/contexts/index.ts
  2. 2
      apps/circuit-compiler/src/app/reducers/state.ts
  3. 10
      apps/circuit-compiler/src/app/services/circomPluginClient.ts
  4. 2
      apps/circuit-compiler/src/app/types/index.ts

@ -1,4 +1,4 @@
import {createContext} from 'react'
import {ICircuitAppContext} from '../types'
import { createContext } from 'react'
import { ICircuitAppContext } from '../types'
export const CircuitAppContext = createContext<ICircuitAppContext>({} as ICircuitAppContext)

@ -1,4 +1,4 @@
import {Actions, AppState} from '../types'
import { Actions, AppState } from '../types'
import { compiler_list } from 'circom_wasm'
export const appInitialState: AppState = {

@ -163,7 +163,7 @@ export class CircomPluginClient extends PluginClient {
} else {
this.lastCompiledFile = path
const fileName = extractNameFromKey(path)
this.lastCompiledCircuitPath = extractParentFromKey(path) + "/.bin/" + fileName.replace('circom', 'wasm')
// @ts-ignore
await this.call('fileManager', 'writeFile', this.lastCompiledCircuitPath, circuitProgram, { encoding: null })
@ -179,7 +179,7 @@ export class CircomPluginClient extends PluginClient {
this.internalEvents.emit('circuit_compiling_done', [])
}
circuitApi.log().map(log => {
log && this.call('terminal', 'log', { type: 'log', value: log })
log && this.call('terminal', 'log', { type: 'log', value: log })
})
// @ts-ignore
this.call('terminal', 'log', { type: 'typewritersuccess', value: 'Everything went okay' })
@ -222,11 +222,11 @@ export class CircomPluginClient extends PluginClient {
this.internalEvents.emit('circuit_generating_r1cs_done')
const fileName = extractNameFromKey(path)
const writePath = extractParentFromKey(path) + "/.bin/" + fileName.replace('circom', 'r1cs')
// @ts-ignore
await this.call('fileManager', 'writeFile', writePath, r1csProgram, true)
r1csApi.log().map(log => {
log && this.call('terminal', 'log', { type: 'log', value: log })
log && this.call('terminal', 'log', { type: 'log', value: log })
})
// @ts-ignore
this.call('terminal', 'log', { type: 'typewritersuccess', value: 'Everything went okay' })
@ -339,7 +339,7 @@ export class CircomPluginClient extends PluginClient {
absFilePath = include.startsWith('circomlib') ? absFilePath.substring(1) : absFilePath
if (!blackPath.includes(absFilePath)) {
if(!includeName.startsWith('circomlib')) {
if (!includeName.startsWith('circomlib')) {
dependencyContent = dependencyContent.replace(`${includeName}`, `${absFilePath}`)
return absFilePath
}

@ -1,5 +1,5 @@
import { compiler_list } from 'circom_wasm'
import {Dispatch} from 'react'
import { Dispatch } from 'react'
import type { CircomPluginClient } from '../services/circomPluginClient'
export type CompilerStatus = "compiling" | "generating" | "computing" | "idle" | "errored" | "warning"

Loading…
Cancel
Save