Skip to content

Commit 2fc3446

Browse files
committed
fix: Add dedicated abi argument type
1 parent d72e0ae commit 2fc3446

File tree

1 file changed

+18
-15
lines changed
  • javascript/engine-js/src/tokenScript/data/function

1 file changed

+18
-15
lines changed

javascript/engine-js/src/tokenScript/data/function/Argument.ts

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,29 +52,32 @@ export class Argument extends AbstractDependencyBranch implements IArgument {
5252
value: overrideValue ?? await this.getValue(tokenContext)
5353
};
5454

55-
if (this.type === "struct"){
55+
if (this.type === "struct" || this.type === "abi"){
5656

5757
switch (this.ref){
5858
case "attestation":
59-
const data = await this.tokenScript.getTokenContextData(tokenContext);
60-
61-
arg.type = "tuple";
62-
arg.internalType = "struct EasTicketVerify.AttestationCoreData";
63-
arg.components = data.tokenInfo.data.decodedToken.types.Attest.map((field) => {
64-
return {
65-
name: field.name,
66-
type: field.type,
67-
internalType: field.type
68-
}
69-
})
70-
71-
break;
59+
if (this.type === "struct") {
60+
const data = await this.tokenScript.getTokenContextData(tokenContext);
61+
62+
arg.type = "tuple";
63+
arg.internalType = "struct EasTicketVerify.AttestationCoreData";
64+
arg.components = data.tokenInfo.data.decodedToken.types.Attest.map((field) => {
65+
return {
66+
name: field.name,
67+
type: field.type,
68+
internalType: field.type
69+
}
70+
})
71+
72+
break;
73+
}
7274

75+
// fall-through intended
7376
default:
7477

7578
const abi = contract.getAbi("function", functionName);
7679

77-
console.log("ABI: ", abi);
80+
//console.log("ABI: ", abi);
7881

7982
if (abi.length){
8083
const abiArg = abi[0].inputs.find((arg: any) => {

0 commit comments

Comments
 (0)