mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
debug
This commit is contained in:
parent
a2fbbb3765
commit
bad9f6641e
@ -438,31 +438,33 @@ export class OceanPool extends Pool {
|
|||||||
const results: PoolTransaction[] = []
|
const results: PoolTransaction[] = []
|
||||||
const pool = new this.web3.eth.Contract(this.poolABI, poolAddress)
|
const pool = new this.web3.eth.Contract(this.poolABI, poolAddress)
|
||||||
const dtAddress = await this.getDTAddress(poolAddress)
|
const dtAddress = await this.getDTAddress(poolAddress)
|
||||||
const myFilter: Filter = account ? { caller: account } : {}
|
const filter: Filter = account ? { caller: account } : {}
|
||||||
let events: EventData[]
|
let events: EventData[]
|
||||||
|
|
||||||
events = await pool.getPastEvents('LOG_SWAP', {
|
events = await pool.getPastEvents('LOG_SWAP', {
|
||||||
filter: myFilter,
|
filter,
|
||||||
fromBlock: 0,
|
fromBlock: 0,
|
||||||
toBlock: 'latest'
|
toBlock: 'latest'
|
||||||
})
|
})
|
||||||
|
|
||||||
for (let i = 0; i < events.length; i++) {
|
for (let i = 0; i < events.length; i++) {
|
||||||
if (!account || events[i].returnValues[0].toLowerCase() === account.toLowerCase())
|
if (!account || events[i].returnValues[0].toLowerCase() === account.toLowerCase())
|
||||||
results.push(await this.getEventData('swap', poolAddress, dtAddress, events[i]))
|
results.push(await this.getEventData('swap', poolAddress, dtAddress, events[i]))
|
||||||
}
|
}
|
||||||
|
|
||||||
events = await pool.getPastEvents('LOG_JOIN', {
|
events = await pool.getPastEvents('LOG_JOIN', {
|
||||||
filter: myFilter,
|
filter,
|
||||||
fromBlock: 0,
|
fromBlock: 0,
|
||||||
toBlock: 'latest'
|
toBlock: 'latest'
|
||||||
})
|
})
|
||||||
|
console.log(events)
|
||||||
for (let i = 0; i < events.length; i++) {
|
for (let i = 0; i < events.length; i++) {
|
||||||
if (!account || events[i].returnValues[0].toLowerCase() === account.toLowerCase())
|
if (!account || events[i].returnValues[0].toLowerCase() === account.toLowerCase())
|
||||||
results.push(await this.getEventData('join', poolAddress, dtAddress, events[i]))
|
results.push(await this.getEventData('join', poolAddress, dtAddress, events[i]))
|
||||||
}
|
}
|
||||||
|
|
||||||
events = await pool.getPastEvents('LOG_EXIT', {
|
events = await pool.getPastEvents('LOG_EXIT', {
|
||||||
filter: myFilter,
|
filter,
|
||||||
fromBlock: 0,
|
fromBlock: 0,
|
||||||
toBlock: 'latest'
|
toBlock: 'latest'
|
||||||
})
|
})
|
||||||
@ -487,6 +489,7 @@ export class OceanPool extends Pool {
|
|||||||
fromBlock: 0,
|
fromBlock: 0,
|
||||||
toBlock: 'latest'
|
toBlock: 'latest'
|
||||||
})
|
})
|
||||||
|
console.log(events)
|
||||||
for (let i = 0; i < events.length; i++) {
|
for (let i = 0; i < events.length; i++) {
|
||||||
const logs = await this.getPoolLogs(events[i].returnValues[0], account)
|
const logs = await this.getPoolLogs(events[i].returnValues[0], account)
|
||||||
for (let j = 0; j < logs.length; j++) results.push(logs[j])
|
for (let j = 0; j < logs.length; j++) results.push(logs[j])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user