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
ef8d8350
Commit
ef8d8350
authored
Apr 07, 2016
by
Oleksii Matiiasevych
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Temp solution for constant functions on eth nodes
parent
0df5d87e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
26 deletions
+9
-26
universal-dapp.js
assets/js/universal-dapp.js
+9
-26
No files found.
assets/js/universal-dapp.js
View file @
ef8d8350
...
@@ -416,36 +416,19 @@ UniversalDApp.prototype.runTx = function( data, args, cb) {
...
@@ -416,36 +416,19 @@ UniversalDApp.prototype.runTx = function( data, args, cb) {
var
value
=
self
.
options
.
getValue
?
self
.
options
.
getValue
:
0
;
var
value
=
self
.
options
.
getValue
?
self
.
options
.
getValue
:
0
;
if
(
!
this
.
vm
)
{
if
(
!
this
.
vm
)
{
var
tx
=
{
from
:
self
.
options
.
getAddress
?
self
.
options
.
getAddress
()
:
web3
.
eth
.
accounts
[
0
],
to
:
to
,
data
:
data
,
gas
:
gas
,
value
:
value
};
if
(
constant
&&
!
isConstructor
)
{
if
(
constant
&&
!
isConstructor
)
{
var
func
=
web3
.
eth
.
contract
(
[
args
.
abi
]
).
at
(
to
);
web3
.
eth
.
call
(
tx
,
cb
);
var
prepareCallArgs
=
function
(
callArgs
)
{
var
split
=
function
(
str
,
arr
)
{
if
(
str
===
""
)
return
arr
;
var
chunk
=
str
.
slice
(
0
,
64
);
arr
.
push
(
"0x"
+
chunk
);
return
split
(
str
.
slice
(
64
),
arr
);
}
return
split
(
callArgs
,
[]);
};
var
argsOnly
=
data
.
slice
(
10
);
var
callArgs
=
prepareCallArgs
(
argsOnly
);
callArgs
.
push
(
cb
);
func
[
args
.
abi
.
name
].
call
.
apply
(
this
,
callArgs
);
}
else
{
}
else
{
var
tx
=
{
from
:
self
.
options
.
getAddress
?
self
.
options
.
getAddress
()
:
web3
.
eth
.
accounts
[
0
],
to
:
to
,
data
:
data
,
gas
:
gas
,
value
:
value
};
web3
.
eth
.
estimateGas
(
tx
,
function
(
err
,
resp
){
web3
.
eth
.
estimateGas
(
tx
,
function
(
err
,
resp
){
tx
.
gas
=
resp
;
tx
.
gas
=
resp
;
if
(
!
err
)
web3
.
eth
.
sendTransaction
(
tx
,
function
(
err
,
resp
)
{
if
(
!
err
)
web3
.
eth
.
sendTransaction
(
tx
,
cb
);
cb
(
err
,
resp
);
});
else
cb
(
err
,
resp
);
else
cb
(
err
,
resp
);
});
});
}
}
...
...
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