-
Notifications
You must be signed in to change notification settings - Fork 0
/
callType.go
51 lines (43 loc) · 1.6 KB
/
callType.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package vm
// CallType specifies the type of SC invocation (in terms of asynchronicity)
type CallType int
const (
// DirectCall means that the call is an explicit SC invocation originating from a user Transaction
DirectCall CallType = iota
// AsynchronousCall means that the invocation was performed from within
// another SmartContract from another Shard, using asyncCall
AsynchronousCall
// AsynchronousCallBack means that an AsynchronousCall was performed
// previously, and now the control returns to the caller SmartContract's callBack method
AsynchronousCallBack
// DCTTransferAndExecute means that there is a smart contract execution after the DCT transfer
// this is needed in order to skip the check whether a contract is payable or not
DCTTransferAndExecute
// ExecOnDestByCaller means that the call is an invocation of a built in function / smart contract from
// another smart contract but the caller is from the previous caller
ExecOnDestByCaller
)
const (
DirectCallStr = "directCall"
AsynchronousCallStr = "asynchronousCall"
AsynchronousCallBackStr = "asynchronousCallBack"
DCTTransferAndExecuteStr = "dctTransferAndExecute"
ExecOnDestByCallerStr = "execOnDestByCaller"
UnknownStr = "unknown"
)
func (ct CallType) ToString() string {
switch ct {
case DirectCall:
return DirectCallStr
case AsynchronousCall:
return AsynchronousCallStr
case AsynchronousCallBack:
return AsynchronousCallBackStr
case DCTTransferAndExecute:
return DCTTransferAndExecuteStr
case ExecOnDestByCaller:
return ExecOnDestByCallerStr
default:
return UnknownStr
}
}