UNPKG

@ledgerhq/coin-aptos

Version:
29 lines 1.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const getFunctionAddress_1 = require("../../logic/getFunctionAddress"); describe("getFunctionAddress", () => { it("should return the function address when payload contains a function", () => { const payload = { function: "0x1::coin::transfer", typeArguments: [], functionArguments: [], }; const result = (0, getFunctionAddress_1.getFunctionAddress)(payload); expect(result).toBe("0x1"); }); it("should return undefined when payload does not contain a function", () => { const payload = { function: "::::", typeArguments: [], functionArguments: [], }; const result = (0, getFunctionAddress_1.getFunctionAddress)(payload); expect(result).toBeUndefined(); }); it("should return undefined when payload is empty", () => { const payload = {}; const result = (0, getFunctionAddress_1.getFunctionAddress)(payload); expect(result).toBeUndefined(); }); }); //# sourceMappingURL=getFunctionAddress.unit.test.js.map