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

fix getOrderHistory

This commit is contained in:
alexcos20 2020-10-20 05:52:40 -07:00
parent 75c04539fa
commit c1a0345e3e

View File

@ -598,11 +598,13 @@ export class Assets extends Instantiable {
const address = account.getId().toLowerCase() const address = account.getId().toLowerCase()
const { datatokens } = this.ocean const { datatokens } = this.ocean
const topic1 = '0x000000000000000000000000' + address.substring(2) const topic1 = '0x000000000000000000000000' + address.substring(2)
const topic0 = datatokens.getStartOrderEventSignature()
const events = await this.web3.eth.getPastLogs({ const events = await this.web3.eth.getPastLogs({
topics: [[datatokens.getStartOrderEventSignature(), null, topic1]], topics: [topic0, null, topic1],
fromBlock: fromBlock || 0, fromBlock: fromBlock || 0,
toBlock: 'latest' toBlock: 'latest'
}) })
for (let i = 0; i < events.length; i++) { for (let i = 0; i < events.length; i++) {
const order: Order = { const order: Order = {
dtAddress: events[i].address, dtAddress: events[i].address,