-
Notifications
You must be signed in to change notification settings - Fork 3.5k
/
keys.go
44 lines (34 loc) · 1.17 KB
/
keys.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
package types
import (
"github.com/tendermint/tendermint/crypto"
sdk "github.com/cosmos/cosmos-sdk/types"
)
const (
// ModuleName defines the IBC transfer name
ModuleName = "transfer"
// Version defines the current version the IBC tranfer
// module supports
Version = "ics20-1"
// PortID is the default port id that transfer module binds to
PortID = "transfer"
// StoreKey is the store key string for IBC transfer
StoreKey = ModuleName
// RouterKey is the message route for IBC transfer
RouterKey = ModuleName
// QuerierRoute is the querier route for IBC transfer
QuerierRoute = ModuleName
)
var (
// PortKey defines the key to store the port ID in store
PortKey = []byte{0x01}
// DenomTraceKey defines the key to store the denomination trace info in store
DenomTraceKey = []byte{0x02}
)
// GetEscrowAddress returns the escrow address for the specified channel
//
// CONTRACT: this assumes that there's only one bank bridge module that owns the
// port associated with the channel ID so that the address created is actually
// unique.
func GetEscrowAddress(portID, channelID string) sdk.AccAddress {
return sdk.AccAddress(crypto.AddressHash([]byte(portID + channelID)))
}