Skip to content

Commit

Permalink
add msgpack dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangquocvietuet committed Feb 12, 2025
1 parent 1d2b0d7 commit 65de27b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 158 deletions.
7 changes: 4 additions & 3 deletions packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
"devDependencies": {
"@bufbuild/protobuf": "^2.0.0",
"@types/node": "^22.5.4",
"race-event": "^1.3.0",
"tsx": "4.19.1",
"typescript": "^5.5.4",
"race-event": "^1.3.0",
"vitest": "^3.0.5"
},
"dependencies": {
Expand All @@ -46,12 +46,13 @@
"@grpc/reflection": "^1.0.4",
"@libp2p/crypto": "^5.0.5",
"@libp2p/interface": "^2.1.3",
"dotenv": "^16.4.5",
"@msgpack/msgpack": "^3.0.1",
"@ts-drp/blueprints": "0.7.0",
"@ts-drp/logger": "0.7.0",
"@ts-drp/network": "0.7.0",
"@ts-drp/object": "0.7.0",
"@ts-drp/logger": "0.7.0",
"commander": "^13.0.0",
"dotenv": "^16.4.5",
"uint8arrays": "^5.1.0"
}
}
7 changes: 4 additions & 3 deletions packages/node/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { ObjectPb, deserializeValue, serializeValue } from "@ts-drp/object";
import { encode, decode } from "@msgpack/msgpack";
import { ObjectPb } from "@ts-drp/object";

export function serializeStateMessage(state?: ObjectPb.DRPState): ObjectPb.DRPState {
const drpState = ObjectPb.DRPState.create();
for (const e of state?.state ?? []) {
const entry = ObjectPb.DRPStateEntry.create({
key: e.key,
value: serializeValue(e.value),
value: encode(e.value),
});
drpState.state.push(entry);
}
Expand All @@ -17,7 +18,7 @@ export function deserializeStateMessage(state?: ObjectPb.DRPState): ObjectPb.DRP
for (const e of state?.state ?? []) {
const entry = ObjectPb.DRPStateEntry.create({
key: e.key,
value: deserializeValue(e.value),
value: decode(e.value),
});
drpState.state.push(entry);
}
Expand Down
1 change: 0 additions & 1 deletion packages/object/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import * as ObjectPb from "./proto/drp/object/v1/object_pb.js";
import { ObjectSet } from "./utils/objectSet.js";

export * as ObjectPb from "./proto/drp/object/v1/object_pb.js";
export * from "./utils/serializer.js";
export * from "./acl/index.js";
export * from "./hashgraph/index.js";
export * from "./acl/interface.js";
Expand Down
141 changes: 0 additions & 141 deletions packages/object/src/utils/serializer.ts

This file was deleted.

10 changes: 0 additions & 10 deletions packages/object/tests/utils.test.ts

This file was deleted.

9 changes: 9 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit 65de27b

Please sign in to comment.