Skip to content

Commit a301f19

Browse files
authored
Merge branch 'master' into gnosAA
2 parents b95e8a1 + 1f07a16 commit a301f19

File tree

118 files changed

+2877
-982
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+2877
-982
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ parameters:
55
type: boolean
66
default: false
77
orbs:
8-
browser-tools: circleci/browser-tools@1.4.4
8+
browser-tools: circleci/browser-tools@1.5.2
99
win: circleci/windows@5.0
1010
node: circleci/node@7.0.0
1111
jobs:
@@ -629,7 +629,7 @@ jobs:
629629

630630
remix-ide-browser:
631631
docker:
632-
- image: cimg/node:20.17.0-browsers
632+
- image: cimg/node:20.18.3-browsers
633633
resource_class:
634634
xlarge
635635
working_directory: ~/remix-project

apps/circuit-compiler/src/app/actions/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export const generateProof = async (plugin: CircomPluginClient, appState: AppSta
117117
const r1csBuffer = await plugin.call('fileManager', 'readFile', r1csPath, { encoding: null })
118118
// @ts-ignore
119119
const r1cs = new Uint8Array(r1csBuffer)
120-
const wtnsPath = isElectron() ? extractParentFromKey(appState.filePath) + "/.bin/" + fileName.replace('.circom', '_js') + "/" + fileName.replace('.circom', '.wtn') : r1csPath.replace('.r1cs', '.wtn')
120+
const wtnsPath = extractParentFromKey(appState.filePath) + "/.bin/" + fileName.replace('.circom', '_js') + "/" + fileName.replace('.circom', '.wtn')
121121
// @ts-ignore
122122
const wtnsBuffer = await plugin.call('fileManager', 'readFile', wtnsPath, { encoding: null })
123123
// @ts-ignore

apps/circuit-compiler/src/app/components/actions.tsx

Lines changed: 0 additions & 9 deletions
This file was deleted.

apps/circuit-compiler/src/app/components/compileBtn.tsx

Lines changed: 0 additions & 49 deletions
This file was deleted.

apps/circuit-compiler/src/app/components/container.tsx

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import { useContext } from 'react'
2-
import { CustomTooltip, RenderIf } from '@remix-ui/helper'
2+
import { CompileBtn, CustomTooltip, RenderIf } from '@remix-ui/helper'
33
import { FormattedMessage } from 'react-intl'
44
import { CircuitAppContext } from '../contexts'
5-
import { CompileOptions } from './options'
5+
import { CompileOptions, CompilerReport } from '@remix-ui/helper'
66
import { VersionList } from './versions'
77
import { Toggler } from './toggler'
88
import { Configurations } from './configurations'
9-
import { CircuitActions } from './actions'
109
import { WitnessSection } from './witness'
11-
import { CompilerFeedback } from './feedback'
12-
import { CompilerReport, PrimeValue } from '../types'
10+
import { CompilerFeedback } from '@remix-ui/helper'
11+
import { PrimeValue } from '../types'
1312
import { SetupExports } from './setupExports'
1413
import { GenerateProof } from './generateProof'
14+
import { compileCircuit } from '../actions'
1515

1616
export function Container () {
1717
const circuitApp = useContext(CircuitAppContext)
@@ -34,15 +34,19 @@ export function Container () {
3434
circuitApp.dispatch({ type: 'SET_COMPILER_VERSION', payload: version })
3535
}
3636

37-
const handleOpenErrorLocation = async (location: string, startRange: string) => {
38-
if (location) {
39-
const fullPathLocation = await circuitApp.plugin.resolveReportPath(location)
37+
const handleOpenErrorLocation = async (report: CompilerReport) => {
38+
if (report.labels.length > 0) {
39+
const location = circuitApp.appState.filePathToId[report.labels[0].file_id]
40+
const startRange = report.labels[0].range.start
41+
if (location) {
42+
const fullPathLocation = await circuitApp.plugin.resolveReportPath(location)
4043

41-
await circuitApp.plugin.call('fileManager', 'open', fullPathLocation)
42-
// @ts-ignore
43-
const startPosition: { lineNumber: number; column: number } = await circuitApp.plugin.call('editor', 'getPositionAt', startRange)
44-
// @ts-ignore
45-
await circuitApp.plugin.call('editor', 'gotoLine', startPosition.lineNumber - 1, startPosition.column)
44+
await circuitApp.plugin.call('fileManager', 'open', fullPathLocation)
45+
// @ts-ignore
46+
const startPosition: { lineNumber: number; column: number } = await circuitApp.plugin.call('editor', 'getPositionAt', startRange)
47+
// @ts-ignore
48+
await circuitApp.plugin.call('editor', 'gotoLine', startPosition.lineNumber - 1, startPosition.column)
49+
}
4650
}
4751
}
4852

@@ -102,6 +106,10 @@ export function Container () {
102106
}
103107
}
104108

109+
const handleCompileClick = () => {
110+
compileCircuit(circuitApp.plugin, circuitApp.appState)
111+
}
112+
105113
return (
106114
<section>
107115
<article>
@@ -123,7 +131,9 @@ export function Container () {
123131
<Toggler title='circuit.advancedConfigurations' dataId=''>
124132
<Configurations setPrimeValue={handlePrimeChange} primeValue={circuitApp.appState.primeValue} versionValue={circuitApp.appState.version} />
125133
</Toggler>
126-
<CircuitActions />
134+
<div className="pb-2">
135+
<CompileBtn id='circuit' plugin={circuitApp.plugin} appState={circuitApp.appState} compileAction={handleCompileClick} />
136+
</div>
127137
<RenderIf condition={circuitApp.appState.status !== 'compiling'}>
128138
<CompilerFeedback feedback={circuitApp.appState.compilerFeedback} filePathToId={circuitApp.appState.filePathToId} openErrorLocation={handleOpenErrorLocation} hideWarnings={circuitApp.appState.hideWarnings} askGPT={askGPT} />
129139
</RenderIf>

apps/circuit-compiler/src/app/components/options.tsx

Lines changed: 0 additions & 36 deletions
This file was deleted.

apps/circuit-compiler/src/app/services/circomPluginClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import * as compilerV218 from 'circom_wasm/v2.1.8'
77
import * as compilerV217 from 'circom_wasm/v2.1.7'
88
import * as compilerV216 from 'circom_wasm/v2.1.6'
99
import * as compilerV215 from 'circom_wasm/v2.1.5'
10-
import { extractNameFromKey, extractParentFromKey } from '@remix-ui/helper'
11-
import { CompilationConfig, CompilerReport, PrimeValue } from '../types'
10+
import { extractNameFromKey, extractParentFromKey, CompilerReport } from '@remix-ui/helper'
11+
import { CompilationConfig, PrimeValue } from '../types'
1212
import isElectron from 'is-electron'
1313

1414
export class CircomPluginClient extends PluginClient {

apps/circuit-compiler/src/app/types/index.ts

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { compiler_list } from 'circom_wasm'
22
import { Dispatch } from 'react'
33
import type { CircomPluginClient } from '../services/circomPluginClient'
4+
import { CompilerReport } from '@remix-ui/helper'
45

56
export type CompilerStatus = "compiling" | "computing" | "idle" | "errored" | "warning" | "exporting" | "proving"
67

@@ -87,34 +88,6 @@ export type CompilationConfig = {
8788

8889
export type PrimeValue = "bn128" | "bls12381" | "goldilocks" | "grumpkin" | "pallas" | "vesta"
8990

90-
export type CompilerFeedbackProps = {
91-
feedback: string | CompilerReport[],
92-
filePathToId: Record<string, string>,
93-
openErrorLocation: (location: string, startRange: string) => void,
94-
hideWarnings: boolean,
95-
askGPT: (report: CompilerReport) => void
96-
}
97-
98-
export type CompilerReport = {
99-
type: "Error" | "Bug" | "Help" | "Note" | "Warning" | "Unknown",
100-
message: string,
101-
labels: {
102-
style: "Primary" | "Secondary" | "Unknown",
103-
file_id: string,
104-
range: {
105-
start: string,
106-
end: string
107-
},
108-
message: string
109-
}[],
110-
notes: string[]
111-
}
112-
113-
export type FeedbackAlertProps = {
114-
message: string,
115-
askGPT: () => void
116-
}
117-
11891
export type ConfigurationsProps = {
11992
setPrimeValue: (prime: PrimeValue) => void,
12093
primeValue: PrimeValue,

apps/learneth/src/redux/models/remixide.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ const Model: ModelType = {
170170
(<any>window)._paq.push(['trackEvent', 'learneth', 'test_step', success])
171171
}
172172
} catch (err) {
173-
console.log('TESTING ERROR', err)
174173
yield put({
175174
type: 'remixide/save',
176175
payload: { errors: [String(err)]},
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export const DEFAULT_TOML_CONFIG = `[package]
2+
name = "test"
3+
authors = [""]
4+
compiler_version = ">=0.18.0"
5+
type = "bin"
6+
7+
[dependencies]
8+
`

0 commit comments

Comments
 (0)