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

Release 1.4.10 #166

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:22
FROM node:23
MAINTAINER SDF Wallets Team <[email protected]>

RUN mkdir -p /app
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,30 @@
"node": ">=18.12.0"
},
"dependencies": {
"@blockaid/client": "^0.25.0",
"@blockaid/client": "^0.28.0",
"@fastify/cors": "^10.0.1",
"@fastify/helmet": "^12.0.1",
"@fastify/rate-limit": "^10.1.1",
"@sentry/node": "^8.28.0",
"@sentry/node": "^8.35.0",
"@stellar/js-xdr": "^3.1.2",
"@urql/core": "^5.0.6",
"@urql/core": "^5.0.8",
"ajv": "^8.17.0",
"axios": "^1.7.7",
"dotenv-expand": "^11.0.6",
"fastify": "^5.0.0",
"ioredis": "^5.4.1",
"pino": "^9.4.0",
"pino-pretty": "^11.2.2",
"pino": "^9.5.0",
"pino-pretty": "^11.3.0",
"prom-client": "^15.1.3",
"stellar-sdk": "yarn:[email protected]",
"stellar-sdk-next": "yarn:[email protected]",
"yargs": "^17.7.2"
},
"devDependencies": {
"@babel/preset-typescript": "^7.24.7",
"@babel/preset-typescript": "^7.26.0",
"@stellar/tsconfig": "^1.0.2",
"@types/jest": "^29.5.12",
"@types/node": "^22.5.4",
"@types/jest": "^29.5.14",
"@types/node": "^22.8.1",
"@types/yargs": "^17.0.33",
"babel-jest": "^29.7.0",
"dotenv": "^16.4.5",
Expand Down
30 changes: 22 additions & 8 deletions src/helper/soroban-rpc/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { xdr } from "stellar-sdk";

import { base64regex } from "../test-helper";
import {
getLedgerKeyContractCode,
getLedgerKeyWasmId,
isTokenSpec,
parseWasmXdr,
} from ".";
import { base64regex, testLogger } from "../test-helper";
import * as networkHelpers from "./network";
import { getIsTokenSpec, isTokenSpec } from "./token";

const { getLedgerKeyContractCode, getLedgerKeyWasmId, parseWasmXdr } =
networkHelpers;

describe("Soroban RPC helpers", () => {
const CONTRACT_ID =
Expand All @@ -26,7 +25,7 @@ describe("Soroban RPC helpers", () => {
});
it("will throw when it fails to get ledger key", () => {
expect(() =>
getLedgerKeyContractCode("not contract ID", "TESTNET")
getLedgerKeyContractCode("not contract ID", "TESTNET"),
).toThrowError();
});
});
Expand Down Expand Up @@ -66,4 +65,19 @@ describe("Soroban RPC helpers", () => {
expect(isSep41).toBeFalsy();
});
});

describe("getIsTokenSpec", () => {
afterAll(() => {
jest.resetModules();
});
it("will return false when the spec cannot be parsed", async () => {
jest.spyOn(networkHelpers, "getContractSpec").mockImplementation(() => {
return Promise.resolve({ result: { notDefinitions: {} }, error: null });
});

const isSep41 = await getIsTokenSpec("contractId", "TESTNET", testLogger);

expect(isSep41).toBeFalsy();
});
});
});
Loading