Skip to content

Commit

Permalink
refactor: remove unuse transport (#466)
Browse files Browse the repository at this point in the history
  • Loading branch information
anhnd350309 authored and hoangquocvietuet committed Feb 18, 2025
1 parent eef7383 commit 23abdfd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
5 changes: 1 addition & 4 deletions packages/network/src/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -192,11 +191,9 @@ export class DRPNetworkNode {
transports: [
circuitRelayTransport(),
webRTC(),
webRTCDirect(),
webSockets({
filter: filters.all,
}),
webTransport(),
],
});
log.info(
Expand Down
17 changes: 1 addition & 16 deletions packages/object/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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<object> {
// eslint-disable-next-line @typescript-eslint/no-this-alias
Expand Down

0 comments on commit 23abdfd

Please sign in to comment.