Skip to content

Commit

Permalink
Fix: interact script (#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky authored Apr 30, 2021
1 parent a6bbafc commit 9815b4e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion cmd/api/handlers/run_code.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,19 @@ func (ctx *Context) parseAppliedRunCode(response noderpc.RunCodeResponse, script
op.Protocol = main.Protocol
op.Level = main.Level
op.Internal = true
if err := setParameters(response.Operations[i].Parameters, script, &op); err != nil {

var s *ast.Script
if op.Destination == main.Destination {
s = script
} else {
var err error
s, err = ctx.getScript(op.Destination, op.Network, op.Protocol)
if err != nil {
return nil, err
}
}

if err := setParameters(response.Operations[i].Parameters, s, &op); err != nil {
return nil, err
}
if err := ctx.setSimulateStorageDiff(response, script, &op); err != nil {
Expand Down

0 comments on commit 9815b4e

Please sign in to comment.