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
3f4cb564
Commit
3f4cb564
authored
May 23, 2016
by
Alex Beregszaszi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make gasLimit fully configurable from UI
parent
62822128
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
4 deletions
+12
-4
index.html
index.html
+1
-1
renderer.js
src/app/renderer.js
+1
-0
universal-dapp.js
src/universal-dapp.js
+10
-3
No files found.
index.html
View file @
3f4cb564
...
...
@@ -73,7 +73,7 @@
<div
class=
"crow"
>
<label
for=
"txorigin"
><select
name=
"txorigin"
id=
"txorigin"
></select>
Transaction origin
</label>
</div>
<div
class=
"crow
hide
"
>
<div
class=
"crow"
>
<label
for=
"gasLimit"
><input
type=
"number"
id=
"gasLimit"
value=
"3000000"
>
Gas limit
</label>
</div>
<div
class=
"crow hide"
>
...
...
src/app/renderer.js
View file @
3f4cb564
...
...
@@ -67,6 +67,7 @@ function Renderer (editor, executionContext, updateFiles) {
var
comp
=
$
(
'#value'
).
val
().
split
(
' '
);
return
executionContext
.
web3
().
toWei
(
comp
[
0
],
comp
.
slice
(
1
).
join
(
' '
));
},
getGasLimit
:
function
()
{
return
$
(
'#gasLimit'
).
val
();
},
removable_instances
:
true
,
renderOutputModifier
:
function
(
contractName
,
$contractOutput
)
{
var
contract
=
data
.
contracts
[
contractName
];
...
...
src/universal-dapp.js
View file @
3f4cb564
...
...
@@ -618,7 +618,14 @@ UniversalDApp.prototype.runTx = function (data, args, cb) {
data
=
'0x'
+
data
;
}
var
gas
=
self
.
options
.
getGas
?
self
.
options
.
getGas
:
3000000
;
var
gasLimit
=
3000000
;
if
(
self
.
options
.
getGasLimit
)
{
try
{
gasLimit
=
self
.
options
.
getGasLimit
();
}
catch
(
e
)
{
return
cb
(
e
);
}
}
var
value
=
0
;
if
(
self
.
options
.
getValue
)
{
...
...
@@ -645,7 +652,7 @@ UniversalDApp.prototype.runTx = function (data, args, cb) {
return
cb
(
err
,
resp
);
}
if
(
resp
>
gas
)
{
if
(
resp
>
gas
Limit
)
{
return
cb
(
'Gas required exceeds limit: '
+
resp
);
}
...
...
@@ -667,7 +674,7 @@ UniversalDApp.prototype.runTx = function (data, args, cb) {
tx
=
new
EthJSTX
({
nonce
:
new
Buffer
([
account
.
nonce
++
]),
// @todo count beyond 255
gasPrice
:
1
,
gasLimit
:
gas
,
gasLimit
:
gas
Limit
,
to
:
to
,
value
:
new
BN
(
value
,
10
),
data
:
new
Buffer
(
data
.
slice
(
2
),
'hex'
)
...
...
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