summaryrefslogtreecommitdiff
path: root/cmd/goal/clerk.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/goal/clerk.go')
-rw-r--r--cmd/goal/clerk.go32
1 files changed, 12 insertions, 20 deletions
diff --git a/cmd/goal/clerk.go b/cmd/goal/clerk.go
index 87d6ef27f..5359c372f 100644
--- a/cmd/goal/clerk.go
+++ b/cmd/goal/clerk.go
@@ -321,7 +321,7 @@ var sendCmd = &cobra.Command{
var err error
if progByteFile != "" {
if programSource != "" || logicSigFile != "" {
- reportErrorln("should at most one of --from-program/-F or --from-program-bytes/-P --logic-sig/-L")
+ reportErrorln("should use at most one of --from-program/-F or --from-program-bytes/-P --logic-sig/-L")
}
program, err = readFile(progByteFile)
if err != nil {
@@ -329,7 +329,7 @@ var sendCmd = &cobra.Command{
}
} else if programSource != "" {
if logicSigFile != "" {
- reportErrorln("should at most one of --from-program/-F or --from-program-bytes/-P --logic-sig/-L")
+ reportErrorln("should use at most one of --from-program/-F or --from-program-bytes/-P --logic-sig/-L")
}
program = assembleFile(programSource)
} else if logicSigFile != "" {
@@ -788,6 +788,9 @@ var signCmd = &cobra.Command{
for _, group := range groupsOrder {
txnGroup := []transactions.SignedTxn{}
for _, txn := range txnGroups[group] {
+ if lsig.Logic != nil {
+ txn.Lsig = lsig
+ }
txnGroup = append(txnGroup, *txn)
}
var groupCtx *verify.GroupContext
@@ -801,7 +804,6 @@ var signCmd = &cobra.Command{
for i, txn := range txnGroup {
var signedTxn transactions.SignedTxn
if lsig.Logic != nil {
- txn.Lsig = lsig
err = verify.LogicSigSanityCheck(&txn, i, groupCtx)
if err != nil {
reportErrorf("%s: txn[%d] error %s", txFilename, txnIndex[txnGroups[group][i]], err)
@@ -1065,10 +1067,7 @@ var dryrunCmd = &cobra.Command{
}
stxns = append(stxns, txn)
}
- txgroup := make([]transactions.SignedTxn, len(stxns))
- for i, st := range stxns {
- txgroup[i] = st
- }
+ txgroup := transactions.WrapSignedTxnsWithAD(stxns)
proto, params := getProto(protoVersion)
if dumpForDryrun {
// Write dryrun data to file
@@ -1078,7 +1077,7 @@ var dryrunCmd = &cobra.Command{
if err != nil {
reportErrorf(err.Error())
}
- data, err := libgoal.MakeDryrunStateBytes(client, nil, txgroup, accts, string(proto), dumpForDryrunFormat.String())
+ data, err := libgoal.MakeDryrunStateBytes(client, nil, stxns, accts, string(proto), dumpForDryrunFormat.String())
if err != nil {
reportErrorf(err.Error())
}
@@ -1096,22 +1095,15 @@ var dryrunCmd = &cobra.Command{
if uint64(txn.Lsig.Len()) > params.LogicSigMaxSize {
reportErrorf("program size too large: %d > %d", len(txn.Lsig.Logic), params.LogicSigMaxSize)
}
- ep := logic.EvalParams{Txn: &txn, Proto: &params, GroupIndex: uint64(i), TxnGroup: txgroup}
- err := logic.Check(txn.Lsig.Logic, ep)
+ ep := logic.NewEvalParams(txgroup, &params, nil)
+ err := logic.CheckSignature(i, ep)
if err != nil {
reportErrorf("program failed Check: %s", err)
}
- sb := strings.Builder{}
- ep = logic.EvalParams{
- Txn: &txn,
- GroupIndex: uint64(i),
- Proto: &params,
- Trace: &sb,
- TxnGroup: txgroup,
- }
- pass, err := logic.Eval(txn.Lsig.Logic, ep)
+ ep.Trace = &strings.Builder{}
+ pass, err := logic.EvalSignature(i, ep)
// TODO: optionally include `inspect` output here?
- fmt.Fprintf(os.Stdout, "tx[%d] trace:\n%s\n", i, sb.String())
+ fmt.Fprintf(os.Stdout, "tx[%d] trace:\n%s\n", i, ep.Trace.String())
if pass {
fmt.Fprintf(os.Stdout, " - pass -\n")
} else {