@@ -32,7 +32,12 @@ import { getUser } from './utils/userUtils'
32
32
export function handleJoin ( event : LOG_JOIN ) : void {
33
33
const pool = getPool ( event . address . toHex ( ) )
34
34
const user = getUser ( event . params . caller . toHex ( ) )
35
- const poolTx = getPoolTransaction ( event , user . id , PoolTransactionType . JOIN )
35
+ const poolTx = getPoolTransaction (
36
+ event ,
37
+ user . id ,
38
+ PoolTransactionType . JOIN ,
39
+ event . logIndex
40
+ )
36
41
37
42
pool . transactionCount = pool . transactionCount . plus ( integer . ONE )
38
43
pool . joinCount = pool . joinCount . plus ( integer . ONE )
@@ -72,7 +77,12 @@ export function handleJoin(event: LOG_JOIN): void {
72
77
export function handleExit ( event : LOG_EXIT ) : void {
73
78
const pool = getPool ( event . address . toHex ( ) )
74
79
const user = getUser ( event . params . caller . toHex ( ) )
75
- const poolTx = getPoolTransaction ( event , user . id , PoolTransactionType . EXIT )
80
+ const poolTx = getPoolTransaction (
81
+ event ,
82
+ user . id ,
83
+ PoolTransactionType . EXIT ,
84
+ event . logIndex
85
+ )
76
86
77
87
pool . transactionCount = pool . transactionCount . plus ( integer . ONE )
78
88
pool . joinCount = pool . joinCount . plus ( integer . ONE )
@@ -109,7 +119,12 @@ export function handleExit(event: LOG_EXIT): void {
109
119
export function handleSwap ( event : LOG_SWAP ) : void {
110
120
const pool = getPool ( event . address . toHex ( ) )
111
121
const user = getUser ( event . params . caller . toHex ( ) )
112
- const poolTx = getPoolTransaction ( event , user . id , PoolTransactionType . SWAP )
122
+ const poolTx = getPoolTransaction (
123
+ event ,
124
+ user . id ,
125
+ PoolTransactionType . SWAP ,
126
+ event . logIndex
127
+ )
113
128
114
129
pool . transactionCount = pool . transactionCount . plus ( integer . ONE )
115
130
pool . joinCount = pool . joinCount . plus ( integer . ONE )
@@ -227,7 +242,8 @@ export function handleSetup(event: LOG_SETUP): void {
227
242
const poolTx = getPoolTransaction (
228
243
event ,
229
244
fromUser . id ,
230
- PoolTransactionType . SETUP
245
+ PoolTransactionType . SETUP ,
246
+ event . logIndex
231
247
)
232
248
poolTx . type = PoolTransactionType . SETUP
233
249
poolTx . baseToken = token . id
@@ -259,7 +275,12 @@ export function handlerBptTransfer(event: Transfer): void {
259
275
const toAddress = event . params . dst . toHexString ( )
260
276
const poolAddress = event . address . toHex ( )
261
277
const caller = getUser ( event . transaction . from . toHex ( ) )
262
- const poolTx = getPoolTransaction ( event , caller . id , PoolTransactionType . SWAP )
278
+ const poolTx = getPoolTransaction (
279
+ event ,
280
+ caller . id ,
281
+ PoolTransactionType . SWAP ,
282
+ event . logIndex
283
+ )
263
284
264
285
// btoken has 18 decimals
265
286
const ammount = weiToDecimal ( event . params . amt . toBigDecimal ( ) , 18 )
0 commit comments