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
ab059338
Commit
ab059338
authored
Sep 16, 2016
by
chriseth
Committed by
GitHub
Sep 16, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #238 from ethereum/runtx
Simplify runTx
parents
33c5b428
40c7147c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
universal-dapp.js
src/universal-dapp.js
+6
-7
No files found.
src/universal-dapp.js
View file @
ab059338
...
@@ -566,7 +566,7 @@ UniversalDApp.prototype.getCallButton = function (args) {
...
@@ -566,7 +566,7 @@ UniversalDApp.prototype.getCallButton = function (args) {
};
};
var
decoded
;
var
decoded
;
self
.
runTx
(
data
,
args
,
function
(
err
,
result
)
{
self
.
runTx
(
{
to
:
args
.
address
,
data
:
data
,
useCall
:
args
.
abi
.
constant
&&
!
isConstructor
}
,
function
(
err
,
result
)
{
if
(
err
)
{
if
(
err
)
{
replaceOutput
(
$result
,
$
(
'<span/>'
).
text
(
err
).
addClass
(
'error'
));
replaceOutput
(
$result
,
$
(
'<span/>'
).
text
(
err
).
addClass
(
'error'
));
// VM only
// VM only
...
@@ -675,7 +675,7 @@ UniversalDApp.prototype.deployLibrary = function (contractName, cb) {
...
@@ -675,7 +675,7 @@ UniversalDApp.prototype.deployLibrary = function (contractName, cb) {
else
self
.
deployLibrary
(
contractName
,
cb
);
else
self
.
deployLibrary
(
contractName
,
cb
);
});
});
}
else
{
}
else
{
self
.
runTx
(
bytecode
,
{
abi
:
{
constant
:
false
},
bytecode
:
bytecod
e
},
function
(
err
,
result
)
{
self
.
runTx
(
{
data
:
bytecode
,
useCall
:
fals
e
},
function
(
err
,
result
)
{
if
(
err
)
{
if
(
err
)
{
return
cb
(
err
);
return
cb
(
err
);
}
}
...
@@ -702,11 +702,10 @@ function tryTillResponse (web3, txhash, done) {
...
@@ -702,11 +702,10 @@ function tryTillResponse (web3, txhash, done) {
});
});
}
}
UniversalDApp
.
prototype
.
runTx
=
function
(
data
,
args
,
cb
)
{
UniversalDApp
.
prototype
.
runTx
=
function
(
args
,
cb
)
{
var
self
=
this
;
var
self
=
this
;
var
to
=
args
.
address
;
var
to
=
args
.
to
;
var
constant
=
args
.
abi
.
constant
;
var
data
=
args
.
data
;
var
isConstructor
=
args
.
bytecode
!==
undefined
;
if
(
data
.
slice
(
0
,
2
)
!==
'0x'
)
{
if
(
data
.
slice
(
0
,
2
)
!==
'0x'
)
{
data
=
'0x'
+
data
;
data
=
'0x'
+
data
;
}
}
...
@@ -737,7 +736,7 @@ UniversalDApp.prototype.runTx = function (data, args, cb) {
...
@@ -737,7 +736,7 @@ UniversalDApp.prototype.runTx = function (data, args, cb) {
data
:
data
,
data
:
data
,
value
:
value
value
:
value
};
};
if
(
constant
&&
!
isConstructor
)
{
if
(
args
.
useCall
)
{
tx
.
gas
=
gasLimit
;
tx
.
gas
=
gasLimit
;
self
.
web3
.
eth
.
call
(
tx
,
cb
);
self
.
web3
.
eth
.
call
(
tx
,
cb
);
}
else
{
}
else
{
...
...
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