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
f6cf244d
Commit
f6cf244d
authored
Nov 14, 2016
by
Alex Beregszaszi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Udapp: rely on constructor ABI to be supplied
parent
b5ac39fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
universal-dapp.js
src/universal-dapp.js
+10
-5
No files found.
src/universal-dapp.js
View file @
f6cf244d
...
...
@@ -196,6 +196,10 @@ UniversalDApp.prototype.getCreateInterface = function ($container, contract) {
$createInterface
.
append
(
$atButton
)
var
$newButton
=
self
.
getInstanceInterface
(
contract
)
if
(
!
$newButton
)
{
return
$createInterface
}
$createInterface
.
append
(
$newButton
)
// Only display creation interface for non-abstract contracts.
...
...
@@ -228,7 +232,12 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar
return
1
}
})
var
funABI
=
self
.
getConstructorInterface
(
abi
)
if
(
!
funABI
)
{
return
}
var
$createInterface
=
$
(
'<div class="createContract"/>'
)
var
appendFunctions
=
function
(
address
,
$el
)
{
...
...
@@ -362,16 +371,12 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar
return
$createInterface
}
// either return the supplied constructor or a mockup (we assume everything can be instantiated)
UniversalDApp
.
prototype
.
getConstructorInterface
=
function
(
abi
)
{
var
funABI
=
{
'name'
:
''
,
'inputs'
:
[],
'type'
:
'constructor'
,
'outputs'
:
[]
}
for
(
var
i
=
0
;
i
<
abi
.
length
;
i
++
)
{
if
(
abi
[
i
].
type
===
'constructor'
)
{
funABI
.
inputs
=
abi
[
i
].
inputs
||
[]
break
return
abi
[
i
]
}
}
return
funABI
}
UniversalDApp
.
prototype
.
getCallButton
=
function
(
args
)
{
...
...
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