forked from NethermindEth/starknet.go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types_transaction_interfaces.go
87 lines (65 loc) · 1.9 KB
/
types_transaction_interfaces.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package rpc
type AddDeclareTxnInput interface{}
var _ AddDeclareTxnInput = DeclareTxnV1{}
var _ AddDeclareTxnInput = DeclareTxnV2{}
var _ AddDeclareTxnInput = DeclareTxnV3{}
type Transaction interface {
GetType() TransactionType
}
var _ Transaction = InvokeTxnV0{}
var _ Transaction = InvokeTxnV1{}
var _ Transaction = InvokeTxnV3{}
var _ Transaction = DeclareTxnV1{}
var _ Transaction = DeclareTxnV2{}
var _ Transaction = DeclareTxnV3{}
var _ Transaction = DeployTxn{}
var _ Transaction = DeployAccountTxn{}
var _ Transaction = DeployAccountTxnV3{}
var _ Transaction = L1HandlerTxn{}
func (tx InvokeTxnV0) GetType() TransactionType {
return tx.Type
}
func (tx InvokeTxnV1) GetType() TransactionType {
return tx.Type
}
func (tx InvokeTxnV3) GetType() TransactionType {
return tx.Type
}
func (tx DeclareTxnV0) GetType() TransactionType {
return tx.Type
}
func (tx DeclareTxnV1) GetType() TransactionType {
return tx.Type
}
func (tx DeclareTxnV2) GetType() TransactionType {
return tx.Type
}
func (tx DeclareTxnV3) GetType() TransactionType {
return tx.Type
}
func (tx DeployTxn) GetType() TransactionType {
return tx.Type
}
func (tx DeployAccountTxn) GetType() TransactionType {
return tx.Type
}
func (tx DeployAccountTxnV3) GetType() TransactionType {
return tx.Type
}
func (tx L1HandlerTxn) GetType() TransactionType {
return tx.Type
}
// Note: these allow all types to pass, but are to help users of starknet.go
// understand which types are allowed where.
type InvokeTxnType interface{}
var _ InvokeTxnType = InvokeTxnV0{}
var _ InvokeTxnType = InvokeTxnV1{}
var _ InvokeTxnType = InvokeTxnV3{}
type DeclareTxnType interface{}
var _ DeclareTxnType = DeclareTxnV0{}
var _ DeclareTxnType = DeclareTxnV1{}
var _ DeclareTxnType = DeclareTxnV2{}
var _ DeclareTxnType = DeclareTxnV3{}
type DeployAccountType interface{}
var _ DeployAccountType = DeployAccountTxn{}
var _ DeployAccountType = DeployAccountTxnV3{}