-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store timestamp of block alongside redeemed tickets #372
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThis pull request makes three changes. It adds a new entry in the Changes
Sequence Diagram(s)sequenceDiagram
participant Event as Block Event
participant Handler as handleTicketRedeemed
participant Ticket as Ticket Creation
Event ->> Handler: Ticket redeemed event
Handler ->> Ticket: Create ticket & assign timestamp = event.block.timestamp
Tip 🌐 Web search-backed reviews and chat
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.gitignore
(1 hunks)subgraph/packages/subgraph-channel/schema.graphql
(1 hunks)subgraph/packages/subgraph-channel/src/mapping.ts
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- .gitignore
@@ -99,6 +99,7 @@ export function handleTicketRedeemed(event: TicketRedeemed): void { | |||
ticket.amount = convertEthToDecimal(event.params.amount) | |||
ticket.winProb = event.params.winProb | |||
ticket.signature = event.params.signature | |||
ticket.timestamp = event.block.timestamp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix field name mismatch with schema.
The field name in the schema is misspelled as timetstamp
, but here we're using timestamp
. This mismatch will cause runtime errors.
Apply one of these diffs to fix the field name mismatch:
Option 1 (preferred) - Fix the schema field name:
// In schema.graphql
- timetstamp: BigInt!
+ timestamp: BigInt!
Option 2 - Match the misspelled schema field name:
- ticket.timestamp = event.block.timestamp
+ ticket.timetstamp = event.block.timestamp
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
ticket.timestamp = event.block.timestamp | |
ticket.timetstamp = event.block.timestamp |
@@ -44,6 +44,7 @@ type Ticket @entity { | |||
amount: BigDecimal! | |||
winProb: BigInt! | |||
signature: Bytes! | |||
timetstamp: BigInt! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typo in field name.
The field name has a typo: timetstamp
should be timestamp
.
Apply this diff to fix the typo:
- timetstamp: BigInt!
+ timestamp: BigInt!
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
timetstamp: BigInt! | |
timestamp: BigInt! |
Summary by CodeRabbit
New Features
Chores