/
config.go
72 lines (61 loc) · 1.99 KB
/
config.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
package testing
import (
"time"
connectiontypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types"
channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types"
"github.com/cosmos/ibc-go/v4/modules/core/exported"
ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types"
"github.com/cosmos/ibc-go/v4/testing/mock"
)
/*
TODO: Remove after upgrading to ibc-go v5
legacy_ibc_testing is temporarily copied into the interchain-security repository for the purpose of testing only.
The integration test suites rely on modifications to ibc-go's test framework that cannot be back-ported to the canonical version that ics will rely on.
These files will be deprecated once ICS is able to upgrade to ibc-go v5.
*/
type ClientConfig interface {
GetClientType() string
}
type TendermintConfig struct {
TrustLevel ibctmtypes.Fraction
TrustingPeriod time.Duration
UnbondingPeriod time.Duration
MaxClockDrift time.Duration
AllowUpdateAfterExpiry bool
AllowUpdateAfterMisbehaviour bool
}
func NewTendermintConfig() *TendermintConfig {
return &TendermintConfig{
TrustLevel: DefaultTrustLevel,
TrustingPeriod: TrustingPeriod,
UnbondingPeriod: UnbondingPeriod,
MaxClockDrift: MaxClockDrift,
AllowUpdateAfterExpiry: false,
AllowUpdateAfterMisbehaviour: false,
}
}
func (tmcfg *TendermintConfig) GetClientType() string {
return exported.Tendermint
}
type ConnectionConfig struct {
DelayPeriod uint64
Version *connectiontypes.Version
}
func NewConnectionConfig() *ConnectionConfig {
return &ConnectionConfig{
DelayPeriod: DefaultDelayPeriod,
Version: ConnectionVersion,
}
}
type ChannelConfig struct {
PortID string
Version string
Order channeltypes.Order
}
func NewChannelConfig() *ChannelConfig {
return &ChannelConfig{
PortID: mock.PortID,
Version: DefaultChannelVersion,
Order: channeltypes.UNORDERED,
}
}