Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Boldizsar Mezei committed Apr 25, 2024
1 parent 8243ea3 commit 4faf73a
Show file tree
Hide file tree
Showing 18 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions packages/database/src/pg/impl/knex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const getKnex = () => {
},
pool: {
min: Number(process.env.DB_POOL_MIN || 0),
max: Number(process.env.DB_POOL_MAX || 10),
max: Number(process.env.DB_POOL_MAX || 50),
},
});
}
Expand All @@ -37,7 +37,7 @@ export const getKnexTran = () => {
},
pool: {
min: Number(process.env.DB_POOL_MIN || 0),
max: Number(process.env.DB_POOL_MAX || 10),
max: Number(process.env.DB_POOL_MAX || 100),
},
});
}
Expand Down
2 changes: 1 addition & 1 deletion packages/functions/src/cron/media.cron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import {
putCar,
tokenToIpfsMetadata,
} from '../utils/car.utils';
import { spaceToIpfsMetadata } from '../utils/space.utils';
import { logger } from '../utils/logger';
import { spaceToIpfsMetadata } from '../utils/space.utils';

export const MEDIA_UPLOAD_BACH_SIZE = 30;

Expand Down
2 changes: 1 addition & 1 deletion packages/functions/src/cron/stakeReward.cron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import {
import dayjs from 'dayjs';
import { isEmpty } from 'lodash';
import { getProject } from '../utils/common.utils';
import { getRandomEthAddress } from '../utils/wallet.utils';
import { logger } from '../utils/logger';
import { getRandomEthAddress } from '../utils/wallet.utils';

export const onStakeRewardExpired = async () => {
const stakeRewards = await getDueStakeRewards();
Expand Down
2 changes: 1 addition & 1 deletion packages/functions/src/runtime/https/https.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { AnySchema, ValidationOptions } from 'joi';
import { get } from 'lodash';
import { Context } from '../../controls/common';
import { WEN_FUNC_SCALE } from '../../scale.settings';
import { logger } from '../../utils/logger';
import { CloudFunctions, RuntimeOptions } from '../common';
import { auth } from './middlewares';
import { logger } from '../../utils/logger';

type HandlerType = (req: express.Request, res: express.Response) => Promise<void>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { getNftByMintingId } from '../../../utils/collection-minting-utils/nft.u
import { getProject } from '../../../utils/common.utils';
import { getBucket } from '../../../utils/config.utils';
import { dateToTimestamp, serverTime } from '../../../utils/dateTime.utils';
import { logger } from '../../../utils/logger';
import { migrateUriToSotrage, uriToUrl } from '../../../utils/media.utils';
import {
collectionIrc27Scheam,
Expand All @@ -40,7 +41,6 @@ import { NftWallet } from '../../wallet/NftWallet';
import { WalletService } from '../../wallet/wallet.service';
import { BaseService, HandlerParams } from '../base';
import { Action, TransactionMatch } from '../transaction-service';
import { logger } from '../../../utils/logger';

export class NftDepositService extends BaseService {
public handleRequest = async ({ order, match, tranEntry }: HandlerParams) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import {
import dayjs from 'dayjs';
import { cloneDeep } from 'lodash';
import { dateToTimestamp } from '../../../utils/dateTime.utils';
import { logger } from '../../../utils/logger';
import { getRandomEthAddress } from '../../../utils/wallet.utils';
import { WalletService } from '../../wallet/wallet.service';
import { BaseService, HandlerParams } from '../base';
import { createNftWithdrawOrder } from '../tangle-service/nft/nft-purchase.service';
import { Action } from '../transaction-service';
import { NftDepositService } from './nft-deposit.service';
import { logger } from '../../../utils/logger';

export class NftStakeService extends BaseService {
public handleRequest = async ({ project, order, match, tranEntry }: HandlerParams) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
import { get, isEmpty } from 'lodash';
import { getOutputMetadata } from '../../../utils/basic-output.utils';
import { invalidArgument } from '../../../utils/error.utils';
import { logger } from '../../../utils/logger';
import { getRandomNonce } from '../../../utils/wallet.utils';
import { BaseTangleService, HandlerParams } from '../base';
import { TangleAddressValidationService } from './address/address-validation.service';
Expand Down Expand Up @@ -44,7 +45,6 @@ import { SwapSetFundedTangleService } from './swap/SwapSetFundedTangleService';
import { TangleStakeService } from './token/stake.service';
import { TangleTokenClaimService } from './token/token-claim.service';
import { TangleTokenTradeService } from './token/token-trade.service';
import { logger } from '../../../utils/logger';

export class TangleRequestService extends BaseTangleService<TangleResponse> {
public handleRequest = async (params: HandlerParams) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import { MilestoneTransactionAdapter } from '../../triggers/milestone-transactio
import { getOutputMetadata } from '../../utils/basic-output.utils';
import { getProject } from '../../utils/common.utils';
import { dateToTimestamp, serverTime } from '../../utils/dateTime.utils';
import { logger } from '../../utils/logger';
import { getPathParts } from '../../utils/milestone';
import { getRandomEthAddress } from '../../utils/wallet.utils';
import { logger } from '../../utils/logger';

export interface TransactionMatch {
msgId: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/functions/src/services/wallet/NftWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ import {
createNftOutput,
nftToMetadata,
} from '../../utils/collection-minting-utils/nft.utils';
import { logger } from '../../utils/logger';
import { EMPTY_ALIAS_ID } from '../../utils/token-minting-utils/alias.utils';
import { awardBadgeToNttMetadata, awardToCollectionMetadata } from '../payment/award/award-service';
import { stampToNftMetadata } from '../payment/tangle-service/stamp/StampTangleService';
import { AliasWallet } from './AliasWallet';
import { MnemonicService } from './mnemonic';
import { Wallet, WalletParams } from './wallet';
import { AddressDetails, setConsumedOutputIds } from './wallet.service';
import { logger } from '../../utils/logger';

interface MintNftInputParams {
readonly aliasOutputId: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/functions/src/triggers/algolia/algolia.trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { BaseRecord } from '@build-5/database';
import { COL, SOON_PROJECT_ID } from '@build-5/interfaces';
import algoliasearch from 'algoliasearch';
import { algoliaAppId, algoliaKey } from '../../utils/config.utils';
import { PgDocEvent } from '../common';
import { logger } from '../../utils/logger';
import { PgDocEvent } from '../common';

const client = algoliasearch(algoliaAppId(), algoliaKey());

Expand Down
2 changes: 1 addition & 1 deletion packages/functions/src/triggers/collection.trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import { last } from 'lodash';
import { getAddress } from '../utils/address.utils';
import { collectionToIpfsMetadata, downloadMediaAndPackCar } from '../utils/car.utils';
import { getProject } from '../utils/common.utils';
import { logger } from '../utils/logger';
import { getRandomEthAddress } from '../utils/wallet.utils';
import { PgDocEvent } from './common';
import { logger } from '../utils/logger';

export const onCollectionUpdated = async (event: PgDocEvent<PgCollection>) => {
const { prev, curr } = event;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { PgMilestoneTransactions, build5Db } from '@build-5/database';
import { COL, Network, SUB_COL } from '@build-5/interfaces';
import dayjs from 'dayjs';
import { ProcessingService } from '../../services/payment/payment-processing';
import { logger } from '../../utils/logger';
import { PgDocEvent } from '../common';
import { MilestoneTransactionAdapter } from './MilestoneTransactionAdapter';
import { confirmTransaction } from './common';
import { processConsumedVoteOutputs } from './consumed.vote.outputs';
import { updateTokenSupplyData } from './token.foundry';
import { logger } from '../../utils/logger';

export const handleMilestoneTransactionWrite =
// eslint-disable-next-line require-await
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import fs from 'fs';
import os from 'os';
import path from 'path';
import sharp from 'sharp';
import { getRandomEthAddress } from '../../utils/wallet.utils';
import { logger } from '../../utils/logger';
import { getRandomEthAddress } from '../../utils/wallet.utils';

// eslint-disable-next-line @typescript-eslint/no-var-requires
const ffprobePath = require('@ffprobe-installer/ffprobe').path;
Expand Down
2 changes: 1 addition & 1 deletion packages/functions/src/triggers/token.trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { WalletService } from '../services/wallet/wallet.service';
import { getAddress } from '../utils/address.utils';
import { downloadMediaAndPackCar, tokenToIpfsMetadata } from '../utils/car.utils';
import { getProject, guardedRerun } from '../utils/common.utils';
import { logger } from '../utils/logger';
import { getRoyaltyFees } from '../utils/royalty.utils';
import { cancelTradeOrderUtil } from '../utils/token-trade.utils';
import {
Expand All @@ -33,7 +34,6 @@ import {
} from '../utils/token.utils';
import { getRandomEthAddress } from '../utils/wallet.utils';
import { PgDocEvent } from './common';
import { logger } from '../utils/logger';

export const onTokenStatusUpdated = async (event: PgDocEvent<PgToken>) => {
const { prev, curr } = event;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import { WalletService } from '../../services/wallet/wallet.service';
import { getAddress } from '../../utils/address.utils';
import { getProject } from '../../utils/common.utils';
import { dateToTimestamp, serverTime } from '../../utils/dateTime.utils';
import { logger } from '../../utils/logger';
import { dropToOutput } from '../../utils/token-minting-utils/member.utils';
import { getRandomEthAddress } from '../../utils/wallet.utils';
import { logger } from '../../utils/logger';

const LOOP_SIZE = 10000;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import { TransactionPayload, Utils } from '@iota/sdk';
import dayjs from 'dayjs';
import { getAddress } from '../../utils/address.utils';
import { getProject } from '../../utils/common.utils';
import { logger } from '../../utils/logger';
import { getPathParts } from '../../utils/milestone';
import { getRandomEthAddress } from '../../utils/wallet.utils';
import { logger } from '../../utils/logger';

export const onCollectionMintingUpdate = async (transaction: PgTransaction) => {
switch (transaction.payload_type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { getAddress } from '../../utils/address.utils';
import { getProject } from '../../utils/common.utils';
import { isEmulatorEnv } from '../../utils/config.utils';
import { serverTime } from '../../utils/dateTime.utils';
import { logger } from '../../utils/logger';
import { getRandomEthAddress } from '../../utils/wallet.utils';
import { PgDocEvent } from '../common';
import { unclockMnemonic } from '../milestone-transactions-triggers/common';
Expand All @@ -37,7 +38,6 @@ import { onStakingConfirmed } from './staking';
import { onStampMintUpdate } from './stamp-minting';
import { onTokenMintingUpdate } from './token-minting';
import { getWalletParams } from './wallet-params';
import { logger } from '../../utils/logger';

export const DEFAULT_EXECUTABLE_TRANSACTIONS = [
TransactionType.BILL_PAYMENT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export class CollectionMintHelper {
});

public createDummyNft = (collection: string, description = 'babba') => ({
name: 'NFT ' + description,
name: 'NFT ' + Math.random(),
description,
collection,
availableFrom: dayjs().add(1, 'hour').toDate(),
Expand Down

0 comments on commit 4faf73a

Please sign in to comment.