Skip to content

Commit

Permalink
e2e test seems to be working
Browse files Browse the repository at this point in the history
  • Loading branch information
ahangsu committed Jun 9, 2023
1 parent e60db71 commit 60f7d3f
Show file tree
Hide file tree
Showing 3 changed files with 1,379 additions and 146 deletions.
1 change: 1 addition & 0 deletions ledger/simulation/simulation_eval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1972,6 +1972,7 @@ func TestMaxDepthAppWithPCTrace(t *testing.T) {
},
TraceConfig: simulation.ExecTraceConfig{
Enable: true,
Stack: true,
},
},
developerAPI: true,
Expand Down
32 changes: 22 additions & 10 deletions ledger/simulation/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,17 @@ func (o *OpcodeTraceUnit) appendDeletedStackValue(cx *logic.EvalContext, tracer
return
}
for i := stackHeightAfterDeletion; i < stackHeight; i++ {
o.Deleted = append(o.Deleted, TealValue{
Type: stackCopy[i].TEALType(),
Bytes: string(stackCopy[i].Bytes),
Uint: stackCopy[i].Uint,
})
if stackCopy[i].TEALType() == basics.TealBytesType {
o.Deleted = append(o.Deleted, TealValue{
Type: basics.TealBytesType,
Bytes: string(stackCopy[i].Bytes),
})
} else {
o.Deleted = append(o.Deleted, TealValue{
Type: basics.TealUintType,
Uint: stackCopy[i].Uint,
})
}
}
}

Expand Down Expand Up @@ -305,11 +311,17 @@ func (o *OpcodeTraceUnit) appendAddedStackValue(cx *logic.EvalContext, tracer *e
}
stackCopy := cx.Stack()
for i := tracer.stackHeightAfterDeletion; i < len(stackCopy); i++ {
o.Added = append(o.Added, TealValue{
Type: stackCopy[i].TEALType(),
Bytes: string(stackCopy[i].Bytes),
Uint: stackCopy[i].Uint,
})
if stackCopy[i].TEALType() == basics.TealBytesType {
o.Added = append(o.Added, TealValue{
Type: basics.TealBytesType,
Bytes: string(stackCopy[i].Bytes),
})
} else {
o.Added = append(o.Added, TealValue{
Type: basics.TealUintType,
Uint: stackCopy[i].Uint,
})
}
}
}

Expand Down

0 comments on commit 60f7d3f

Please sign in to comment.