Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
7 changes: 4 additions & 3 deletions tck/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@ import { sdk } from "./sdk_data";
import { RpcMethodParams } from "./params/sdk";

/**
* Very primitive catch-all mapping prototype
* Very primitive catch-all mapping prototype with session support
* @returns {Promise<*>}
* @param {Input} input
* @param {Input} input - Input parameters including optional sessionId
*/
export default async function mapMethods({
callClass,
methods,
sessionId,
}: RpcMethodParams): Promise<string> {
const cl: any = (await import("@hashgraph/sdk"))[callClass];

let currentObject: any = new cl();
for (let { name, param } of methods) {
if (param === "client") {
param = sdk.getClient();
param = sdk.getClient(sessionId);
}

if (typeof currentObject[name] === "function") {
Expand Down
Loading
Loading