pull/5370/head
aniket-engg 5 years ago committed by Aniket
parent c2a12bf0fe
commit 190571f5eb
  1. 9
      remix-lib/src/execution/txHelper.js

@ -41,14 +41,13 @@ module.exports = {
}, },
sortAbiFunction: function (contractabi) { sortAbiFunction: function (contractabi) {
// Sorts the list of ABI entries. Constant functions will appear first, // Check if function is constant (introduced with Solidity 0.6.0)
// followed by non-constant functions. Within those t wo groupings, functions
// will be sorted by their names.
function isConstant (funcABI) { function isConstant (funcABI) {
return (funcABI.stateMutability === 'view' || funcABI.stateMutability === 'pure') return (funcABI.stateMutability === 'view' || funcABI.stateMutability === 'pure')
} }
// Sorts the list of ABI entries. Constant functions will appear first,
// followed by non-constant functions. Within those t wo groupings, functions
// will be sorted by their names.
return contractabi.sort(function (a, b) { return contractabi.sort(function (a, b) {
if (isConstant(a) && !isConstant(b)) { if (isConstant(a) && !isConstant(b)) {
return 1 return 1

Loading…
Cancel
Save