forked from strangelove-ventures/interchaintest
/
capability.go
35 lines (28 loc) · 1.24 KB
/
capability.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
package relayer
//go:generate go run golang.org/x/tools/cmd/stringer -type=Capability
// While the relayer capability type may have made a little more sense inside the interchaintest package,
// we would expect individual relayer implementations to specify their own capabilities.
// The interchaintest package depends on the relayer implementations,
// therefore the relayer capability type exists here to avoid a circular dependency.
// Capability indicates a relayer's support of a given feature.
type Capability int
// The list of relayer capabilities that interchaintest understands.
const (
TimestampTimeout Capability = iota
HeightTimeout
// Whether the relayer supports a one-off flush packets or flush acknowledgements command.
FlushPackets
FlushAcknowledgements
)
// FullCapabilities returns a mapping of all known relayer features to true,
// indicating that all features are supported.
// FullCapabilities returns a new map every time it is called,
// so callers are free to set one value to false if they support everything but one or two features.
func FullCapabilities() map[Capability]bool {
return map[Capability]bool{
TimestampTimeout: true,
HeightTimeout: true,
FlushPackets: true,
FlushAcknowledgements: true,
}
}