Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: the scriptFunction type in encodePackage (#43)
  • Loading branch information
zhanghongfei committed May 12, 2022
1 parent 7ee68ee commit 540b1ec
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/utils/tx.ts
Expand Up @@ -46,7 +46,13 @@ export function encodePackage(
const modules = moduleCodes.map((m) => new starcoin_types.Module(arrayify(m)));
let scriptFunction = null;
if (!!initScriptFunction) {
scriptFunction = encodeScriptFunction(initScriptFunction.functionId, initScriptFunction.tyArgs, initScriptFunction.args);
const funcId = parseFunctionId(initScriptFunction.functionId);
scriptFunction = new starcoin_types.ScriptFunction(
new starcoin_types.ModuleId(addressToSCS(funcId.address), new starcoin_types.Identifier(funcId.module)),
new starcoin_types.Identifier(funcId.functionName),
initScriptFunction.tyArgs.map((t) => typeTagToSCS(t)),
initScriptFunction.args
);
}
const packageData = new starcoin_types.Package(
addressToSCS(moduleAddress),
Expand Down

0 comments on commit 540b1ec

Please sign in to comment.