CyberMiles / smart_contracts

Smart contracts and DApps deployed on the CyberMiles blockchain
GNU General Public License v3.0
19 stars 15 forks source link

Whitelist and backlist should be case insensitive #6

Closed juntao closed 5 years ago

juntao commented 5 years ago

We should do upper case comparisons when trying to match addresses to the whitelist or blacklist

Atlasoin commented 5 years ago

filter logic was changed to:

filteredRes = Object.values(response).filter(function(obj){
            var lowerCaseBlacklist = blacklist.map(function (addr) {
              return addr.toLowerCase()
            });
            if(lowerCaseBlacklist.indexOf(obj._source.contractAddress.toLowerCase()) == -1)
                return obj
        })