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
23a412df
Commit
23a412df
authored
Oct 08, 2015
by
chriseth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Formatting.
parent
c6062c53
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
19 deletions
+15
-19
universal-dapp.js
libs/universal-dapp.js
+15
-19
No files found.
libs/universal-dapp.js
View file @
23a412df
...
...
@@ -238,21 +238,21 @@ UniversalDApp.prototype.getCallButton = function(args) {
var
$result
=
getOutput
(
$
(
'<a class="waiting" href="#" title="Waiting for transaction to be mined.">Polling for tx receipt...</a>'
)
);
if
(
isConstructor
)
{
if
(
args
.
bytecode
.
indexOf
(
'_'
)
>=
0
)
{
if
(
self
.
options
.
vm
)
self
.
linkBytecode
(
args
.
contractName
,
function
(
err
,
bytecode
)
{
if
(
err
)
$result
.
replaceWith
(
getOutput
(
$
(
'<span/>'
).
text
(
'Error deploying required libraries: '
+
err
)));
else
{
args
.
bytecode
=
bytecode
;
handleCallButtonClick
(
ev
);
}
});
else
$result
.
replaceWe
th
(
getOutput
(
$
(
'<span>Contract needs to be linked to a library, this is only supported in the JavaScript VM for now.</span>'
)));
return
;
}
else
data
=
args
.
bytecode
+
data
.
slice
(
8
);
if
(
args
.
bytecode
.
indexOf
(
'_'
)
>=
0
)
{
if
(
self
.
options
.
vm
)
self
.
linkBytecode
(
args
.
contractName
,
function
(
err
,
bytecode
)
{
if
(
err
)
$result
.
replaceWith
(
getOutput
(
$
(
'<span/>'
).
text
(
'Error deploying required libraries: '
+
err
)));
else
{
args
.
bytecode
=
bytecode
;
handleCallButtonClick
(
ev
);
}
});
else
$result
.
replaceWi
th
(
getOutput
(
$
(
'<span>Contract needs to be linked to a library, this is only supported in the JavaScript VM for now.</span>'
)));
return
;
}
else
data
=
args
.
bytecode
+
data
.
slice
(
8
);
}
if
(
lookupOnly
&&
!
inputs
.
length
)
{
...
...
@@ -316,7 +316,6 @@ UniversalDApp.prototype.getCallButton = function(args) {
}
UniversalDApp
.
prototype
.
linkBytecode
=
function
(
contractName
,
cb
)
{
console
.
log
(
"linking "
+
contractName
);
var
bytecode
=
this
.
getContractByName
(
contractName
).
bytecode
;
if
(
bytecode
.
indexOf
(
'_'
)
<
0
)
return
cb
(
null
,
bytecode
);
...
...
@@ -341,7 +340,6 @@ console.log("linking " + contractName);
};
UniversalDApp
.
prototype
.
deployLibrary
=
function
(
contractName
,
cb
)
{
console
.
log
(
"deploying librari "
+
contractName
);
if
(
this
.
getContractByName
(
contractName
).
address
)
return
cb
(
null
,
this
.
getContractByName
(
contractName
).
address
);
var
self
=
this
;
...
...
@@ -352,9 +350,7 @@ console.log("deploying librari " + contractName);
else
self
.
deployLibrary
(
contractName
,
cb
);
});
else
{
console
.
log
(
cb
);
this
.
runTx
(
bytecode
,
{
abi
:
{
constant
:
false
},
bytecode
:
bytecode
},
function
(
err
,
result
)
{
console
.
log
(
cb
);
if
(
err
)
return
cb
(
err
);
self
.
getContractByName
(
contractName
).
address
=
result
.
createdAddress
;
cb
(
err
,
result
.
createdAddress
);
...
...
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