Skip to content

Merge pull request #593 from klever-io/chore/remove-sc-24h-txs (#594)#595

Merged
samufacanha2 merged 1 commit intomasterfrom
staging
Mar 4, 2026
Merged

Merge pull request #593 from klever-io/chore/remove-sc-24h-txs (#594)#595
samufacanha2 merged 1 commit intomasterfrom
staging

Conversation

@samufacanha2
Copy link
Contributor

@samufacanha2 samufacanha2 commented Mar 4, 2026

chore: remove sc 24h txs

Summary by CodeRabbit

  • Bug Fixes

    • Removed 24h variation indicator from smart contract data cards
  • Refactor

    • Updated transaction data calculation methodology for improved accuracy

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 4, 2026

Walkthrough

The changes remove a 24-hour variation indicator from the smart contract data card UI and refactor the backend transaction statistics request, replacing relative timestamp parameters with absolute ISO-formatted timestamps and updating how transaction count values are computed from API responses.

Changes

Cohort / File(s) Summary
UI Updates
src/pages/smart-contract/[address].tsx
Removed conditional rendering of DataCardLatest with ArrowData indicator displaying 24-hour variation data.
Service Layer Refactoring
src/services/requests/smartContracts/index.ts
Updated query parameter from relative startDate: '-24h' to absolute ISO timestamp; changed beforeYesterdayTxs computation from number_by_day[1]?.doc_count to res.pagination?.totalRecords; removed conditional logic deriving newTransactions from number_by_day data.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

A rabbit hops through code so bright,
Removing stats that aren't quite right,
With cleaner queries, fresh and new,
We bid adieu to yesterday's view,
The data flows in ISO light! 🐰✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: removing 24-hour transaction data from smart contract pages, as evidenced by UI element removal and backend query modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch staging

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 0.46%. Comparing base (d0fbd32) to head (03d7c69).
⚠️ Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
src/services/requests/smartContracts/index.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master    #595   +/-   ##
======================================
  Coverage    0.46%   0.46%           
======================================
  Files         530     530           
  Lines       20954   20951    -3     
  Branches     5253    5280   +27     
======================================
  Hits           97      97           
+ Misses      20044   20042    -2     
+ Partials      813     812    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/services/requests/smartContracts/index.ts (1)

160-163: beforeYesterdayTxs naming no longer matches the current data semantics.

With a last-24h filter in the query, beforeYesterdayTxs now reads as a last-day count. Consider renaming the field (and callers) to avoid misleading downstream usage.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/services/requests/smartContracts/index.ts` around lines 160 - 163, The
field name beforeYesterdayTxs on the returned data object no longer matches its
semantics (it holds a last-24h count); rename this property to a clear name like
last24hTxs (or lastDayTxs) wherever it is produced (the data const in the
function that builds the response) and update all callers, types/interfaces, and
tests that reference beforeYesterdayTxs to use the new name (ensure you update
any destructuring, mapping, or serialization code that expects the old
property).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/services/requests/smartContracts/index.ts`:
- Around line 153-155: The name smartContractBeforeYesterdayTransactionsCall and
variable beforeYesterdayTxs are semantically incorrect because the filter uses
Date.now() - 24*60*60*1000 (last 24 hours); rename the function and variable to
reflect the actual window (e.g., smartContractLast24hTransactionsCall and
last24hTxs or smartContractYesterdayTransactionsCall and yesterdayTxs), update
all usages/exports/imports/tests accordingly, and keep the startdate calculation
as-is so names match the implemented time range.

---

Nitpick comments:
In `@src/services/requests/smartContracts/index.ts`:
- Around line 160-163: The field name beforeYesterdayTxs on the returned data
object no longer matches its semantics (it holds a last-24h count); rename this
property to a clear name like last24hTxs (or lastDayTxs) wherever it is produced
(the data const in the function that builds the response) and update all
callers, types/interfaces, and tests that reference beforeYesterdayTxs to use
the new name (ensure you update any destructuring, mapping, or serialization
code that expects the old property).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 02d32754-c2ae-42e9-8773-db43ff9fee12

📥 Commits

Reviewing files that changed from the base of the PR and between 9c9e75f and 03d7c69.

📒 Files selected for processing (2)
  • src/pages/smart-contract/[address].tsx
  • src/services/requests/smartContracts/index.ts
💤 Files with no reviewable changes (1)
  • src/pages/smart-contract/[address].tsx

@samufacanha2 samufacanha2 merged commit 2bbe2ee into master Mar 4, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants