Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tudor-malene committed Jun 11, 2024
1 parent dc6d518 commit 624b925
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions go/enclave/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -662,23 +662,23 @@ func (s *storageImpl) storeEventLog(ctx context.Context, dbTX *sql.Tx, execTxId
for i := 1; i < len(l.Topics); i++ {
topic := l.Topics[i]
// first check if there is an entry already
eventTopicId, relAddress, err := s.findEventTopic(ctx, dbTX, topic.Bytes())
eventTopicId, relAddressId, err := s.findEventTopic(ctx, dbTX, topic.Bytes())
if err != nil {
if errors.Is(err, errutil.ErrNotFound) {
// check whether the topic is an EOA
relAddress, err = s.findRelevantAddress(ctx, dbTX, topic)
if err != nil {
relAddressId, err = s.findRelevantAddress(ctx, dbTX, topic)
if err != nil && !errors.Is(err, errutil.ErrNotFound) {
return fmt.Errorf("could not find relevant address. Cause %w", err)
}
eventTopicId, err = enclavedb.WriteEventTopic(ctx, dbTX, &topic, relAddress)
eventTopicId, err = enclavedb.WriteEventTopic(ctx, dbTX, &topic, relAddressId)
if err != nil {
return fmt.Errorf("could not write event topic. Cause: %w", err)
}
} else {
return fmt.Errorf("could not find event topic. Cause: %w", err)
}
}
if relAddress != nil {
if relAddressId != nil {
isLifecycle = false
}
topicIds[i-1] = &eventTopicId
Expand Down

0 comments on commit 624b925

Please sign in to comment.