Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
Signed-off-by: Shreevatsa N <[email protected]>
  • Loading branch information
vatsa287 committed Apr 10, 2024
1 parent dca2436 commit ec558bf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 36 deletions.
26 changes: 1 addition & 25 deletions packages/network-score/src/Scoring.chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@ import {
IRatingChainStatus,
IRatingChainEntryDetails,
RatingTypeOf,
//EntityTypeOf,
EntryTypeOf,
IAggregateScore,
} from '@cord.network/types'
import type { Option } from '@cord.network/types'
import type {
PalletNetworkScoreRatingEntry,
//PalletNetworkScoreEntityTypeOf,
PalletNetworkScoreRatingTypeOf,
PalletNetworkScoreEntryTypeOf,
PalletNetworkScoreAggregatedEntryOf,
Expand Down Expand Up @@ -364,12 +362,8 @@ export async function dispatchReviseRatingToChain(
function extractEnumIndex(enumObject: { index: number }): number {
return enumObject.index
}
// TypeScript Enum Mappings
// const EntityTypeMapping: Record<number, EntityTypeOf> = {
// 0: EntityTypeOf.retail,
// 1: EntityTypeOf.logistic,
// }

// TypeScript Enum Mappings
const RatingTypeMapping: Record<number, RatingTypeOf> = {
0: RatingTypeOf.overall,
1: RatingTypeOf.delivery,
Expand All @@ -380,24 +374,6 @@ const EntryTypeMapping: Record<number, EntryTypeOf> = {
1: EntryTypeOf.debit,
}

/**
* Decodes an encoded entity type to its corresponding EntityTypeOf value.
*
* This function is used to decode the entity type from its encoded form (as received from a blockchain or similar source)
* to a more readable and usable EntityTypeOf value, using a predefined mapping.
*
* @param encodedType - The encoded entity type.
* @returns - The decoded entity type.
*
* @internal
*/
// function decodeEntityType(
// encodedType: PalletNetworkScoreEntityTypeOf
// ): EntityTypeOf {
// const index = extractEnumIndex(encodedType)
// return EntityTypeMapping[index]
// }

/**
* Decodes an encoded rating type to its corresponding RatingTypeOf value.
*
Expand Down
11 changes: 0 additions & 11 deletions packages/types/src/Score.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,24 @@ export enum RatingTypeOf {
delivery = 'Delivery',
}

// export enum EntityTypeOf {
// retail = 'Retail',
// logistic = 'Logistic',
// }

export enum EntryTypeOf {
credit = 'Credit',
debit = 'Debit',
}

export interface IRatingContent {
//entityUid: string
entityId: string
//providerUid: string
providerId: string
//entityType: EntityTypeOf
ratingType: RatingTypeOf
referenceId?: string
countOfTxn: number
totalRating: number
}

export interface IRatingTransformed {
//entityUid: string
entityId: string
//providerUid: string
providerId: string
providerDid: CordAddress
//entityType: EntityTypeOf
ratingType: RatingTypeOf
referenceId?: string
countOfTxn: number
Expand Down

0 comments on commit ec558bf

Please sign in to comment.