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
9e148f0f
Commit
9e148f0f
authored
Apr 15, 2016
by
chriseth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #140 from axic/feature/provide-value
Support specifying a value for a transaction
parents
ef05c2f2
b83ca4aa
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
4 deletions
+16
-4
app.js
assets/js/app.js
+4
-0
universal-dapp.js
assets/js/universal-dapp.js
+10
-2
index.html
index.html
+2
-2
No files found.
assets/js/app.js
View file @
9e148f0f
...
@@ -672,6 +672,10 @@
...
@@ -672,6 +672,10 @@
vm
:
executionContext
===
'vm'
,
vm
:
executionContext
===
'vm'
,
removable
:
false
,
removable
:
false
,
getAddress
:
function
(){
return
$
(
'#txorigin'
).
val
();
},
getAddress
:
function
(){
return
$
(
'#txorigin'
).
val
();
},
getValue
:
function
(){
var
comp
=
$
(
'#value'
).
val
().
split
(
' '
);
return
web3
.
toWei
(
comp
[
0
],
comp
.
slice
(
1
).
join
(
' '
));
},
removable_instances
:
true
,
removable_instances
:
true
,
renderOutputModifier
:
function
(
contractName
,
$contractOutput
)
{
renderOutputModifier
:
function
(
contractName
,
$contractOutput
)
{
var
contract
=
data
.
contracts
[
contractName
];
var
contract
=
data
.
contracts
[
contractName
];
...
...
assets/js/universal-dapp.js
View file @
9e148f0f
...
@@ -431,7 +431,15 @@ UniversalDApp.prototype.runTx = function( data, args, cb) {
...
@@ -431,7 +431,15 @@ UniversalDApp.prototype.runTx = function( data, args, cb) {
data
=
'0x'
+
data
;
data
=
'0x'
+
data
;
var
gas
=
self
.
options
.
getGas
?
self
.
options
.
getGas
:
1000000
;
var
gas
=
self
.
options
.
getGas
?
self
.
options
.
getGas
:
1000000
;
var
value
=
self
.
options
.
getValue
?
self
.
options
.
getValue
:
0
;
var
value
=
0
;
if
(
self
.
options
.
getValue
)
{
try
{
value
=
self
.
options
.
getValue
();
}
catch
(
e
)
{
return
cb
(
e
);
}
}
if
(
!
this
.
vm
)
{
if
(
!
this
.
vm
)
{
var
tx
=
{
var
tx
=
{
...
@@ -459,7 +467,7 @@ UniversalDApp.prototype.runTx = function( data, args, cb) {
...
@@ -459,7 +467,7 @@ UniversalDApp.prototype.runTx = function( data, args, cb) {
gasPrice
:
1
,
gasPrice
:
1
,
gasLimit
:
3000000000
,
//plenty
gasLimit
:
3000000000
,
//plenty
to
:
to
,
to
:
to
,
value
:
value
,
value
:
new
this
.
BN
(
value
,
10
)
,
data
:
new
Buffer
(
data
.
slice
(
2
),
'hex'
)
data
:
new
Buffer
(
data
.
slice
(
2
),
'hex'
)
});
});
tx
.
sign
(
account
.
privateKey
);
tx
.
sign
(
account
.
privateKey
);
...
...
index.html
View file @
9e148f0f
...
@@ -80,8 +80,8 @@
...
@@ -80,8 +80,8 @@
<div
class=
"row hide"
>
<div
class=
"row hide"
>
<label
for=
"gasPrice"
><input
type=
"number"
id=
"gasPrice"
value=
"0"
>
Gas Price
</label>
<label
for=
"gasPrice"
><input
type=
"number"
id=
"gasPrice"
value=
"0"
>
Gas Price
</label>
</div>
</div>
<div
class=
"row
hide
"
>
<div
class=
"row"
>
<label
for=
"value"
><input
type=
"
number"
id=
"value"
value=
"0"
>
Value
</label>
<label
for=
"value"
><input
type=
"
text"
id=
"value"
value=
"0"
>
Value (e.g. .7 ether or 5 wei, defaults to ether)
</label>
</div>
</div>
</div>
</div>
<div
id=
"settingsView"
>
<div
id=
"settingsView"
>
...
...
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