Skip to content

Commit d43b0e2

Browse files
committed
Populate the ApplyData with inner transactions.
This also simplifies Log handling by using the same technique. Lots more test of Pay in teal (with proper rewards handling)
1 parent 3474fb5 commit d43b0e2

File tree

15 files changed

+344
-398
lines changed

15 files changed

+344
-398
lines changed

data/transactions/logic/assembler.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,7 +2041,7 @@ func parseIntcblock(program []byte, pc int) (intc []uint64, nextpc int, err erro
20412041
return
20422042
}
20432043

2044-
func checkIntConstBlock(cx *evalContext) error {
2044+
func checkIntConstBlock(cx *EvalContext) error {
20452045
pos := cx.pc + 1
20462046
numInts, bytesUsed := binary.Uvarint(cx.program[pos:])
20472047
if bytesUsed <= 0 {
@@ -2109,7 +2109,7 @@ func parseBytecBlock(program []byte, pc int) (bytec [][]byte, nextpc int, err er
21092109
return
21102110
}
21112111

2112-
func checkByteConstBlock(cx *evalContext) error {
2112+
func checkByteConstBlock(cx *EvalContext) error {
21132113
pos := cx.pc + 1
21142114
numItems, bytesUsed := binary.Uvarint(cx.program[pos:])
21152115
if bytesUsed <= 0 {
@@ -2267,7 +2267,7 @@ func disPushInt(dis *disassembleState, spec *OpSpec) (string, error) {
22672267
dis.nextpc = pos + bytesUsed
22682268
return fmt.Sprintf("%s %d", spec.Name, val), nil
22692269
}
2270-
func checkPushInt(cx *evalContext) error {
2270+
func checkPushInt(cx *EvalContext) error {
22712271
opPushInt(cx)
22722272
return cx.err
22732273
}
@@ -2287,7 +2287,7 @@ func disPushBytes(dis *disassembleState, spec *OpSpec) (string, error) {
22872287
dis.nextpc = int(end)
22882288
return fmt.Sprintf("%s 0x%s // %s", spec.Name, hex.EncodeToString(bytes), guessByteFormat(bytes)), nil
22892289
}
2290-
func checkPushBytes(cx *evalContext) error {
2290+
func checkPushBytes(cx *EvalContext) error {
22912291
opPushBytes(cx)
22922292
return cx.err
22932293
}

data/transactions/logic/assembler_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2102,7 +2102,7 @@ func TestErrShortBytecblock(t *testing.T) {
21022102
_, _, err = parseIntcblock(ops.Program, 0)
21032103
require.Equal(t, err, errShortIntcblock)
21042104

2105-
var cx evalContext
2105+
var cx EvalContext
21062106
cx.program = ops.Program
21072107
err = checkIntConstBlock(&cx)
21082108
require.Equal(t, err, errShortIntcblock)

data/transactions/logic/debugger.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func GetProgramID(program []byte) string {
8686
return hex.EncodeToString(hash[:])
8787
}
8888

89-
func makeDebugState(cx *evalContext) DebugState {
89+
func makeDebugState(cx *EvalContext) DebugState {
9090
disasm, dsInfo, err := disassembleInstrumented(cx.program, nil)
9191
if err != nil {
9292
// Report disassembly error as program text
@@ -194,7 +194,7 @@ func valueDeltaToValueDelta(vd *basics.ValueDelta) basics.ValueDelta {
194194
}
195195
}
196196

197-
func (cx *evalContext) refreshDebugState() *DebugState {
197+
func (cx *EvalContext) refreshDebugState() *DebugState {
198198
ds := &cx.debugState
199199

200200
// Update pc, line, error, stack, and scratch space

0 commit comments

Comments
 (0)