UNPKG

@ledgerhq/coin-aptos

Version:
27 lines 1.01 kB
import { getFunctionAddress } from "../../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 = getFunctionAddress(payload); expect(result).toBe("0x1"); }); it("should return undefined when payload does not contain a function", () => { const payload = { function: "::::", typeArguments: [], functionArguments: [], }; const result = getFunctionAddress(payload); expect(result).toBeUndefined(); }); it("should return undefined when payload is empty", () => { const payload = {}; const result = getFunctionAddress(payload); expect(result).toBeUndefined(); }); }); //# sourceMappingURL=getFunctionAddress.unit.test.js.map