Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Reverse #43
  • Loading branch information
wk3368 committed May 15, 2022
1 parent f4cf07b commit 403dff8
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/utils/tx.ts
Expand Up @@ -46,13 +46,14 @@ export function encodePackage(
const modules = moduleCodes.map((m) => new starcoin_types.Module(arrayify(m)));
let scriptFunction = null;
if (!!initScriptFunction) {
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
);
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 Expand Up @@ -280,7 +281,7 @@ function serializeWithType(
// array of string: vector<vector<u8>>
if (type.Vector.Vector === 'U8') {
se.serializeBytes(fromHexString(sub))
} else if (type.Vector === 'Address'){
} else if (type.Vector === 'Address') {
se.serializeBytes(arrayify(sub))
} else if (type.Vector) {
// array of other types: vector<u8>
Expand Down

0 comments on commit 403dff8

Please sign in to comment.