From da00d10aa7f2927f8559a1294c83f9b5a693bf50 Mon Sep 17 00:00:00 2001 From: anhnd350309 <156870690+anhnd350309@users.noreply.github.com> Date: Mon, 17 Feb 2025 19:27:34 +0700 Subject: [PATCH] refactor: remove unuse transport (#466) --- packages/network/src/node.ts | 5 +---- packages/object/src/index.ts | 17 +---------------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/packages/network/src/node.ts b/packages/network/src/node.ts index cb16fe54..ced15c90 100644 --- a/packages/network/src/node.ts +++ b/packages/network/src/node.ts @@ -25,10 +25,9 @@ import { type PubSubPeerDiscoveryComponents, pubsubPeerDiscovery, } from "@libp2p/pubsub-peer-discovery"; -import { webRTC, webRTCDirect } from "@libp2p/webrtc"; +import { webRTC } from "@libp2p/webrtc"; import { webSockets } from "@libp2p/websockets"; import * as filters from "@libp2p/websockets/filters"; -import { webTransport } from "@libp2p/webtransport"; import { type MultiaddrInput, multiaddr } from "@multiformats/multiaddr"; import { WebRTC } from "@multiformats/multiaddr-matcher"; import { Logger, type LoggerOptions } from "@ts-drp/logger"; @@ -192,11 +191,9 @@ export class DRPNetworkNode { transports: [ circuitRelayTransport(), webRTC(), - webRTCDirect(), webSockets({ filter: filters.all, }), - webTransport(), ], }); log.info( diff --git a/packages/object/src/index.ts b/packages/object/src/index.ts index be3a661f..bdac7e1d 100644 --- a/packages/object/src/index.ts +++ b/packages/object/src/index.ts @@ -6,13 +6,7 @@ import * as crypto from "node:crypto"; import { ObjectACL } from "./acl/index.js"; import type { ACL } from "./acl/interface.js"; import { type FinalityConfig, FinalityStore } from "./finality/index.js"; -import { - type Hash, - HashGraph, - type Operation, - type ResolveConflictsType, - type Vertex, -} from "./hashgraph/index.js"; +import { type Hash, HashGraph, type Operation, type Vertex } from "./hashgraph/index.js"; import { type DRP, type DRPObjectCallback, @@ -128,15 +122,6 @@ export class DRPObject implements ObjectPb.DRPObjectBase { return object; } - resolveConflicts(vertices: Vertex[]): ResolveConflictsType { - if (this.acl && vertices.some((v) => v.operation?.drpType === DrpType.ACL)) { - const acl = this.acl as ACL; - return acl.resolveConflicts(vertices); - } - const drp = this.drp as DRP; - return drp.resolveConflicts(vertices); - } - // This function is black magic, it allows us to intercept calls to the DRP object proxyDRPHandler(vertexType: DrpType): ProxyHandler { // eslint-disable-next-line @typescript-eslint/no-this-alias