-
Notifications
You must be signed in to change notification settings - Fork 3
feat: increase delegated stakes #205
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,9 +47,9 @@ const delegateStakeCreateResponse = (event) => ({ | |
| ordinal: event.ordinal, | ||
| source: event.source_addr, | ||
| nodeId: event.node_id, | ||
| amount: event.amount, | ||
| amount: event.current_amount ?? event.amount, | ||
| fee: event.fee, | ||
| tokenLockHash: event.lock_reference_hash, | ||
| tokenLockHash: event.current_token_lock_hash ?? event.lock_reference_hash, | ||
| parentHash: event.parent_hash, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This applies the effective I think you need the same null-coalescing pattern in currentTokenLockHash: event.current_token_lock_hash ?? event.lock_reference_hash, // or however the field maps
currentAmount: event.current_amount ?? event.amount,(Though note the column naming issue -- see my comment on snapshot-streaming PR #114 re: |
||
| type: event.transfer_from_hash ? "transfer" : "create", | ||
| status: stakeStatus(event), | ||
|
|
@@ -92,7 +92,7 @@ const delegateStakePositionResponse = (change) => { | |
| nodeId: change.node_id, | ||
| status: stakeStatus(change), | ||
| stakeHash: change.hash, | ||
| lockAmount: change.amount, | ||
| lockAmount: change.current_amount ?? change.amount, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| rewardsAccrued: | ||
| change.delegate_stake_total_rewards?.delegate_stake_total_rewards ?? 0, | ||
| withdrawnAmount: completedAmount(change), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
|
|
||
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.
re: the column name -- snapshot-streaming PR #114 creates this column as
current_lock_reference_hashin the SQL schema (sql/delegated_staking.sql), notcurrent_token_lock_hash. These need to be aligned or the Prisma client won't find the data that snapshot-streaming writes. Same issue for thedelegate_stake_withdraw_eventstable below and thereplacement_hashondag_token_locks(which SS callsreplace_token_lock_ref).I'd suggest coordinating with the SS PR author on a single naming convention. The tessellation Scala types use
currentTokenLockRefonDelegatedStakeRecordandreplaceTokenLockRefonTokenLock, socurrent_token_lock_hashandreplace_token_lock_refmight be reasonable compromises -- but the important thing is they match across repos.