Skip to content

Commit

Permalink
Update ts-gen.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Elli610 committed Aug 24, 2023
1 parent 908b9c5 commit dc13fa9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/massa-proto-cli/src/ts-gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,19 +216,22 @@ export function generateTSCaller(
* @returns {Promise<OperationOutputs>} A promise that resolves to an object which contains the outputs and events from the call to ${protoFile.funcName}.
*/
async ${protoFile.funcName}(${protoFile.argFields.length > 0 ? `${args}` : ''}
coins?: bigint,
fee?: bigint,
maxGas?:bigint
): Promise<OperationOutputs> {
${checkUnsignedArgs}${argsSerialization}
// Send the operation to the blockchain and retrieve its outputs
if(!coins) coins = this.coins;
if(!fee) fee = this.fee;
if(!maxGas) maxGas = this.maxGas;
return (
await ${protoFile.funcName}ExtractOutputsAndEvents(
'${contractAddress}',
'${protoFile.funcName}',
${protoFile.argFields.length > 0 ? 'serializedArgs' : 'new Uint8Array()'},
this.coins,
coins,
'${protoFile.resType.type == 'void' ? 'void' : returnType[protoFile.resType.type]}',
this.account,
this.nodeRPC,
Expand Down Expand Up @@ -485,6 +488,7 @@ export async function ${protoFile.funcName}ExtractOutputsAndEvents(
)
}
catch (err) {
console.log("Error while calling the Smart Contract: " + err);
return {
events: events,
} as OperationOutputs;
Expand Down

0 comments on commit dc13fa9

Please sign in to comment.