-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update * update docs * fix test * fix fee receiver addr * fix test * add rescue endpoint * update doc * bump * save router info to db on shouldRoute * update * fix docker build * bump v1.9.0-3 * update doc * polish * fix ci * dump docker logs on failure * test * test * update * update * update * test magic * update * update * try self hosted machine * test * test * saveRouterInfo api * magic * test WIP * polish * update * fix flow * update tests
- Loading branch information
1 parent
b0adda0
commit b597f69
Showing
26 changed files
with
435 additions
and
32 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
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
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,15 @@ | ||
-- CreateTable | ||
CREATE TABLE "RouterInfo" ( | ||
"id" SERIAL NOT NULL, | ||
"timestamp" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"params" TEXT NOT NULL, | ||
"factoryAddr" TEXT NOT NULL, | ||
"feeAddr" TEXT NOT NULL, | ||
"recipient" TEXT NOT NULL, | ||
"routerAddr" TEXT NOT NULL, | ||
|
||
CONSTRAINT "RouterInfo_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "RouterInfo_routerAddr_key" ON "RouterInfo"("routerAddr"); |
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,3 @@ | ||
# Please do not edit this file manually | ||
# It should be added in your version-control system (i.e. Git) | ||
provider = "postgresql" |
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,18 @@ | ||
generator client { | ||
provider = "prisma-client-js" | ||
} | ||
|
||
datasource db { | ||
provider = "postgresql" | ||
url = env("DATABASE_URL") | ||
} | ||
|
||
model RouterInfo { | ||
id Int @id @default(autoincrement()) | ||
timestamp DateTime @default(now()) | ||
params String // stringified JSON | ||
factoryAddr String | ||
feeAddr String | ||
recipient String | ||
routerAddr String @unique | ||
} |
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
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,19 @@ | ||
import { CHAIN_ID_ACALA } from '@certusone/wormhole-sdk'; | ||
|
||
import { RouterInfoQuery, RouterInfoUpdate, getChainConfig } from '../utils'; | ||
import { db } from '../db'; | ||
|
||
export const getRouterInfo = async (params: RouterInfoQuery) => { | ||
return await db.getRouterInfo(params); | ||
}; | ||
|
||
export const saveRouterInfo = async (params: RouterInfoUpdate) => { | ||
// only supports pool 7 on Acala for now | ||
const { feeAddr, dropAndSwapStakeFactoryAddr } = await getChainConfig(CHAIN_ID_ACALA); | ||
|
||
return await db.upsertRouterInfo({ | ||
...params, | ||
feeAddr: feeAddr!, | ||
factoryAddr: dropAndSwapStakeFactoryAddr!, | ||
}); | ||
}; |
Oops, something went wrong.