Skip to content

Commit

Permalink
fix config
Browse files Browse the repository at this point in the history
  • Loading branch information
ElessarST committed Feb 26, 2024
1 parent 1debac7 commit fe06159
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 40 deletions.
31 changes: 31 additions & 0 deletions indexer/db/migrations/1708938587449-Data.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions indexer/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ type Marketplace @entity {
}

type MarketplaceConfig @entity {
gasForCreation: Int
gasForTransferToken: Int
gasForCloseAuction: Int
gasForDeleteCollection: Int
gasForGetTokenInfo: Int
timeBetweenCreateCollections: Int
royaltyToMarketplaceForMint: Int
royaltyToMarketplaceForTrade: Int
feePerUploadedFile: BigInt
minimumTransferValue: BigInt
msInBlock: Int
gasForCreation: Int!
gasForTransferToken: Int!
gasForCloseAuction: Int!
gasForDeleteCollection: Int!
gasForGetTokenInfo: Int!
timeBetweenCreateCollections: Int!
royaltyToMarketplaceForMint: Int!
royaltyToMarketplaceForTrade: Int!
feePerUploadedFile: BigInt!
minimumTransferValue: BigInt!
msInBlock: Int!
marketplace: Marketplace!
}

Expand Down
44 changes: 22 additions & 22 deletions indexer/src/model/generated/marketplaceConfig.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,44 +17,44 @@ export class MarketplaceConfig {
@PrimaryColumn_()
id!: string;

@Column_('int4', { nullable: true })
gasForCreation!: number | undefined | null;
@Column_('int4', { nullable: false })
gasForCreation!: number;

@Column_('int4', { nullable: true })
gasForTransferToken!: number | undefined | null;
@Column_('int4', { nullable: false })
gasForTransferToken!: number;

@Column_('int4', { nullable: true })
gasForCloseAuction!: number | undefined | null;
@Column_('int4', { nullable: false })
gasForCloseAuction!: number;

@Column_('int4', { nullable: true })
gasForDeleteCollection!: number | undefined | null;
@Column_('int4', { nullable: false })
gasForDeleteCollection!: number;

@Column_('int4', { nullable: true })
gasForGetTokenInfo!: number | undefined | null;
@Column_('int4', { nullable: false })
gasForGetTokenInfo!: number;

@Column_('int4', { nullable: true })
timeBetweenCreateCollections!: number | undefined | null;
@Column_('int4', { nullable: false })
timeBetweenCreateCollections!: number;

@Column_('int4', { nullable: true })
royaltyToMarketplaceForMint!: number | undefined | null;
@Column_('int4', { nullable: false })
royaltyToMarketplaceForMint!: number;

@Column_('int4', { nullable: true })
royaltyToMarketplaceForTrade!: number | undefined | null;
@Column_('int4', { nullable: false })
royaltyToMarketplaceForTrade!: number;

@Column_('numeric', {
transformer: marshal.bigintTransformer,
nullable: true,
nullable: false,
})
feePerUploadedFile!: bigint | undefined | null;
feePerUploadedFile!: bigint;

@Column_('numeric', {
transformer: marshal.bigintTransformer,
nullable: true,
nullable: false,
})
minimumTransferValue!: bigint | undefined | null;
minimumTransferValue!: bigint;

@Column_('int4', { nullable: true })
msInBlock!: number | undefined | null;
@Column_('int4', { nullable: false })
msInBlock!: number;

@Index_()
@ManyToOne_(() => Marketplace, { nullable: true })
Expand Down
4 changes: 3 additions & 1 deletion indexer/src/processing/marketplace/initialized.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { MarketplaceConfig } from '../../model';
import { EventInfo } from '../event-info.type';
import { Initialized } from '../../types/marketplace.events';

export class MarketplaceInitializedHandler implements INftMarketplaceEventHandler {
export class MarketplaceInitializedHandler
implements INftMarketplaceEventHandler
{
async handle(
event: Initialized,
eventInfo: EventInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ export class NewCollectionAddedHandler implements INftMarketplaceEventHandler {
): Promise<void> {
const { codeId, metaLink, typeName, typeDescription } = event;
const existingCollectionType = await storage.getCollectionType(typeName);
if (existingCollectionType !== undefined) {
console.warn(
`[NewCollectionAddedHandler]: Collection type ${typeName} already exists`,
);
return;
}
if (!typeName) {
console.warn(
`[NewCollectionAddedHandler]: Collection type ${typeName} is not valid`,
Expand All @@ -26,6 +20,7 @@ export class NewCollectionAddedHandler implements INftMarketplaceEventHandler {
}
await storage.setCollectionType(
new CollectionType({
...(existingCollectionType ?? {}),
id: codeId,
description: typeDescription,
type: typeName,
Expand Down

0 comments on commit fe06159

Please sign in to comment.