Skip to content

Commit

Permalink
fix(cactus-example-discounted-asset-trade): enable
Browse files Browse the repository at this point in the history
...tsconfig strict flag and fix all the warnings

- Fixed all warnings when strict flag is enabled

Closes: hyperledger-cacti#2145

Signed-off-by: Tomasz Awramski <[email protected]>
  • Loading branch information
rwat17 committed Sep 16, 2022
1 parent ee99c87 commit 2652dfd
Show file tree
Hide file tree
Showing 21 changed files with 431 additions and 431 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@ import {
VerifierFactoryConfig,
} from "@hyperledger/cactus-verifier-client";

const fs = require("fs");
const path = require("path");
const config: any = ConfigUtil.getConfig();
const config: any = ConfigUtil.getConfig() as any;
import { getLogger } from "log4js";
const moduleName = "BalanceManagement";
const logger = getLogger(`${moduleName}`);
logger.level = config.logLevel;

export class BalanceManagement {
private connectInfo: LPInfoHolder = null; // connection information
private connectInfo: LPInfoHolder | null = null; // connection information
private readonly verifierFactory: VerifierFactory;

constructor() {
Expand All @@ -32,19 +30,18 @@ export class BalanceManagement {
);
}

getBalance(account: string): Promise<any> {
getBalance(
account: string,
): Promise<{
status: number;
amount: number;
}> {
return new Promise((resolve, reject) => {
// for LedgerOperation
// const execData = {"referedAddress": account};
// const ledgerOperation: LedgerOperation = new LedgerOperation("getNumericBalance", "", execData);

// for Neo
const contract = {}; // NOTE: Since contract does not need to be specified, specify an empty object.
const method = { type: "web3Eth", command: "getBalance" };
const template = "default";
const args = { args: [account] };
// const method = "default";
// const args = {"method": {type: "web3Eth", command: "getBalance"},"args": {"args": [account]}};

this.verifierFactory
.getVerifier("84jUisrs")
Expand Down
6 changes: 3 additions & 3 deletions examples/cactus-example-discounted-asset-trade/balance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import { ConfigUtil } from "@hyperledger/cactus-cmd-socketio-server";
import { RIFError } from "@hyperledger/cactus-cmd-socketio-server";
import { BalanceManagement } from "./balance-management";

const fs = require("fs");
const path = require("path");
const config: any = ConfigUtil.getConfig();
import { getLogger } from "log4js";
const moduleName = "balance";
Expand All @@ -35,7 +33,9 @@ router.get("/:account", (req: Request, res: Response, next: NextFunction) => {
logger.error(err);
});
} catch (err) {
logger.error(`##err name: ${err.constructor.name}`);
if (err instanceof Error) {
logger.error(`##err name: ${err.constructor.name}`);
}

if (err instanceof RIFError) {
logger.debug(`##catch RIFError, ${err.statusCode}, ${err.message}`);
Expand Down
Loading

0 comments on commit 2652dfd

Please sign in to comment.