forked from miraclesu/uniswap-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
chainid_string.go
40 lines (34 loc) · 844 Bytes
/
chainid_string.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
// Code generated by "stringer -type=ChainID -linecomment"; DO NOT EDIT.
package constants
import "strconv"
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[Mainnet-1]
_ = x[Ropsten-3]
_ = x[Rinkeby-4]
_ = x[Goerli-5]
_ = x[Kovan-42]
}
const (
_ChainID_name_0 = "Mainnet"
_ChainID_name_1 = "RopstenRinkebyGoerli"
_ChainID_name_2 = "Kovan"
)
var (
_ChainID_index_1 = [...]uint8{0, 7, 14, 20}
)
func (i ChainID) String() string {
switch {
case i == 1:
return _ChainID_name_0
case 3 <= i && i <= 5:
i -= 3
return _ChainID_name_1[_ChainID_index_1[i]:_ChainID_index_1[i+1]]
case i == 42:
return _ChainID_name_2
default:
return "ChainID(" + strconv.FormatInt(int64(i), 10) + ")"
}
}