-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtypes_enum.go
More file actions
67 lines (57 loc) · 1.94 KB
/
Copy pathtypes_enum.go
File metadata and controls
67 lines (57 loc) · 1.94 KB
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
// Code generated by go-enum DO NOT EDIT.
// Version:
// Revision:
// Build Date:
// Built By:
package eth
import (
"fmt"
"strings"
)
const (
// TxTypeLegacy is a TransactionType of type Legacy.
TxTypeLegacy TransactionType = iota
// TxTypeAccessList is a TransactionType of type AccessList.
TxTypeAccessList
// TxTypeDynamicFee is a TransactionType of type DynamicFee.
TxTypeDynamicFee
)
const _TransactionTypeName = "LegacyAccessListDynamicFee"
var _TransactionTypeNames = []string{
_TransactionTypeName[0:6],
_TransactionTypeName[6:16],
_TransactionTypeName[16:26],
}
// TransactionTypeNames returns a list of possible string values of TransactionType.
func TransactionTypeNames() []string {
tmp := make([]string, len(_TransactionTypeNames))
copy(tmp, _TransactionTypeNames)
return tmp
}
var _TransactionTypeMap = map[TransactionType]string{
TxTypeLegacy: _TransactionTypeName[0:6],
TxTypeAccessList: _TransactionTypeName[6:16],
TxTypeDynamicFee: _TransactionTypeName[16:26],
}
// String implements the Stringer interface.
func (x TransactionType) String() string {
if str, ok := _TransactionTypeMap[x]; ok {
return str
}
return fmt.Sprintf("TransactionType(%d)", x)
}
var _TransactionTypeValue = map[string]TransactionType{
_TransactionTypeName[0:6]: TxTypeLegacy,
strings.ToLower(_TransactionTypeName[0:6]): TxTypeLegacy,
_TransactionTypeName[6:16]: TxTypeAccessList,
strings.ToLower(_TransactionTypeName[6:16]): TxTypeAccessList,
_TransactionTypeName[16:26]: TxTypeDynamicFee,
strings.ToLower(_TransactionTypeName[16:26]): TxTypeDynamicFee,
}
// ParseTransactionType attempts to convert a string to a TransactionType
func ParseTransactionType(name string) (TransactionType, error) {
if x, ok := _TransactionTypeValue[name]; ok {
return x, nil
}
return TransactionType(0), fmt.Errorf("%s is not a valid TransactionType, try [%s]", name, strings.Join(_TransactionTypeNames, ", "))
}