-
Notifications
You must be signed in to change notification settings - Fork 2
/
types.go
39 lines (33 loc) · 1.13 KB
/
types.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
package contract
// BridgeContract is an enum containing supported contract names
type BridgeContract int
const (
// BridgeRegistry registers deployed addresses of the other contracts
BridgeRegistry BridgeContract = iota + 1
// Valset manages the validator set and signature verification
Valset
// Oracle enables validators to make OracleClaims and processes ProphecyClaims
Oracle
// CosmosBridge enables validators to make ProphecyClaims
CosmosBridge
// BridgeBank manages protocol assets on both Ethereum and Cosmos
BridgeBank
)
// BridgeContractToString returns the string associated with a BridgeContract
var BridgeContractToString = [...]string{"BridgeRegistry", "Valset", "Oracle", "CosmosBridge", "BridgeBank"}
// String returns the BridgeContract as a string
func (d BridgeContract) String() string {
return BridgeContractToString[d-1]
}
// BridgeContracts is a slice of BridgeContract
type BridgeContracts []BridgeContract
// LoadBridgeContracts loads populated slice of BridgeContract
func LoadBridgeContracts() BridgeContracts {
return BridgeContracts{
BridgeRegistry,
Valset,
Oracle,
CosmosBridge,
BridgeBank,
}
}