Skip to content

Commit bfdc0fa

Browse files
evgen-povtfjl
authored andcommitted
mobile: fix FilterLogs (#15418)
All logs in the FilterLog return value would be the same object because the for loop captured the pointer to the iteration variable.
1 parent 9f7cd75 commit bfdc0fa

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎mobile/ethclient.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ func (ec *EthereumClient) FilterLogs(ctx *Context, query *FilterQuery) (logs *Lo
198198
}
199199
// Temp hack due to vm.Logs being []*vm.Log
200200
res := make([]*types.Log, len(rawLogs))
201-
for i, log := range rawLogs {
202-
res[i] = &log
201+
for i := range rawLogs {
202+
res[i] = &rawLogs[i]
203203
}
204204
return &Logs{res}, nil
205205
}

0 commit comments

Comments
 (0)