Merge pull request #2295 from ethereum/bumpRemixLibs

Bump remix libs && fix remix tests module view
pull/3094/head
yann300 5 years ago committed by GitHub
commit 36541bea56
  1. 18326
      package-lock.json
  2. 10
      package.json
  3. 5
      src/app.js
  4. 20
      src/app/editor/SourceHighlighters.js
  5. 23
      src/app/editor/editor.js
  6. 11
      src/app/tabs/test-tab.js
  7. 9
      src/app/udapp/run-tab.js
  8. 2
      src/lib/panels-resize.js

18326
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -51,12 +51,12 @@
"npm-merge-driver": "^2.3.5",
"npm-run-all": "^4.0.2",
"onchange": "^3.2.1",
"remix-analyzer": "0.3.8",
"remix-debug": "0.3.9",
"remix-lib": "^0.4.8",
"remix-solidity": "0.3.10",
"remix-analyzer": "0.3.11",
"remix-debug": "0.3.12",
"remix-lib": "0.4.10",
"remix-solidity": "0.3.13",
"remix-tabs": "1.0.48",
"remix-tests": "0.1.13",
"remix-tests": "0.1.16",
"remixd": "0.1.8-alpha.7",
"request": "^2.83.0",
"rimraf": "^2.6.1",

@ -247,7 +247,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
appManager.register([
contentImport,
themeModule,
editor.sourceHighlighters,
editor,
fileManager,
compilerMetadataGenerator,
compilersArtefacts,
@ -317,7 +317,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
registry.get('filemanager').api,
filePanel,
compileTab,
appManager
appManager,
new Renderer()
)
appManager.register([

@ -1,29 +1,16 @@
'use strict'
const SourceHighlighter = require('./sourceHighlighter')
import { Plugin } from '@remixproject/engine'
import * as packageJson from '../../../package.json'
const profile = {
displayName: 'Editor',
name: 'editor',
description: 'service - highlight source code',
version: packageJson.version,
methods: ['highlight', 'discardHighlight']
}
// EditorApi:
// - methods: ['highlight', 'discardHighlight'],
class SourceHighlighters extends Plugin {
class SourceHighlighters {
constructor () {
super(profile)
this.highlighters = {}
}
highlight (position, filePath, hexColor) {
const { from } = this.currentRequest
highlight (position, filePath, hexColor, from) {
try {
if (!this.highlighters[from]) this.highlighters[from] = new SourceHighlighter()
this.highlighters[from].currentSourceLocation(null)
@ -33,8 +20,7 @@ class SourceHighlighters extends Plugin {
}
}
discardHighlight () {
const { from } = this.currentRequest
discardHighlight (from) {
if (this.highlighters[from]) this.highlighters[from].currentSourceLocation(null)
}
}

@ -3,6 +3,8 @@ const EventManager = require('../../lib/events')
const yo = require('yo-yo')
const csjs = require('csjs-inject')
const ace = require('brace')
import { Plugin } from '@remixproject/engine'
import * as packageJson from '../../../package.json'
const globalRegistry = require('../../global/registry')
const SourceHighlighters = require('./SourceHighlighters')
@ -37,9 +39,18 @@ document.head.appendChild(yo`
</style>
`)
class Editor {
const profile = {
displayName: 'Editor',
name: 'editor',
description: 'service - editor',
version: packageJson.version,
methods: ['highlight', 'discardHighlight', 'clearAnnotations', 'addAnnotation']
}
class Editor extends Plugin {
constructor (opts = {}, themeModule) {
super(profile)
// Dependancies
this._components = {}
this._components.registry = globalRegistry
@ -177,6 +188,16 @@ class Editor {
})
}
highlight (position, filePath, hexColor) {
const { from } = this.currentRequest
this.sourceHighlighters.highlight(position, filePath, hexColor, from)
}
discardHighlight () {
const { from } = this.currentRequest
this.sourceHighlighters.discardHighlight(from)
}
setTheme (type) {
this.editor.setTheme('ace/theme/' + this._themes[type])
}

@ -19,15 +19,15 @@ const profile = {
}
module.exports = class TestTab extends ViewPlugin {
constructor (fileManager, filePanel, compileTab, appManager) {
constructor (fileManager, filePanel, compileTab, appManager, renderer) {
super(profile)
this.compileTab = compileTab
this._view = { el: null }
this.compileTab = compileTab
this.fileManager = fileManager
this.filePanel = filePanel
this.data = {}
this.appManager = appManager
this.renderer = renderer
appManager.event.on('activate', (name) => {
if (name === 'solidity') this.updateRunAction(fileManager.currentFile())
})
@ -117,10 +117,10 @@ module.exports = class TestTab extends ViewPlugin {
cb()
}
updateFinalResult (_err, result, filename) {
updateFinalResult (_errors, result, filename) {
this.testsSummary.hidden = false
if (_err) {
this.testsSummary.appendChild(yo`<div class="${css.testFailureSummary} text-danger" >${_err.message}</div>`)
if (_errors) {
_errors.forEach((err) => this.renderer.error(err.formattedMessage || err.message, this.testsSummary, {type: err.severity}))
return
}
this.testsSummary.appendChild(yo`<div class=${css.summaryTitle}> ${filename} </div>`)
@ -178,6 +178,7 @@ module.exports = class TestTab extends ViewPlugin {
}
runTests () {
this.call('editor', 'clearAnnotations')
this.testsOutput.innerHTML = ''
this.testsSummary.innerHTML = ''
var tests = this.data.selectedTests

@ -3,6 +3,7 @@ import * as packageJson from '../../../package.json'
const $ = require('jquery')
const yo = require('yo-yo')
const ethJSUtil = require('ethereumjs-util')
const EventManager = require('../../lib/events')
const Card = require('../ui/card')
@ -44,6 +45,8 @@ export class RunTab extends LibraryPlugin {
this.filePanel = filePanel
this.compilersArtefacts = compilersArtefacts
this.networkModule = networkModule
executionContext.checkpointAndCommit(() => { console.log('initial checkpoint and commit of JavaScript VM') })
}
onActivationInternal () {
@ -68,7 +71,11 @@ export class RunTab extends LibraryPlugin {
}
},
getGasLimit: (cb) => {
cb(null, $('#gasLimit').val())
try {
cb(null, '0x' + new ethJSUtil.BN($('#gasLimit').val(), 10).toString(16))
} catch (e) {
cb(e.message)
}
}
})
}

@ -3,7 +3,7 @@ const csjs = require('csjs-inject')
const css = csjs`
.dragbar {
width : 1px;
width : 2px;
height : 100%;
cursor : col-resize;
z-index : 999;

Loading…
Cancel
Save