Skip to content

Commit 759a36a

Browse files
committed
Rename blocks table
1 parent c0a3cb9 commit 759a36a

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

codegenerator/cli/npm/envio/src/PgStorage.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ let makeInitializeTransaction = (
6565
let generalTables = [
6666
InternalTable.Chains.table,
6767
InternalTable.PersistedState.table,
68-
InternalTable.EndOfBlockRangeScannedData.table,
68+
InternalTable.Blocks.table,
6969
InternalTable.RawEvents.table,
7070
]
7171

codegenerator/cli/npm/envio/src/db/InternalTable.res

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,19 +254,22 @@ module PersistedState = {
254254
)
255255
}
256256

257-
module EndOfBlockRangeScannedData = {
257+
module Blocks = {
258258
type t = {
259-
chain_id: int,
260-
block_number: int,
261-
block_hash: string,
259+
id: bigint,
260+
@as("chain_id")
261+
chainId: int,
262+
number: int,
263+
hash: string,
262264
}
263265

264266
let table = mkTable(
265-
"end_of_block_range_scanned_data",
267+
"envio_blocks",
266268
~fields=[
267-
mkField("chain_id", Integer, ~fieldSchema=S.int, ~isPrimaryKey),
268-
mkField("block_number", Integer, ~fieldSchema=S.int, ~isPrimaryKey),
269-
mkField("block_hash", Text, ~fieldSchema=S.string),
269+
mkField("id", Numeric, ~fieldSchema=S.bigint, ~isPrimaryKey),
270+
mkField("chain_id", Integer, ~fieldSchema=S.int),
271+
mkField("number", Integer, ~fieldSchema=S.int),
272+
mkField("hash", Text, ~fieldSchema=S.string),
270273
],
271274
)
272275
}

codegenerator/cli/templates/static/codegen/src/eventFetching/ChainFetcher.res

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,6 @@ let makeFromDbState = async (
246246
let chainId = chainConfig.id
247247
let logger = Logging.createChild(~params={"chainId": chainId})
248248

249-
// Since we deleted all contracts after the restart point,
250-
// we can simply query all dcs we have in db
251249
let dbRecoveredDynamicContracts =
252250
await sql->DbFunctions.DynamicContractRegistry.readAllDynamicContracts(~chainId)
253251

0 commit comments

Comments
 (0)