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
5d206a41
Commit
5d206a41
authored
May 19, 2016
by
chriseth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4 from ethereum/npmify
Renaming: Use JS for ethereumjs-abi.
parents
a5b91042
7b4335a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
universal-dapp.js
src/universal-dapp.js
+6
-6
No files found.
src/universal-dapp.js
View file @
5d206a41
...
@@ -4,7 +4,7 @@ var Trie = require('merkle-patricia-tree');
...
@@ -4,7 +4,7 @@ var Trie = require('merkle-patricia-tree');
var
ethJSUtil
=
require
(
'ethereumjs-util'
);
var
ethJSUtil
=
require
(
'ethereumjs-util'
);
var
EthJSTX
=
require
(
'ethereumjs-tx'
);
var
EthJSTX
=
require
(
'ethereumjs-tx'
);
var
EthJSAccount
=
require
(
'ethereumjs-account'
);
var
EthJSAccount
=
require
(
'ethereumjs-account'
);
var
ethABI
=
require
(
'ethereumjs-abi'
);
var
eth
JS
ABI
=
require
(
'ethereumjs-abi'
);
var
EthJSBlock
=
require
(
'ethereumjs-block'
);
var
EthJSBlock
=
require
(
'ethereumjs-block'
);
var
web3
=
require
(
'./web3-adapter.js'
);
var
web3
=
require
(
'./web3-adapter.js'
);
...
@@ -185,7 +185,7 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar
...
@@ -185,7 +185,7 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar
$
.
each
(
abi
,
function
(
i
,
funABI
)
{
$
.
each
(
abi
,
function
(
i
,
funABI
)
{
if
(
funABI
.
type
!==
'event'
)
return
;
if
(
funABI
.
type
!==
'event'
)
return
;
var
hash
=
ethABI
.
eventID
(
funABI
.
name
,
funABI
.
inputs
.
map
(
function
(
item
)
{
return
item
.
type
}))
var
hash
=
eth
JS
ABI
.
eventID
(
funABI
.
name
,
funABI
.
inputs
.
map
(
function
(
item
)
{
return
item
.
type
}))
eventABI
[
hash
.
toString
(
'hex'
)]
=
{
event
:
funABI
.
name
,
inputs
:
funABI
.
inputs
};
eventABI
[
hash
.
toString
(
'hex'
)]
=
{
event
:
funABI
.
name
,
inputs
:
funABI
.
inputs
};
});
});
...
@@ -201,8 +201,8 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar
...
@@ -201,8 +201,8 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar
var
types
=
abi
.
inputs
.
map
(
function
(
item
)
{
var
types
=
abi
.
inputs
.
map
(
function
(
item
)
{
return
item
.
type
;
return
item
.
type
;
});
});
decoded
=
ethABI
.
rawDecode
(
types
,
log
[
2
]);
decoded
=
eth
JS
ABI
.
rawDecode
(
types
,
log
[
2
]);
decoded
=
ethABI
.
stringify
(
types
,
decoded
)
decoded
=
eth
JS
ABI
.
stringify
(
types
,
decoded
)
}
catch
(
e
)
{
}
catch
(
e
)
{
decoded
=
'0x'
+
log
[
2
].
toString
(
'hex'
);
decoded
=
'0x'
+
log
[
2
].
toString
(
'hex'
);
}
}
...
@@ -402,10 +402,10 @@ UniversalDApp.prototype.getCallButton = function(args) {
...
@@ -402,10 +402,10 @@ UniversalDApp.prototype.getCallButton = function(args) {
}
}
// decode data
// decode data
var
decodedObj
=
ethABI
.
rawDecode
(
outputTypes
,
result
.
vm
.
return
);
var
decodedObj
=
eth
JS
ABI
.
rawDecode
(
outputTypes
,
result
.
vm
.
return
);
// format decoded data
// format decoded data
decodedObj
=
ethABI
.
stringify
(
outputTypes
,
decodedObj
);
decodedObj
=
eth
JS
ABI
.
stringify
(
outputTypes
,
decodedObj
);
for
(
var
i
=
0
;
i
<
outputTypes
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
outputTypes
.
length
;
i
++
)
{
var
name
=
args
.
abi
.
outputs
[
i
].
name
;
var
name
=
args
.
abi
.
outputs
[
i
].
name
;
if
(
name
.
length
>
0
)
{
if
(
name
.
length
>
0
)
{
...
...
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