Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
67a248ae
Commit
67a248ae
authored
Nov 21, 2016
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix html rendering
parent
2b91c6a7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
6 deletions
+10
-6
renderer.js
src/app/renderer.js
+6
-1
gasCosts.js
src/app/staticanalysis/modules/gasCosts.js
+2
-2
txOrigin.js
src/app/staticanalysis/modules/txOrigin.js
+1
-1
staticAnalysisView.js
src/app/staticanalysis/staticAnalysisView.js
+1
-1
staticanalysis.js
test-browser/tests/staticanalysis.js
+0
-1
No files found.
src/app/renderer.js
View file @
67a248ae
...
...
@@ -40,7 +40,12 @@ Renderer.prototype.error = function (message, container, options) {
if
(
!
opt
.
type
)
{
opt
.
type
=
utils
.
errortype
(
message
)
}
var
$pre
=
$
(
opt
.
useSpan
?
'<span />'
:
'<pre />'
).
text
(
message
)
var
$pre
if
(
opt
.
isHTML
)
{
$pre
=
$
(
opt
.
useSpan
?
'<span />'
:
'<pre />'
).
html
(
message
)
}
else
{
$pre
=
$
(
opt
.
useSpan
?
'<span />'
:
'<pre />'
).
text
(
message
)
}
var
$error
=
$
(
'<div class="sol '
+
opt
.
type
+
'"><div class="close"><i class="fa fa-close"></i></div></div>'
).
prepend
(
$pre
)
if
(
container
===
undefined
)
{
container
=
$
(
'#output'
)
...
...
src/app/staticanalysis/modules/gasCosts.js
View file @
67a248ae
...
...
@@ -18,7 +18,7 @@ gasCosts.prototype.report = function (compilationResults) {
if
(
fallback
!==
undefined
)
{
if
(
fallback
===
null
||
fallback
>=
2100
)
{
report
.
push
({
warning
:
`Fallback function of contract
${
contractName
}
requires too much gas (
${
fallback
}
).
\n
warning
:
`Fallback function of contract
${
contractName
}
requires too much gas (
${
fallback
}
).
<br />
If the fallback function requires more than 2300 gas, the contract cannot receive Ether.`
})
}
...
...
@@ -32,7 +32,7 @@ gasCosts.prototype.report = function (compilationResults) {
var
gasString
=
gas
===
null
?
'unknown or not constant'
:
'high: '
+
gas
if
(
gas
===
null
||
gas
>=
3000000
)
{
report
.
push
({
warning
:
`Gas requirement of function
${
contractName
}
.
${
functionName
}
${
gasString
}
.
\n
warning
:
`Gas requirement of function
${
contractName
}
.
${
functionName
}
${
gasString
}
.
<br />
If the gas requirement of a function is higher than the block gas limit, it cannot be executed.
Please avoid loops in your functions or actions that modify large areas of storage
(this includes clearing or copying arrays in storage)`
...
...
src/app/staticanalysis/modules/txOrigin.js
View file @
67a248ae
...
...
@@ -19,7 +19,7 @@ txOrigin.prototype.visit = function (node) {
txOrigin
.
prototype
.
report
=
function
()
{
return
this
.
txOriginNodes
.
map
(
function
(
item
,
i
)
{
return
{
warning
:
`use of tx.origin: "tx.origin" is useful only in very exceptional cases.
\n
warning
:
`use of tx.origin: "tx.origin" is useful only in very exceptional cases.
<br />
If you use it for authentication, you usually want to replace it by "msg.sender", because otherwise any contract you call can act on your behalf.`
,
location
:
item
.
src
}
...
...
src/app/staticanalysis/staticAnalysisView.js
View file @
67a248ae
...
...
@@ -78,7 +78,7 @@ staticAnalysisView.prototype.run = function () {
location
=
self
.
offsetToColumnConverter
.
offsetToLineColumn
(
location
,
file
,
self
.
editor
,
self
.
lastCompilationResult
)
location
=
self
.
lastCompilationResult
.
sourceList
[
file
]
+
':'
+
(
location
.
start
.
line
+
1
)
+
':'
+
(
location
.
start
.
column
+
1
)
+
':'
}
self
.
renderer
.
error
(
location
+
' '
+
item
.
warning
,
warningContainer
,
{
type
:
'warning'
,
useSpan
:
true
})
self
.
renderer
.
error
(
location
+
' '
+
item
.
warning
,
warningContainer
,
{
type
:
'warning'
,
useSpan
:
true
,
isHTML
:
true
})
})
})
if
(
warningContainer
.
html
()
===
''
)
{
...
...
test-browser/tests/staticanalysis.js
View file @
67a248ae
...
...
@@ -33,7 +33,6 @@ function runTests (browser) {
browser
.
waitForElementVisible
(
'.newFile'
,
10000
)
contractHelper
.
testContracts
(
browser
,
sources
.
sources
.
Untitled
,
[
'TooMuchGas'
,
'test1'
,
'test2'
],
function
()
{
console
.
log
(
'pppzzz?'
)
browser
.
click
(
'.staticanalysisView'
)
.
click
(
'#staticanalysisView button'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment