Skip to content

Commit

Permalink
Fix test types
Browse files Browse the repository at this point in the history
  • Loading branch information
dapplion committed May 29, 2023
1 parent 30e4008 commit 8b3bbe3
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions packages/db/test/unit/schema.test.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
import {assert} from "chai";
import {intToBytes} from "@lodestar/utils";
import {Bucket, encodeKey} from "../../src/schema.js";
import {BUCKET_LENGTH} from "../../src/index.js";
import {BUCKET_LENGTH, encodeKey} from "../../src/index.js";

describe("encodeKey", () => {
const bucket = 1;
const testCases = [
{
input: {bucket: Bucket.allForks_block, key: Buffer.from([0, 0, 0, 1])},
type: "Buffer",
},
{
input: {bucket: Bucket.allForks_block, key: Buffer.from([0, 1, 0, 1])},
type: "Buffer",
},
{input: {bucket: Bucket.allForks_block, key: 5}, type: "number"},
{input: {bucket: Bucket.allForks_block, key: BigInt(5)}, type: "number"},
{input: {bucket: Bucket.allForks_block, key: "test"}, type: "string"},
{input: {bucket, key: Buffer.from([0, 0, 0, 1])}, type: "Buffer"},
{input: {bucket, key: Buffer.from([0, 1, 0, 1])}, type: "Buffer"},
{input: {bucket, key: 5}, type: "number"},
{input: {bucket, key: BigInt(5)}, type: "number"},
{input: {bucket, key: "test"}, type: "string"},
];
for (const {
input: {bucket, key},
Expand Down

0 comments on commit 8b3bbe3

Please sign in to comment.