Skip to content

Commit

Permalink
feat: Scope borsh exports under borsh (#55)
Browse files Browse the repository at this point in the history
* feat: Scope borsh expose under `borsh`

* chore: Add changeset file
  • Loading branch information
morgsmccauley authored Mar 20, 2024
1 parent baedb8d commit da49769
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/moody-ghosts-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@near-lake/primitives": minor
---

Scope borsh exports under `borsh`
8 changes: 4 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion packages/near-lake-primitives/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from "./types";

export * from "./fromBorsh";
export * as borsh from "./fromBorsh";
8 changes: 3 additions & 5 deletions packages/near-lake-primitives/test/block.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { readFile } from "fs/promises";

import { Block } from "../src/types";

import { fromBorsh } from "../src/fromBorsh";
import { Block, borsh } from "../src";

describe("Block", () => {
it("serializes meta transactions", async () => {
Expand Down Expand Up @@ -68,11 +66,11 @@ describe("Block", () => {
);

expect(
fromBorsh("u64", addOrEditPost[0].k.slice(1)) ===
borsh.fromBorsh("u64", addOrEditPost[0].k.slice(1)) ===
addOrEditPost[0].k.slice(1).readBigUInt64LE()
);
expect(
fromBorsh("u32", addOrEditPost[0].v.slice(9, 13)) ===
borsh.fromBorsh("u32", addOrEditPost[0].v.slice(9, 13)) ===
addOrEditPost[0].v.slice(9, 13).readUInt32LE()
);
expect(authorToPostId).toMatchSnapshot();
Expand Down

0 comments on commit da49769

Please sign in to comment.