Skip to content

Commit 6ee46ce

Browse files
committed
Make relations lowercase to be consistent
1 parent 4c139c0 commit 6ee46ce

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

packages/persistance/prisma/schema.prisma

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ model StateTransitionBatch {
5959
transactionExecutionResult TransactionExecutionResult? @relation(fields: [txExecutionResultId], references: [txHash])
6060
block Block? @relation(fields: [blockId], references: [hash])
6161
blockResult BlockResult? @relation(fields: [blockResultId], references: [blockHash])
62-
StateTransition StateTransition[]
62+
stateTransition StateTransition[]
6363
}
6464

6565
model TransactionExecutionResult {
@@ -72,7 +72,7 @@ model TransactionExecutionResult {
7272
7373
block Block @relation(fields: [blockHash], references: [hash])
7474
blockHash String
75-
StateTransitionBatch StateTransitionBatch[]
75+
stateTransitionBatch StateTransitionBatch[]
7676
}
7777

7878
model Block {
@@ -98,7 +98,7 @@ model Block {
9898
9999
batch Batch? @relation(fields: [batchHeight], references: [height])
100100
batchHeight Int?
101-
StateTransitionBatch StateTransitionBatch[]
101+
stateTransitionBatch StateTransitionBatch[]
102102
}
103103

104104
model Batch {
@@ -122,7 +122,7 @@ model BlockResult {
122122
blockHashWitness Json @db.Json
123123
124124
block Block? @relation(fields: [blockHash], references: [hash])
125-
StateTransitionBatch StateTransitionBatch[]
125+
stateTransitionBatch StateTransitionBatch[]
126126
}
127127

128128
model Settlement {

packages/persistance/src/services/prisma/PrismaBlockStorage.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,23 @@ export class PrismaBlockStorage
5353
transactions: {
5454
include: {
5555
tx: true,
56-
StateTransitionBatch: {
56+
stateTransitionBatch: {
5757
include: {
58-
StateTransition: true,
58+
stateTransition: true,
5959
},
6060
},
6161
},
6262
},
63-
StateTransitionBatch: {
63+
stateTransitionBatch: {
6464
include: {
65-
StateTransition: true,
65+
stateTransition: true,
6666
},
6767
},
6868
result: {
6969
include: {
70-
StateTransitionBatch: {
70+
stateTransitionBatch: {
7171
include: {
72-
StateTransition: true,
72+
stateTransition: true,
7373
},
7474
},
7575
},
@@ -85,15 +85,15 @@ export class PrismaBlockStorage
8585
txresult,
8686
txresult.tx,
8787
]);
88-
const stBatch = txresult.StateTransitionBatch.map<
88+
const stBatch = txresult.stateTransitionBatch.map<
8989
[
9090
Omit<
9191
DBStateTransitionBatch,
9292
"txExecutionResultId" | "id" | "blockId" | "blockResultId"
9393
>,
9494
Omit<DBStateTransition, "batchId" | "id">[],
9595
]
96-
>((batch) => [{ applied: batch.applied }, batch.StateTransition]);
96+
>((batch) => [{ applied: batch.applied }, batch.stateTransition]);
9797
return {
9898
...txExecResult,
9999
stateTransitions: this.stateTransitionBatchMapper.mapIn(stBatch),
@@ -106,7 +106,7 @@ export class PrismaBlockStorage
106106
...this.blockMapper.mapIn(dbResult),
107107
beforeBlockStateTransitions:
108108
// Each block should just have one batch of STs associated with it
109-
dbResult.StateTransitionBatch[0].StateTransition.map((st) =>
109+
dbResult.stateTransitionBatch[0].stateTransition.map((st) =>
110110
this.stateTransitionMapper.mapIn(st)
111111
),
112112
transactions,
@@ -116,7 +116,7 @@ export class PrismaBlockStorage
116116
...this.blockResultMapper.mapIn(dbResult.result),
117117
afterBlockStateTransitions:
118118
// Each block should just have one batch of STs assoicated with it
119-
dbResult.StateTransitionBatch[0].StateTransition.map((st) =>
119+
dbResult.stateTransitionBatch[0].stateTransition.map((st) =>
120120
this.stateTransitionMapper.mapIn(st)
121121
),
122122
}
@@ -219,7 +219,7 @@ export class PrismaBlockStorage
219219
data: {
220220
afterNetworkState: encoded.afterNetworkState as Prisma.InputJsonValue,
221221
blockHashWitness: encoded.blockHashWitness as Prisma.InputJsonValue,
222-
StateTransitionBatch: {
222+
stateTransitionBatch: {
223223
create: batches.map(([stBatch, sts]) => {
224224
return {
225225
...stBatch,
@@ -291,23 +291,23 @@ export class PrismaBlockStorage
291291
transactions: {
292292
include: {
293293
tx: true,
294-
StateTransitionBatch: {
294+
stateTransitionBatch: {
295295
include: {
296-
StateTransition: true,
296+
stateTransition: true,
297297
},
298298
},
299299
},
300300
},
301-
StateTransitionBatch: {
301+
stateTransitionBatch: {
302302
include: {
303-
StateTransition: true,
303+
stateTransition: true,
304304
},
305305
},
306306
result: {
307307
include: {
308-
StateTransitionBatch: {
308+
stateTransitionBatch: {
309309
include: {
310-
StateTransition: true,
310+
stateTransition: true,
311311
},
312312
},
313313
},
@@ -325,15 +325,15 @@ export class PrismaBlockStorage
325325
txresult,
326326
txresult.tx,
327327
]);
328-
const stBatch = txresult.StateTransitionBatch.map<
328+
const stBatch = txresult.stateTransitionBatch.map<
329329
[
330330
Omit<
331331
DBStateTransitionBatch,
332332
"txExecutionResultId" | "id" | "blockId" | "blockResultId"
333333
>,
334334
Omit<DBStateTransition, "batchId" | "id">[],
335335
]
336-
>((batch) => [{ applied: batch.applied }, batch.StateTransition]);
336+
>((batch) => [{ applied: batch.applied }, batch.stateTransition]);
337337
return {
338338
...txExecResult,
339339
stateTransitions: this.stateTransitionBatchMapper.mapIn(stBatch),
@@ -355,14 +355,14 @@ export class PrismaBlockStorage
355355
block: {
356356
...decodedBlock,
357357
beforeBlockStateTransitions:
358-
block.StateTransitionBatch[0].StateTransition.map((st) =>
358+
block.stateTransitionBatch[0].stateTransition.map((st) =>
359359
this.stateTransitionMapper.mapIn(st)
360360
),
361361
},
362362
result: {
363363
...this.blockResultMapper.mapIn(result),
364364
afterBlockStateTransitions:
365-
result.StateTransitionBatch[0].StateTransition.map((st) =>
365+
result.stateTransitionBatch[0].stateTransition.map((st) =>
366366
this.stateTransitionMapper.mapIn(st)
367367
),
368368
},

0 commit comments

Comments
 (0)