@@ -135,15 +135,15 @@ func (k Keeper) DisableAllChannels(ctx sdk.Context) {
135
135
136
136
// SetCounterpartyAddress maps the destination chain relayer address to the source relayer address
137
137
// The receiving chain must store the mapping from: address -> counterpartyAddress for the given channel
138
- func (k Keeper ) SetCounterpartyAddress (ctx sdk.Context , address , counterpartyAddress string ) {
138
+ func (k Keeper ) SetCounterpartyAddress (ctx sdk.Context , address , counterpartyAddress , channelID string ) {
139
139
store := ctx .KVStore (k .storeKey )
140
- store .Set (types .KeyRelayerAddress (address ), []byte (counterpartyAddress ))
140
+ store .Set (types .KeyCounterpartyRelayer (address , channelID ), []byte (counterpartyAddress ))
141
141
}
142
142
143
143
// GetCounterpartyAddress gets the relayer counterparty address given a destination relayer address
144
- func (k Keeper ) GetCounterpartyAddress (ctx sdk.Context , address string ) (string , bool ) {
144
+ func (k Keeper ) GetCounterpartyAddress (ctx sdk.Context , address , channelID string ) (string , bool ) {
145
145
store := ctx .KVStore (k .storeKey )
146
- key := types .KeyRelayerAddress (address )
146
+ key := types .KeyCounterpartyRelayer (address , channelID )
147
147
148
148
if ! store .Has (key ) {
149
149
return "" , false
@@ -156,7 +156,7 @@ func (k Keeper) GetCounterpartyAddress(ctx sdk.Context, address string) (string,
156
156
// GetAllRelayerAddresses returns all registered relayer addresses
157
157
func (k Keeper ) GetAllRelayerAddresses (ctx sdk.Context ) []types.RegisteredRelayerAddress {
158
158
store := ctx .KVStore (k .storeKey )
159
- iterator := sdk .KVStorePrefixIterator (store , []byte (types .RelayerAddressKeyPrefix ))
159
+ iterator := sdk .KVStorePrefixIterator (store , []byte (types .CounterpartyRelayerAddressKeyPrefix ))
160
160
defer iterator .Close ()
161
161
162
162
var registeredAddrArr []types.RegisteredRelayerAddress
@@ -166,6 +166,7 @@ func (k Keeper) GetAllRelayerAddresses(ctx sdk.Context) []types.RegisteredRelaye
166
166
addr := types.RegisteredRelayerAddress {
167
167
Address : keySplit [1 ],
168
168
CounterpartyAddress : string (iterator .Value ()),
169
+ ChannelId : keySplit [2 ],
169
170
}
170
171
171
172
registeredAddrArr = append (registeredAddrArr , addr )
0 commit comments