Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why chain-api/src/utils/signatures.spec.ts can not use? #236

Open
LXHLeaner opened this issue May 28, 2024 · 0 comments
Open

Why chain-api/src/utils/signatures.spec.ts can not use? #236

LXHLeaner opened this issue May 28, 2024 · 0 comments

Comments

@LXHLeaner
Copy link

Why chain-api/src/utils/signatures.spec.ts can not use?

it("should sort keys", () => {
// Given
const obj = { c: 8, b: [{ z: 6, y: 5, x: 4 }, 7], a: 3 };

    // When
    const toSign = signatures.getPayloadToSign(obj);

    // Then
    expect(toSign).toEqual('{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8}');
});

ERR:

(0 , json_stringify_deterministic_1.default) is not a function
TypeError: (0 , json_stringify_deterministic_1.default) is not a function
at serialize (/Users/lc/Documents/TsCode/01Example/tests/serialize.ts:19:19)
at Object.getPayloadToSign (/Users/lc/Documents/TsCode/01Example/tests/signatures.ts:33:19)
at Object. (/Users/lc/Documents/TsCode/01Example/tests/galasignature.spec.ts:26:35)
at Promise.then.completed (/Users/lc/Documents/TsCode/01Example/node_modules/jest-circus/build/utils.js:298:28)
at new Promise ()
at callAsyncCircusFn (/Users/lc/Documents/TsCode/01Example/node_modules/jest-circus/build/utils.js:231:10)
at _callCircusTest (/Users/lc/Documents/TsCode/01Example/node_modules/jest-circus/build/run.js:316:40)
at _runTest (/Users/lc/Documents/TsCode/01Example/node_modules/jest-circus/build/run.js:252:3)
at _runTestsForDescribeBlock (/Users/lc/Documents/TsCode/01Example/node_modules/jest-circus/build/run.js:126:9)
at _runTestsForDescribeBlock (/Users/lc/Documents/TsCode/01Example/node_modules/jest-circus/build/run.js:121:9)
at run (/Users/lc/Documents/TsCode/01Example/node_modules/jest-circus/build/run.js:71:3)
at runAndTransformResultsToJestFormat (/Users/lc/Documents/TsCode/01Example/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
at jestAdapter (/Users/lc/Documents/TsCode/01Example/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
at runTestInternal (/Users/lc/Documents/TsCode/01Example/node_modules/jest-runner/build/runTest.js:367:16)
at runTest (/Users/lc/Documents/TsCode/01Example/node_modules/jest-runner/build/runTest.js:444:34)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant