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
00b36f63
Unverified
Commit
00b36f63
authored
Feb 27, 2018
by
yann300
Committed by
GitHub
Feb 27, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #707 from ethereum/yann300-patch-2
Fix sort ordering logic
parents
7634e0d1
c1120cfa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
txHelper.js
remix-lib/src/execution/txHelper.js
+12
-9
No files found.
remix-lib/src/execution/txHelper.js
View file @
00b36f63
...
@@ -31,20 +31,23 @@ module.exports = {
...
@@ -31,20 +31,23 @@ module.exports = {
},
},
sortAbiFunction
:
function
(
contractabi
)
{
sortAbiFunction
:
function
(
contractabi
)
{
var
abi
=
contractabi
.
sort
(
function
(
a
,
b
)
{
// Sorts the list of ABI entries. Constant functions will appear first,
if
(
a
.
name
>
b
.
name
)
{
// followed by non-constant functions. Within those t wo groupings, functions
return
-
1
// will be sorted by their names.
}
else
{
return
contractabi
.
sort
(
function
(
a
,
b
)
{
if
(
a
.
constant
===
true
&&
b
.
constant
!==
true
)
{
return
1
return
1
}
}
else
if
(
b
.
constant
===
true
&&
a
.
constant
!==
true
)
{
}).
sort
(
function
(
a
,
b
)
{
if
(
a
.
constant
===
true
)
{
return
-
1
return
-
1
}
else
{
}
// If we reach here, either a and b are both constant or both not; sort by name then
// special case for fallback and constructor
if
(
a
.
type
===
'function'
&&
typeof
a
.
name
!==
'undefined'
)
{
return
a
.
name
.
localeCompare
(
b
.
name
)
}
else
if
(
a
.
type
===
'constructor'
||
a
.
type
===
'fallback'
)
{
return
1
return
1
}
}
})
})
return
abi
},
},
getConstructorInterface
:
function
(
abi
)
{
getConstructorInterface
:
function
(
abi
)
{
...
...
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