-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
En 7630/esdt sccall and invalid #2340
En 7630/esdt sccall and invalid #2340
Conversation
go.mod
Outdated
@@ -46,3 +46,5 @@ require ( | |||
) | |||
|
|||
replace github.com/gogo/protobuf => github.com/ElrondNetwork/protobuf v1.3.2 | |||
|
|||
replace github.com/ElrondNetwork/arwen-wasm-vm => ../arwen-wasm-vm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not forget to reference a commit here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do once arwen is in master
tx data.TransactionHandler, | ||
acntSnd, acntDst state.UserAccountHandler, | ||
) (vmcommon.ReturnCode, error) { | ||
builtInFuncCall bool, | ||
) (vmcommon.ReturnCode, *vmcommon.ContractCallInput, []byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are 4 output parameters. I think it would have been more extensible if an intermediate struct that aggregates all of them would have been used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there should be no more changes here.
process/smartContract/process.go
Outdated
} | ||
|
||
var vmExec vmcommon.VMExecutionHandler | ||
vmExec, err = findVMByTransaction(sc.vmContainer, tx) | ||
userErrorVmOutput := &vmcommon.VMOutput{ReturnCode: vmcommon.UserError} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
multiline?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
results, err = sc.processVMOutput(vmOutput, txHash, tx, acntSnd, vmInput.CallType, vmInput.GasProvided) | ||
if err != nil { | ||
log.Trace("process vm output returned with problem ", "err", err.Error()) | ||
return vmOutput.ReturnCode, sc.ProcessIfError(acntSnd, txHash, tx, err.Error(), []byte(vmOutput.ReturnMessage), snapshot) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a breaking change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think so. Will run importDB to fix whatever broken
process/smartContract/process.go
Outdated
return false, vmOutput, nil | ||
} | ||
|
||
userErrorVmOutput := &vmcommon.VMOutput{ReturnCode: vmcommon.UserError} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
multiline?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
go.mod
Outdated
@@ -46,3 +46,5 @@ require ( | |||
) | |||
|
|||
replace github.com/gogo/protobuf => github.com/ElrondNetwork/protobuf v1.3.2 | |||
|
|||
replace github.com/ElrondNetwork/arwen-wasm-vm => ../arwen-wasm-vm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove local version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will remove once arwen is in master
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
if isAsynchronousCallBack(tx) { | ||
if isBuiltInFunction { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I see we can get away with if isBuiltInFunction {...
outside of this if and remove it from line 100. There is no case where isBuiltInFunction == true
and we return something else.
At line 96 we can just have if !isDestInSelfShard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
… into EN-7630/ESDT-sccall-and-invalid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a description for this PR
Implemented calling a smart contract function after ESDT.
Implemented sending back the ESDT tokens if the transaction failed cross shard.