Skip to content

Commit

Permalink
chore(evm-reader): Update log for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
fmoura committed Aug 27, 2024
1 parent 6de3789 commit 1eab387
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions internal/evmreader/evmreader.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func (r *EvmReader) watchForNewBlocks(ctx context.Context, ready chan<- struct{}
// Check if is there new Inputs for all running Applications
func (r *EvmReader) checkForNewInputs(ctx context.Context) error {

slog.Info("Checking for new inputs")
slog.Debug("Checking for new inputs")

// Get All Applications
apps, err := r.repository.GetAllRunningApplications(ctx)
Expand Down Expand Up @@ -411,7 +411,6 @@ func (r *EvmReader) readAndStoreInputs(
}
}

// Store everything
_, _, err = r.repository.StoreEpochAndInputsTransaction(
ctx,
epochInputMap,
Expand All @@ -426,12 +425,19 @@ func (r *EvmReader) readAndStoreInputs(
continue
}

slog.Info("Inputs and epochs stored successfully",
"app", address,
"start-block", startBlock,
"end-block", endBlock,
"total inputs", len(inputs),
)
// Store everything
if len(epochInputMap) > 0 {

slog.Debug("Inputs and epochs stored successfully",
"app", address,
"start-block", startBlock,
"end-block", endBlock,
"total epochs", len(epochInputMap),
"total inputs", len(inputs),
)
} else {
slog.Debug("No inputs or epochs to store")
}

}

Expand Down Expand Up @@ -530,11 +536,6 @@ func (r *EvmReader) readInputsFromBlockchain(
startBlock, endBlock uint64,
) (map[Address][]*Input, error) {

slog.Info("Reading inputs",
"apps", appsAddresses,
"start", startBlock,
"end", endBlock)

// Initialize app input map
var appInputsMap = make(map[Address][]*Input)
for _, appsAddress := range appsAddresses {
Expand Down

0 comments on commit 1eab387

Please sign in to comment.