Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
kroggen committed Oct 3, 2024
1 parent 26ffd71 commit 52be58a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions contract/internal_operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ func getCurrentCall(ctx *vmContext) *InternalCall {
if depth == ctx.callDepth {
return opCall
}
if len(opCall.Operations) == 0 {
break
}
opCall = &opCall.Operations[len(opCall.Operations)-1].Call
depth++
}
Expand Down Expand Up @@ -97,6 +100,10 @@ func logOperationResult(ctx *vmContext, operationId int64, result string) {
defer opsLock.Unlock()

opCall := getCurrentCall(ctx)
if opCall == nil {
log.Printf("no call found")
return
}

for i := range opCall.Operations {
if opCall.Operations[i].Id == operationId {
Expand All @@ -114,6 +121,10 @@ func logInternalCall(ctx *vmContext, contract string, function string, args stri
}

opCall := getCurrentCall(ctx)
if opCall == nil {
log.Printf("no call found")
return nil
}

// get the last operation
op := &opCall.Operations[len(opCall.Operations)-1]
Expand Down
2 changes: 2 additions & 0 deletions contract/vm_direct/vm_direct.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,9 @@ func executeTx(

var txFee *big.Int
var rv string
var internalOps string
var events []*types.Event

switch txBody.Type {
case types.TxType_NORMAL, types.TxType_REDEPLOY, types.TxType_TRANSFER, types.TxType_CALL, types.TxType_DEPLOY:
rv, events, internalOps, txFee, err = contract.Execute(execCtx, bs, cdb, tx.GetTx(), sender, receiver, bi, executionMode, false)
Expand Down

0 comments on commit 52be58a

Please sign in to comment.