-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
214 additions
and
58 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
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,21 @@ | ||
from typing import List | ||
|
||
from ..indexer.utils import CostInfo | ||
from ..indexer.base_db import BaseDB | ||
|
||
|
||
class CostsDB(BaseDB): | ||
def __init__(self): | ||
BaseDB.__init__(self, 'solana_neon_transactions_costs') | ||
|
||
def add_costs(self, tx_costs: List[CostInfo]): | ||
rows = [] | ||
for cost_info in tx_costs: | ||
rows.append(tuple(cost_info)) | ||
|
||
with self._conn.cursor() as cursor: | ||
cursor.executemany(f''' | ||
INSERT INTO solana_neon_transactions_costs | ||
(sol_sign, operator, heap_size, bpf_instructions, sol_cost, neon_income) | ||
VALUES(%s, %s, %s, %s, %s, %s) ON CONFLICT DO NOTHING''', | ||
rows) |
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
Oops, something went wrong.