Skip to content

Commit

Permalink
Merge pull request #393 from oceanprotocol/feature/fix_searchforDT
Browse files Browse the repository at this point in the history
make searchforDT lowercase
  • Loading branch information
alexcos20 authored Oct 22, 2020
2 parents 285d6c9 + 4e949e9 commit c8c3c04
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/exchange/FixedRateExchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,14 +376,17 @@ export class OceanFixedRateExchange {
): Promise<FixedPriceExchange[]> {
const result: FixedPriceExchange[] = []
const events = await this.contract.getPastEvents('ExchangeCreated', {
filter: { datatoken: dataTokenAddress },
filter: { datatoken: dataTokenAddress.toLowerCase() },
fromBlock: 0,
toBlock: 'latest'
})
for (let i = 0; i < events.length; i++) {
const constituents = await this.getExchange(events[i].returnValues[0])
constituents.exchangeID = events[i].returnValues[0]
if (constituents.active === true && constituents.dataToken === dataTokenAddress) {
if (
constituents.active === true &&
constituents.dataToken.toLowerCase() === dataTokenAddress.toLowerCase()
) {
const supply = new BigNumber(await this.getSupply(constituents.exchangeID))
const required = new BigNumber(minSupply)
if (supply.gte(required)) {
Expand Down

0 comments on commit c8c3c04

Please sign in to comment.