From 719180bce4d66fa7ff08b131820c0a21c5034b55 Mon Sep 17 00:00:00 2001 From: akaster99 Date: Wed, 20 Sep 2023 14:15:04 +0900 Subject: [PATCH 1/3] fix: add internal --- src/ainize.ts | 3 +++ src/internal.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ainize.ts b/src/ainize.ts index ae8550f..48bc161 100644 --- a/src/ainize.ts +++ b/src/ainize.ts @@ -6,11 +6,13 @@ import AppController from "./controllers/appController"; import Model from "./model"; import { deployConfig } from "./types/type"; import AinModule from "./ain"; +import Internal from "./internal"; export default class Ainize { private cache: NodeCache; ain: AinModule = AinModule.getInstance(); private handler: Handler = Handler.getInstance(); middleware: Middleware; + internal: Internal; appController: AppController = AppController.getInstance(); constructor(chainId: 1 | 0) { @@ -18,6 +20,7 @@ export default class Ainize { this.handler.connect(); this.cache = new NodeCache(); this.middleware = new Middleware(this.cache); + this.internal = new Internal(); } static createAinAccount () { diff --git a/src/internal.ts b/src/internal.ts index 1ae9b53..639521d 100644 --- a/src/internal.ts +++ b/src/internal.ts @@ -5,7 +5,7 @@ import { HISTORY_TYPE, RESPONSE_STATUS, deposit, request, response } from "./typ import { buildTxBody } from "./utils/builder"; import AinModule from "./ain"; -export default class internal { +export default class Internal { private ain = AinModule.getInstance(); async handleDeposit(req: Request) { const { requesterAddress, appName, transferKey, transferValue } = this.getDataFromDepositRequest(req); From 625ea5ec6fc600642d6046e5ae58f854d2ca33f5 Mon Sep 17 00:00:00 2001 From: akaster99 Date: Wed, 20 Sep 2023 14:22:33 +0900 Subject: [PATCH 2/3] refactor: space --- src/ainize.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ainize.ts b/src/ainize.ts index 48bc161..ee0dab5 100644 --- a/src/ainize.ts +++ b/src/ainize.ts @@ -7,10 +7,11 @@ import Model from "./model"; import { deployConfig } from "./types/type"; import AinModule from "./ain"; import Internal from "./internal"; + export default class Ainize { private cache: NodeCache; - ain: AinModule = AinModule.getInstance(); private handler: Handler = Handler.getInstance(); + ain: AinModule = AinModule.getInstance(); middleware: Middleware; internal: Internal; appController: AppController = AppController.getInstance(); From b8b1b2f067524958a01315359c6c833bae21b1ef Mon Sep 17 00:00:00 2001 From: akaster99 Date: Wed, 20 Sep 2023 14:23:15 +0900 Subject: [PATCH 3/3] refactor: space --- src/internal.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/internal.ts b/src/internal.ts index 639521d..1fa53c3 100644 --- a/src/internal.ts +++ b/src/internal.ts @@ -7,6 +7,7 @@ import AinModule from "./ain"; export default class Internal { private ain = AinModule.getInstance(); + async handleDeposit(req: Request) { const { requesterAddress, appName, transferKey, transferValue } = this.getDataFromDepositRequest(req); const ops: SetOperation[] = [];