-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fix/oct-1569' of github.com:golemfoundation/octant into…
… fix/oct-1569
- Loading branch information
Showing
5 changed files
with
124 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
backend/migrations/versions/8e72b01c43a7_update_ppf_after_invalid_calculations_.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
"""Update PPF after invalid calculations for Epoch3 | ||
Revision ID: 8e72b01c43a7 | ||
Revises: fc7a01c20be5 | ||
Create Date: 2024-04-19 00:48:12.133033 | ||
""" | ||
from alembic import op | ||
from decimal import Decimal | ||
|
||
revision = "8e72b01c43a7" | ||
down_revision = "fc7a01c20be5" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
individual_rewards = Decimal( | ||
"146655862334541166188" | ||
) # Got directly from the database for Pending Snapshot in Epoch3 | ||
staking_proceeds = Decimal( | ||
"959848624830407629247" | ||
) # Got directly from the database for Pending Snapshot in Epoch3 | ||
ppf = int(staking_proceeds * Decimal("0.35") - individual_rewards) | ||
|
||
|
||
def upgrade(): | ||
query = f"UPDATE pending_epoch_snapshots SET ppf = '{ppf}' WHERE epoch = 3 AND all_individual_rewards = '{individual_rewards}' AND eth_proceeds = '{staking_proceeds}';" | ||
op.execute(query) | ||
|
||
|
||
def downgrade(): | ||
old_ppf = "335947018690642670236" | ||
|
||
query = f"UPDATE pending_epoch_snapshots SET ppf = '{old_ppf}' WHERE epoch = 3 AND all_individual_rewards = '{individual_rewards}' AND eth_proceeds = '{staking_proceeds}' AND ppf = '{ppf}';" | ||
|
||
print(query, flush=True) | ||
|
||
op.execute(query) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters