-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(hubpool): set pool rebalance route for token mappings (#49)
Signed-off-by: james-a-morris <jaamorris@cs.stonybrook.edu>
- Loading branch information
1 parent
00e747f
commit fdf9b44
Showing
9 changed files
with
10,294 additions
and
7,441 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
42 changes: 42 additions & 0 deletions
42
packages/indexer-database/src/entities/evm/SetPoolRebalanceRoute.ts
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,42 @@ | ||
import { | ||
Column, | ||
CreateDateColumn, | ||
Entity, | ||
PrimaryGeneratedColumn, | ||
Unique, | ||
} from "typeorm"; | ||
|
||
@Entity({ schema: "evm" }) | ||
@Unique("UK_setPoolRebalanceRoute_transactionHash_transactionIndex_logIndex", [ | ||
"transactionHash", | ||
"transactionIndex", | ||
"logIndex", | ||
]) | ||
export class SetPoolRebalanceRoute { | ||
@PrimaryGeneratedColumn() | ||
id: number; | ||
|
||
@Column({ nullable: false }) | ||
destinationChainId: number; | ||
|
||
@Column({ nullable: false }) | ||
l1Token: string; | ||
|
||
@Column({ nullable: false }) | ||
destinationToken: string; | ||
|
||
@Column({ nullable: false }) | ||
blockNumber: number; | ||
|
||
@Column({ nullable: false }) | ||
transactionHash: string; | ||
|
||
@Column({ nullable: false }) | ||
transactionIndex: number; | ||
|
||
@Column({ nullable: false }) | ||
logIndex: number; | ||
|
||
@CreateDateColumn() | ||
createdAt: Date; | ||
} |
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
28 changes: 28 additions & 0 deletions
28
packages/indexer-database/src/migrations/1727374473839-SetPoolRebalanceRoute.ts
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,28 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm"; | ||
|
||
export class SetPoolRebalanceRoute1727374473839 implements MigrationInterface { | ||
name = "SetPoolRebalanceRoute1727374473839"; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`CREATE TABLE "evm"."set_pool_rebalance_route" ( | ||
"id" SERIAL NOT NULL, | ||
"destinationChainId" integer NOT NULL, | ||
"l1Token" character varying NOT NULL, | ||
"destinationToken" character varying NOT NULL, | ||
"blockNumber" integer NOT NULL, | ||
"transactionHash" character varying NOT NULL, | ||
"transactionIndex" integer NOT NULL, | ||
"logIndex" integer NOT NULL, | ||
"createdAt" TIMESTAMP NOT NULL DEFAULT now(), | ||
CONSTRAINT "UK_setPoolRebalanceRoute_transactionHash_transactionIndex_logIndex" UNIQUE ("transactionHash", "transactionIndex", "logIndex"), | ||
CONSTRAINT "PK_93edcf0d94f29e5cd34513baf9d" PRIMARY KEY ("id") | ||
) | ||
`, | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`DROP TABLE "evm"."set_pool_rebalance_route"`); | ||
} | ||
} |
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
Oops, something went wrong.