* migrated channel genesis types to proto * connection genesis types migrated to proto * client proto migration * failing tests due to tendermint part incomplete * add genesis test * x/ibc: ClientState Any * add genesis test * suite NotPanics * comment tests * update export logic * refactor * update test * fix non-determinism * castrepeated * x/ibc: migrate simulations to protobuf * add proto genesis * add UnpackInterfaces func to genclientstate * add unpackinterfaces for consensus states * formatting * fix genesis tests * add modified genesis test * update comments * remove localhost register codec * use app registry * fix bug * Update simapp/app.go * Update x/ibc/02-client/types/genesis.go * unmarshaler interface Co-authored-by: Colin Axner <colinaxner@berkeley.edu> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
33 lines
1003 B
Go
33 lines
1003 B
Go
package simulation
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/cosmos/cosmos-sdk/types/kv"
|
|
clientsim "github.com/cosmos/cosmos-sdk/x/ibc/02-client/simulation"
|
|
connectionsim "github.com/cosmos/cosmos-sdk/x/ibc/03-connection/simulation"
|
|
channelsim "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/simulation"
|
|
host "github.com/cosmos/cosmos-sdk/x/ibc/24-host"
|
|
"github.com/cosmos/cosmos-sdk/x/ibc/keeper"
|
|
)
|
|
|
|
// NewDecodeStore returns a decoder function closure that unmarshals the KVPair's
|
|
// Value to the corresponding ibc type.
|
|
func NewDecodeStore(k keeper.Keeper) func(kvA, kvB kv.Pair) string {
|
|
return func(kvA, kvB kv.Pair) string {
|
|
if res, found := clientsim.NewDecodeStore(k.ClientKeeper, kvA, kvB); found {
|
|
return res
|
|
}
|
|
|
|
if res, found := connectionsim.NewDecodeStore(k.Codec(), kvA, kvB); found {
|
|
return res
|
|
}
|
|
|
|
if res, found := channelsim.NewDecodeStore(k.Codec(), kvA, kvB); found {
|
|
return res
|
|
}
|
|
|
|
panic(fmt.Sprintf("invalid %s key prefix: %s", host.ModuleName, string(kvA.Key)))
|
|
}
|
|
}
|