1
0
mirror of https://github.com/oceanprotocol/ocean.js.git synced 2024-11-26 20:39:05 +01:00

Merge pull request #393 from oceanprotocol/feature/fix_searchforDT

make searchforDT lowercase
This commit is contained in:
Alex Coseru 2020-10-22 10:57:49 +03:00 committed by GitHub
commit c8c3c044e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)) {