git4refactor
filip mertens 7 months ago
commit 6cddc4a210
  1. 3
      apps/circuit-compiler/.eslintrc
  2. 3
      apps/debugger/.eslintrc
  3. 3
      apps/doc-gen/.eslintrc
  4. 1
      apps/doc-gen/src/app/docgen/templates.ts
  5. 3
      apps/doc-viewer/.eslintrc
  6. 3
      apps/etherscan/.eslintrc
  7. 3
      apps/learneth/.eslintrc
  8. 3
      apps/remix-ide/src/app/editor/editor.js
  9. 3
      apps/remix-ide/src/app/files/dgitProvider.ts
  10. 3
      apps/remix-ide/src/remixAppManager.js
  11. 18
      apps/solhint/.eslintrc
  12. 1
      apps/solhint/src/app/SolhintPluginClient.ts
  13. 5
      apps/solhint/src/index.d.ts
  14. 3
      apps/solidity-compiler/.eslintrc
  15. 2
      apps/vyper/src/app/utils/types.ts
  16. 3
      apps/walletconnect/.eslintrc
  17. 1
      libs/remix-analyzer/test/analysis/staticAnalysisCommon-test.ts
  18. 3
      libs/remix-analyzer/test/analysis/staticAnalysisIntegration-test-0.5.0.ts
  19. 1
      libs/remix-astwalker/tests/resources/newAST.ts
  20. 1
      libs/remix-core-plugin/src/lib/constants/uups.ts
  21. 1
      libs/remix-debug/test/decoder/localsTests/calldata.ts
  22. 1
      libs/remix-debug/test/resources/ast.ts
  23. 2
      libs/remix-debug/test/sourceLocationTracker.ts
  24. 1
      libs/remix-debug/test/vmCall.ts
  25. 1
      libs/remix-simulator/src/vm-context.ts
  26. 3
      libs/remix-tests/tests/testRunner.cli.spec.ts
  27. 4
      libs/remix-tests/tests/testRunner.spec.ts
  28. 7
      libs/remix-ui/editor/src/lib/remix-ui-editor.tsx
  29. 62
      libs/remix-ui/editor/src/lib/syntaxes/toml.ts
  30. 9
      libs/remix-ui/run-tab/src/lib/run-tab.tsx
  31. 1
      libs/remix-url-resolver/src/resolve.ts
  32. 1
      libs/remix-ws-templates/src/templates/hashchecker/scripts/groth16/groth16_zkproof.ts
  33. 3
      libs/remix-ws-templates/src/templates/semaphore/scripts/run_verification.ts
  34. 1
      libs/remixd/src/services/foundryClient.ts
  35. 1
      libs/remixd/src/services/hardhatClient.ts
  36. 1
      libs/remixd/src/services/truffleClient.ts

@ -0,0 +1,3 @@
{
"extends": "../../.eslintrc.json",
}

@ -0,0 +1,3 @@
{
"extends": "../../.eslintrc.json",
}

@ -0,0 +1,3 @@
{
"extends": "../../.eslintrc.json",
}

@ -45,7 +45,6 @@ export async function loadTemplates(defaultTheme: string, root: string, userTemp
properties: { ...defaultProperties },
};
// Add partials and helpers from all themes, prefixed with the theme name.
for (const [themeName, theme] of Object.entries(themes)) {
const addPrefix = (k: string) => `${themeName}/${k}`;

@ -0,0 +1,3 @@
{
"extends": "../../.eslintrc.json",
}

@ -0,0 +1,3 @@
{
"extends": "../../.eslintrc.json",
}

@ -0,0 +1,3 @@
{
"extends": "../../.eslintrc.json",
}

@ -54,7 +54,8 @@ class Editor extends Plugin {
ts: 'typescript',
move: 'move',
circom: 'circom',
nr: 'rust'
nr: 'rust',
toml: 'toml'
}
this.activated = false

@ -708,8 +708,7 @@ class DGitProvider extends Plugin {
this.call('terminal', 'log', {
type: 'error',
value: `Could not checkout submodule to ${result[0]}`
})
} else {
})} else {
this.call('terminal', 'logHtml',`Checked out submodule ${dir} to ${result[0]}`)
}
}

@ -76,7 +76,8 @@ let requiredModules = [ // services + layout views + system views
'home',
'doc-viewer',
'doc-gen',
'remix-templates'
'remix-templates',
'solhint'
]

@ -0,0 +1,18 @@
{
"extends": "../../.eslintrc.json",
"overrides": [
{
"files": [
"*.ts",
"*.tsx",
"*.js",
"*.jsx"
],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"off"
]
}
}
]
}

@ -1,6 +1,7 @@
import { PluginClient } from '@remixproject/plugin'
import { createClient } from '@remixproject/plugin-webview'
import EventEmitter from 'events'
// eslint-disable @nrwl/nx/enforce-module-boundaries
import { processStr } from 'solhint'
import { applyExtends } from 'solhint/lib/config/config-file'
import bestPractises from 'solhint/lib/rules/best-practises'

@ -0,0 +1,5 @@
declare module 'solhint' {
export function processStr (inputStr: any, config?: any, fileName?: string)
export function processFile (file: any, config: any)
export function processPath (path: any, config: any)
}

@ -0,0 +1,3 @@
{
"extends": "../../.eslintrc.json"
}

@ -18,7 +18,6 @@ export interface VyperCompilationError {
message: string
}
export type VyperCompilationResultType = {
buildDependencies: any
compilers: [
@ -448,7 +447,6 @@ deployments: {
[contractName: string]: ContractInstanceObject
}
}
export type CompilerInformationObject = {

@ -0,0 +1,3 @@
{
"extends": "../../.eslintrc.json",
}

@ -6,7 +6,6 @@ const { localCall, thisLocalCall, libCall, externalDirect, superLocal, assignmen
// eslint-disable-next-line @typescript-eslint/no-var-requires
lowlevelCall, parameterFunction, parameterFunctionCall, inheritance, blockHashAccess, contractDefinition, funcDefForComplexParams } = require('./astBlocks')
// eslint-disable-next-line @typescript-eslint/no-var-requires
const compiledContractObj = require('./compilationDetails/CompiledContractObj.json')
function escapeRegExp (str) {

@ -53,9 +53,6 @@ test('setup', function (t) {
})
});
test('Integration test thisLocal module', function (t: test.Test) {
t.plan(testFiles.length)
const module: any = modules.thisLocal

@ -291,7 +291,6 @@ const node: Node = {
}
}
node.source = `contract test {
int x;

@ -140,7 +140,6 @@ export const UUPSupgradeAbi = {
"type": "function"
}
export const UUPSupgradeToAndCallAbi = {
"inputs": [
{

@ -63,7 +63,6 @@ module.exports = async function (st, privateKey, contractBytecode, compilationRe
})
})
traceManager.resolveTrace(tx).then(() => {
debuggerEvent.trigger('newTraceLoaded', [traceManager.trace])
}).catch((error) => {

@ -180,7 +180,6 @@ node['ast'].ast = {
src: '0:233:0'
}
node['source'] = `contract test {
int x;

@ -54,8 +54,6 @@ tape('SourceLocationTracker', function (t) {
traceManager.resolveTrace(tx).then(async () => {
try {
// with debugWithGeneratedSources: false
const sourceLocationTracker = new SourceLocationTracker(codeManager, { debugWithGeneratedSources: false })

@ -4,7 +4,6 @@ import { Address } from '@ethereumjs/util'
import { Web3 } from 'web3';
const { Provider } = require('@remix-project/remix-simulator')
async function getWeb3 () {
const remixSimulatorProvider = new Provider({ fork: 'berlin' })
await remixSimulatorProvider.init()

@ -250,7 +250,6 @@ class CustomEthersStateManager extends StateManagerCommonStorageDump {
}
}
export type CurrentVm = {
vm: VM,
web3vm: VmProxy,

@ -21,7 +21,6 @@ describe('testRunner: remix-tests CLI', function(){
}
}
describe('test various CLI options', function() {
it('remix-tests version', () => {
const res = spawnSync(executablePath, ['-V'])
@ -79,8 +78,6 @@ Commands:
})
it('remix-tests running a test file with custom compiler version', () => {
const res = spawnSync(executablePath, ['--compiler', '0.7.4', resolve(__dirname + '/examples_0/assert_ok_test.sol')])
// match initial lines

@ -8,8 +8,6 @@ import { deployAll } from '../src/deployer'
import { runTest, compilationInterface } from '../src/index'
import { ResultsInterface, TestCbInterface, ResultCbInterface } from '../src/index'
// deepEqualExcluding allows us to exclude specific keys whose values vary.
// In this specific test, we'll use this helper to exclude `time` keys.
// Assertions for the existence of these will be made at the correct places.
@ -177,8 +175,6 @@ describe('testRunner', function () {
})
})
describe('assert library NOTEQUAL method tests', function () {
const filename: string = __dirname + '/examples_0/assert_notEqual_test.sol'

@ -9,6 +9,7 @@ import { solidityTokensProvider, solidityLanguageConfig } from './syntaxes/solid
import { cairoTokensProvider, cairoLanguageConfig } from './syntaxes/cairo'
import { zokratesTokensProvider, zokratesLanguageConfig } from './syntaxes/zokrates'
import { moveTokenProvider, moveLanguageConfig } from './syntaxes/move'
import { tomlLanguageConfig, tomlTokenProvider } from './syntaxes/toml'
import { monacoTypes } from '@remix-ui/editor'
import { loadTypes } from './web-types'
import { retrieveNodesAtPosition } from './helpers/retrieveNodesAtPosition'
@ -359,6 +360,8 @@ export const EditorUI = (props: EditorUIProps) => {
monacoRef.current.editor.setModelLanguage(file.model, 'remix-move')
} else if (file.language === 'circom') {
monacoRef.current.editor.setModelLanguage(file.model, 'remix-circom')
} else if (file.language === 'toml') {
monacoRef.current.editor.setModelLanguage(file.model, 'remix-toml')
}
}, [props.currentFile, props.isDiff])
@ -911,6 +914,7 @@ export const EditorUI = (props: EditorUIProps) => {
monacoRef.current.languages.register({ id: 'remix-zokrates' })
monacoRef.current.languages.register({ id: 'remix-move' })
monacoRef.current.languages.register({ id: 'remix-circom' })
monacoRef.current.languages.register({ id: 'remix-toml' })
// Allow JSON schema requests
monacoRef.current.languages.json.jsonDefaults.setDiagnosticsOptions({ enableSchemaRequest: true })
@ -931,6 +935,9 @@ export const EditorUI = (props: EditorUIProps) => {
monacoRef.current.languages.setMonarchTokensProvider('remix-circom', circomTokensProvider as any)
monacoRef.current.languages.setLanguageConfiguration('remix-circom', circomLanguageConfig(monacoRef.current) as any)
monacoRef.current.languages.setMonarchTokensProvider('remix-toml', tomlTokenProvider as any)
monacoRef.current.languages.setLanguageConfiguration('remix-toml', tomlLanguageConfig as any)
monacoRef.current.languages.registerDefinitionProvider('remix-solidity', new RemixDefinitionProvider(props, monaco))
monacoRef.current.languages.registerDocumentHighlightProvider('remix-solidity', new RemixHighLightProvider(props, monaco))
monacoRef.current.languages.registerReferenceProvider('remix-solidity', new RemixReferenceProvider(props, monaco))

@ -0,0 +1,62 @@
/* eslint-disable no-useless-escape */
export const tomlLanguageConfig = {
comments: {
lineComment: "#",
},
brackets: [
["{", "}"],
["[", "]"],
["(", ")"],
],
autoClosingPairs: [
{ open: "{", close: "}" },
{ open: "[", close: "]" },
{ open: "(", close: ")" },
{ open: '"', close: '"' },
{ open: "'", close: "'" },
],
surroundingPairs: [
{ open: "{", close: "}" },
{ open: "[", close: "]" },
{ open: "(", close: ")" },
{ open: '"', close: '"' },
{ open: "'", close: "'" },
],
}
export const tomlTokenProvider = {
defaultToken: "",
tokenPostfix: ".toml",
escapes:
/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
tokenizer: {
root: [
[/([a-zA-Z0-9_-]+)(\s*)(=)/, ["variable.name", "operators", ""]],
[/\[[a-zA-Z0-9_.-]+\]/, "type.identifier"],
[/\s*((#).*)$/, "comment"],
[/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
[/0[xX][0-9a-fA-F]+/, "number.hex"],
[/\d+/, "number"],
[/"([^"\\]|\\.)*$/, "string.invalid"],
[/'([^'\\]|\\.)*$/, "string.invalid"],
[/"/, "string", "@string_double"],
[/'/, "string", "@string_single"],
],
string_double: [
[/[^\\"]+/, "string"],
[/@escapes/, "string.escape"],
[/\\./, "string.escape.invalid"],
[/"/, "string", "@pop"],
],
string_single: [
[/[^\\']+/, "string"],
[/@escapes/, "string.escape"],
[/\\./, "string.escape.invalid"],
[/'/, "string", "@pop"],
],
},
}

@ -326,7 +326,14 @@ export function RunTabUI(props: RunTabProps) {
getFuncABIInputs={getFuncABIValues}
exEnvironment={runTab.selectExEnv}
editInstance={(instance) => {
plugin.call('dapp-draft', 'edit', { address: instance.address, abi: instance.contractData.abi, name: instance.name, network: runTab.networkName })
plugin.call('dapp-draft', 'edit', {
address: instance.address,
abi: instance.contractData.abi,
name: instance.name,
network: runTab.networkName,
devdoc: instance.contractData.object.devdoc,
methodIdentifiers: instance.contractData.object.evm.methodIdentifiers,
})
}}
/>
</div>

@ -202,7 +202,6 @@ export class RemixURLResolver {
return { content, cleanUrl: url }
}
getHandlers (): Handler[] {
return [
{

@ -51,7 +51,6 @@ const logger = {
console.log('check')
await snarkjs.wtns.check(r1cs, wtns, logger);
console.log('prove')
const { proof, publicSignals } = await snarkjs.groth16.prove(zkey_final, wtns);

@ -86,7 +86,6 @@ function hash(message: any): bigint {
console.log('check')
await snarkjs.wtns.check(r1cs, wtns, logger);
console.log('prove')
const { proof, publicSignals } = await snarkjs.groth16.prove(zkey_final, wtns);
@ -94,8 +93,6 @@ function hash(message: any): bigint {
console.log('zk proof validity', verified);
proof1.root.toString() === publicSignals[0] ? console.log('merkle proof valid') : console.log('merkle proof invalid')
} catch (e) {
console.error(e.message)
}

@ -193,7 +193,6 @@ export class FoundryClient extends PluginClient {
console.log('\x1b[32m%s\x1b[0m', 'sources input not found, please update Foundry to the latest version.')
}
compilationResultPart.compilationTarget = contentJSON.ast.absolutePath
// extract data
if (!compilationResultPart.output['sources'][contentJSON.ast.absolutePath]) compilationResultPart.output['sources'][contentJSON.ast.absolutePath] = {}

@ -143,7 +143,6 @@ export class HardhatClient extends PluginClient {
}
}, 1000)
}
listenOnHardHatFolder() {

@ -100,7 +100,6 @@ export class TruffleClient extends PluginClient {
return true
}
private async processArtifact() {
if (!this.checkPath()) return
const folderFiles = await fs.readdir(this.buildPath)

Loading…
Cancel
Save