Skip to content

Commit

Permalink
Fix logic after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
MidnightLightning committed Dec 18, 2017
1 parent 24e28c3 commit a812f36
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/app/execution/txHelper.js
Expand Up @@ -33,16 +33,14 @@ module.exports = {

sortAbiFunction: function (contractabi) {
var abi = contractabi.sort(function (a, b) {
if (a.name > b.name) {
return -1
} else {
return 1
} else if (b.constant === true && a.constant !== true) {
return -1
if (a.constant === true && b.constant !== true) {
return 1;
} else if (b.constant === true && a.constant != true) {
return -1;
}
// 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') {
if (a.type === 'function' && typeof a.name !== 'undefined') {
return a.name.localeCompare(b.name)
} else if (a.type === 'constructor' || a.type === 'fallback') {
return 1
Expand Down

0 comments on commit a812f36

Please sign in to comment.