Skip to content

Commit

Permalink
Merge pull request #465 from bluesign/master
Browse files Browse the repository at this point in the history
Arguments parsing fix for Transactions with functions
  • Loading branch information
sideninja authored Mar 7, 2022
2 parents 197585d + 883f79b commit ff7a887
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pkg/flowkit/arguments.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,20 +132,20 @@ func ParseArgumentsWithoutType(fileName string, code []byte, args []string) (scr

var parameterList []*ast.Parameter

transactionDeclaration := program.SoleTransactionDeclaration()
if transactionDeclaration != nil {
if transactionDeclaration.ParameterList != nil {
parameterList = transactionDeclaration.ParameterList.Parameters
}
}

functionDeclaration := sema.FunctionEntryPointDeclaration(program)
if functionDeclaration != nil {
if functionDeclaration.ParameterList != nil {
parameterList = functionDeclaration.ParameterList.Parameters
}
}

transactionDeclaration := program.TransactionDeclarations()
if len(transactionDeclaration) == 1 {
if transactionDeclaration[0].ParameterList != nil {
parameterList = transactionDeclaration[0].ParameterList.Parameters
}
}

if parameterList == nil {
return resultArgs, nil
}
Expand Down

0 comments on commit ff7a887

Please sign in to comment.