Skip to content

Commit

Permalink
feat: 🎸 update dataswapjs version to 0.22.0
Browse files Browse the repository at this point in the history
✅ Closes: #142
  • Loading branch information
siriusyim authored and lovel8 committed Mar 5, 2024
1 parent 943bb6f commit 3bc41a1
Show file tree
Hide file tree
Showing 7 changed files with 1,220 additions and 1,849 deletions.
3,025 changes: 1,218 additions & 1,807 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"homepage": "https://github.com/dataswap/messagehub#readme",
"dependencies": {
"@dataswapjs/dataswapjs": "^0.20.1",
"@dataswapjs/dataswapjs": "^0.22.0",
"@nestjs/common": "^10.0.0",
"@nestjs/core": "^10.0.0",
"@nestjs/platform-express": "^10.0.0",
Expand Down
4 changes: 0 additions & 4 deletions src/backgroundTask/context/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ export class Context implements IContext {
getFilecoinAddress(config.evm.matchingTarget),
getFilecoinAddress(config.evm.matchingBids),
getFilecoinAddress(config.evm.storages),
getFilecoinAddress(config.evm.datacaps),
getFilecoinAddress(config.evm.escrow),
getFilecoinAddress(config.evm.roles),
getFilecoinAddress(config.evm.filplus),
]),
Expand All @@ -156,7 +154,6 @@ export class Context implements IContext {
this.evm.carstore = config.evm.carstore
this.evm.roles = config.evm.roles
this.evm.filplus = config.evm.filplus
this.evm.escrow = config.evm.escrow
this.evm.datasetMetadata = config.evm.datasetMetadata
this.evm.datasetRequirement = config.evm.datasetRequirement
this.evm.datasetProof = config.evm.datasetProof
Expand All @@ -165,6 +162,5 @@ export class Context implements IContext {
this.evm.matchingTarget = config.evm.matchingTarget
this.evm.matchingBids = config.evm.matchingBids
this.evm.storages = config.evm.storages
this.evm.datacaps = config.evm.datacaps
}
}
24 changes: 0 additions & 24 deletions src/backgroundTask/decoder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,19 +187,6 @@ export class Decoder implements IDecoder {
}
break

case getFilecoinAddress(this.context.evm.datacaps):
const datacaps =
this.context.evm.datacaps.decodeMessage(msg).data
if (datacaps) {
res.push(datacaps)
} else {
console.error(`Decode datacaps error,:${datacaps}`)
throw new Error(
`Decode datacaps error,:${datacaps}`
)
}
break

case getFilecoinAddress(this.context.evm.roles):
const roles =
this.context.evm.roles.decodeMessage(msg).data
Expand All @@ -222,17 +209,6 @@ export class Decoder implements IDecoder {
}
break

case getFilecoinAddress(this.context.evm.escrow):
const escrow =
this.context.evm.escrow.decodeMessage(msg).data
if (escrow) {
res.push(escrow)
} else {
console.error(`Decode escrow error,:${escrow}`)
throw new Error(`Decode escrow error,:${escrow}`)
}
break

default:
break
}
Expand Down
4 changes: 0 additions & 4 deletions src/backgroundTask/interface/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ import {
MatchingMetadataEvm,
MatchingTargetEvm,
StoragesEvm,
DatacapsEvm,
EscrowEvm,
RolesEvm,
FilplusEvm,
DataswapMessage,
Expand Down Expand Up @@ -73,7 +71,6 @@ export interface ChainContext {
*/
export interface EvmContext {
carstore: CarstoreEvm
escrow: EscrowEvm
filplus: FilplusEvm
roles: RolesEvm
datasetMetadata: DatasetMetadataEvm
Expand All @@ -84,7 +81,6 @@ export interface EvmContext {
matchingMetadata: MatchingMetadataEvm
matchingBids: MatchingBidsEvm
storages: StoragesEvm
datacaps: DatacapsEvm
}

/**
Expand Down
8 changes: 0 additions & 8 deletions src/config/backgroundTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ import { Storager } from "../backgroundTask/storager"
import {
carstoreEvm_Calibration,
carstoreEvm_Main,
datacapsEvm_Calibration,
datacapsEvm_Main,
datasetChallengeEvm_Calibration,
datasetChallengeEvm_Main,
datasetMetadataEvm_Calibration,
Expand All @@ -36,8 +34,6 @@ import {
datasetProofEvm_Main,
datasetRequirementEvm_Calibration,
datasetRequirementEvm_Main,
escrowEvm_Calibration,
escrowEvm_Main,
filplusEvm_Calibraion,
filplusEvm_Main,
matchingBidsEvm_Calibration,
Expand Down Expand Up @@ -75,10 +71,8 @@ export const calibrationConfig: Config = {
matchingTarget: matchingTargetEvm_Calibration,
matchingBids: matchingBidsEvm_Calibration,
storages: storagesEvm_Calibration,
datacaps: datacapsEvm_Calibration,
roles: rolesEvm_Calibration,
filplus: filplusEvm_Calibraion,
escrow: escrowEvm_Calibration,
},
notRunSynctask:
process.env.CALIBRATION_NOT_RUN_SYNCTASK &&
Expand Down Expand Up @@ -107,10 +101,8 @@ export const mainConfig: Config = {
matchingTarget: matchingTargetEvm_Main,
matchingBids: matchingBidsEvm_Main,
storages: storagesEvm_Main,
datacaps: datacapsEvm_Main,
roles: rolesEvm_Main,
filplus: filplusEvm_Main,
escrow: escrowEvm_Main,
},
notRunSynctask:
process.env.MAIN_NOT_RUN_SYNCTASK &&
Expand Down
2 changes: 1 addition & 1 deletion test/backgroundTask/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe("BackgroundTask", () => {
expect(startHeight).toBe(Number(process.env.CALIBRATION_START_HEIGHT))

const startSyncHeight = calibrationBgTask.getCurrentSyncHeight()
await delay(20000)
await delay(40000)
const endSyncHeight = calibrationBgTask.getCurrentSyncHeight()
expect(endSyncHeight - startSyncHeight > 0).toBe(true)

Expand Down

0 comments on commit 3bc41a1

Please sign in to comment.