Skip to content

Commit

Permalink
Fix: update defi lama column
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Dec 13, 2024
1 parent fe01c99 commit 475d4c5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/storage/postgres/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,9 @@ func (tx Transaction) UpdateRollup(ctx context.Context, rollup *models.Rollup) e
if rollup.VM != "" {
query = query.Set("vm = ?", rollup.VM)
}
if rollup.DeFiLama != "" {
query = query.Set("defi_lama = ?", rollup.DeFiLama)
}

_, err := query.Exec(ctx)
return err
Expand Down
2 changes: 2 additions & 0 deletions internal/storage/postgres/transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,7 @@ func (s *TransactionTestSuite) TestSaveUpdateAndDeleteRollup() {
s.Require().Greater(rollup.Id, uint64(0))

rollup.GitHub = "https://github.com/rollup2"
rollup.DeFiLama = "test"
err = tx.UpdateRollup(ctx, rollup)
s.Require().NoError(err)

Expand All @@ -774,6 +775,7 @@ func (s *TransactionTestSuite) TestSaveUpdateAndDeleteRollup() {
s.Require().EqualValues(testLink, newRollup.L2Beat)
s.Require().EqualValues(testLink, newRollup.Explorer)
s.Require().EqualValues(testLink, newRollup.BridgeContract)
s.Require().EqualValues("test", newRollup.DeFiLama)
s.Require().EqualValues("stack", newRollup.Stack)
s.Require().Len(newRollup.Links, 1)

Expand Down
3 changes: 3 additions & 0 deletions test/data/rollup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
category: finance
stack: OP Stack
type: settled
defi_lama: defi
- id: 2
name: Rollup 2
description: The second
Expand All @@ -20,6 +21,7 @@
category: gaming
stack: OP Stack
type: settled
defi_lama: lama
- id: 3
name: Rollup 3
description: The third
Expand All @@ -31,3 +33,4 @@
category: nft
stack: Custom Stack
type: sovereign
defi_lama: name

0 comments on commit 475d4c5

Please sign in to comment.