diff --git a/cmd/dev.go b/cmd/dev.go index ab432c626..faced2550 100644 --- a/cmd/dev.go +++ b/cmd/dev.go @@ -134,7 +134,7 @@ func faucetService() *cobra.Command { if err != nil { return err } - _, err = sdk.ParseCoin(args[4]) + _, err = sdk.ParseCoinNormalized(args[4]) if err != nil { return err } diff --git a/cmd/raw.go b/cmd/raw.go index f03e1e017..dfb31f1c7 100644 --- a/cmd/raw.go +++ b/cmd/raw.go @@ -101,13 +101,8 @@ func createClientCmd() *cobra.Command { return err } - consensusParams, err := chains[dst].QueryConsensusParams() - if err != nil { - return err - } - return sendAndPrint([]sdk.Msg{chains[src].PathEnd.CreateClient(dstHeader, - chains[dst].GetTrustingPeriod(), ubdPeriod, consensusParams, chains[src].MustGetAddress())}, + chains[dst].GetTrustingPeriod(), ubdPeriod, chains[src].MustGetAddress())}, chains[src], cmd) }, } diff --git a/cmd/testnets.go b/cmd/testnets.go index 0b2eebd78..b8218b4f7 100644 --- a/cmd/testnets.go +++ b/cmd/testnets.go @@ -109,7 +109,7 @@ func faucetStartCmd() *cobra.Command { if err != nil { return err } - amount, err := sdk.ParseCoins(args[2]) + amount, err := sdk.ParseCoinsNormalized(args[2]) if err != nil { return err } diff --git a/cmd/xfer.go b/cmd/xfer.go index f7963333a..99863c57a 100644 --- a/cmd/xfer.go +++ b/cmd/xfer.go @@ -35,7 +35,7 @@ func xfersend() *cobra.Command { return err } - amount, err := sdk.ParseCoin(args[2]) + amount, err := sdk.ParseCoinNormalized(args[2]) if err != nil { return err } diff --git a/go.mod b/go.mod index 81102b015..fb54ea85e 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/avast/retry-go v2.6.0+incompatible github.com/cenkalti/backoff/v3 v3.2.2 // indirect github.com/containerd/continuity v0.0.0-20200928162600-f2cc35102c2a // indirect - github.com/cosmos/cosmos-sdk v0.40.0-rc3 + github.com/cosmos/cosmos-sdk v0.40.0-rc3.0.20201125180210-512b533242d3 github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d github.com/gogo/protobuf v1.3.1 github.com/gorilla/mux v1.8.0 @@ -17,8 +17,8 @@ require ( github.com/spf13/cobra v1.1.1 github.com/spf13/viper v1.7.1 github.com/stretchr/testify v1.6.1 - github.com/tendermint/tendermint v0.34.0-rc6 - github.com/tendermint/tm-db v0.6.2 + github.com/tendermint/tendermint v0.34.0 + github.com/tendermint/tm-db v0.6.3 golang.org/x/net v0.0.0-20201031054903-ff519b6c9102 // indirect golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e golang.org/x/sys v0.0.0-20201101102859-da207088b7d1 // indirect diff --git a/go.sum b/go.sum index afa448847..13c68245e 100644 --- a/go.sum +++ b/go.sum @@ -131,11 +131,15 @@ github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfc github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/cosmos-sdk v0.40.0-rc3 h1:sS9BZ82dOxXiZPZdfrzSniEAzLLN0oTP5lFVyjnq2x4= github.com/cosmos/cosmos-sdk v0.40.0-rc3/go.mod h1:eKgbkQO4FEvC+a1+eyRuL7UgluGK1ad4PufPTpQc6ZA= +github.com/cosmos/cosmos-sdk v0.40.0-rc3.0.20201125180210-512b533242d3 h1:JiRRwOJRsdCLZtsZ/9u7UzgnhkLfYxB2DCX5xl8rfUo= +github.com/cosmos/cosmos-sdk v0.40.0-rc3.0.20201125180210-512b533242d3/go.mod h1:U5Twv5RC7xsCvExSjjS2HbDhu5bxKM/fRosQ3KR5JUI= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d h1:49RLWk1j44Xu4fjHb6JFYmeUnDORVwHNkDxaQ0ctCVU= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/iavl v0.15.0-rc3.0.20201009144442-230e9bdf52cd/go.mod h1:3xOIaNNX19p0QrX0VqWa6voPRoJRGGYtny+DH8NEPvE= github.com/cosmos/iavl v0.15.0-rc4 h1:P1wmET7BueqCzfxsn+BzVkDWDLY9ij2JNwkbIdM7RG8= github.com/cosmos/iavl v0.15.0-rc4/go.mod h1:5CsecJdh44Uj4vZ6WSPeWq84hNW5BwRI36ZsAbfJvRw= +github.com/cosmos/iavl v0.15.0-rc5 h1:AMKgaAjXwGANWv56NL4q4hV+a0puSkLYD6cCQAv3i44= +github.com/cosmos/iavl v0.15.0-rc5/go.mod h1:WqoPL9yPTQ85QBMT45OOUzPxG/U/JcJoN7uMjgxke/I= github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4= github.com/cosmos/ledger-cosmos-go v0.11.1/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= github.com/cosmos/ledger-go v0.9.2 h1:Nnao/dLwaVTk1Q5U9THldpUMMXU94BOTWPddSmVB6pI= @@ -301,6 +305,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/grpc-ecosystem/grpc-gateway v1.14.7/go.mod h1:oYZKL012gGh6LMyg/xA7Q2yq6j8bu0wa+9w14EEthWU= github.com/grpc-ecosystem/grpc-gateway v1.15.2 h1:HC+hWRWf+v5zTMPyoaYTKIJih+4sd4XRWmj0qlG87Co= github.com/grpc-ecosystem/grpc-gateway v1.15.2/go.mod h1:vO11I9oWA+KsxmfFQPhLnnIb1VDE24M+pdxZFiuZcA8= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= @@ -525,6 +531,8 @@ github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8b github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.14.0 h1:RHRyE8UocrbjU+6UvRzwi6HjiDfxrrBU91TtbKzkGp4= github.com/prometheus/common v0.14.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/common v0.15.0 h1:4fgOnadei3EZvgRwxJ7RMpG1k1pOZth5Pc13tyspaKM= +github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -629,8 +637,12 @@ github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoM github.com/tendermint/tendermint v0.34.0-rc4/go.mod h1:yotsojf2C1QBOw4dZrTcxbyxmPUrT4hNuOQWX9XUwB4= github.com/tendermint/tendermint v0.34.0-rc6 h1:SVuKGvvE22KxfuK8QUHctUrmOWJsncZSYXIYtcnoKN0= github.com/tendermint/tendermint v0.34.0-rc6/go.mod h1:ugzyZO5foutZImv0Iyx/gOFCX6mjJTgbLHTwi17VDVg= +github.com/tendermint/tendermint v0.34.0 h1:eXCfMgoqVSzrjzOj6clI9GAejcHH0LvOlRjpCmMJksU= +github.com/tendermint/tendermint v0.34.0/go.mod h1:Aj3PIipBFSNO21r+Lq3TtzQ+uKESxkbA3yo/INM4QwQ= github.com/tendermint/tm-db v0.6.2 h1:DOn8jwCdjJblrCFJbtonEIPD1IuJWpbRUUdR8GWE4RM= github.com/tendermint/tm-db v0.6.2/go.mod h1:GYtQ67SUvATOcoY8/+x6ylk8Qo02BQyLrAs+yAcLvGI= +github.com/tendermint/tm-db v0.6.3 h1:ZkhQcKnB8/2jr5EaZwGndN4owkPsGezW2fSisS9zGbg= +github.com/tendermint/tm-db v0.6.3/go.mod h1:lfA1dL9/Y/Y8wwyPp2NMLyn5P5Ptr/gvDFNWtrCWSf8= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= @@ -679,6 +691,8 @@ golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee h1:4yd7jl+vXjalO5ztz6Vc1VADv+S/80LGJmyl1ROJ2AI= golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E= +golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -730,6 +744,7 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrS golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc h1:zK/HqS5bZxDptfPJNq8v7vJfXtkU7r9TLIoSr1bXaP4= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200930145003-4acb6c075d10 h1:YfxMZzv3PjGonQYNUaeU2+DhAdqOxerQ30JFB6WgAXo= golang.org/x/net v0.0.0-20200930145003-4acb6c075d10/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102 h1:42cLlJJdEh+ySyeUUbEQ5bsTiq8voBeTuweGVkY6Puw= @@ -866,6 +881,8 @@ google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEY google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201014134559-03b6142f0dc9 h1:fG84H9C3EXfuDlzkG+VEPDYHHExklP6scH1QZ5gQTqU= google.golang.org/genproto v0.0.0-20201014134559-03b6142f0dc9/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201111145450-ac7456db90a6 h1:iRN4+t0lvZX/l9gH14ARF9i58tsVa5a97k6aH95rC3Y= +google.golang.org/genproto v0.0.0-20201111145450-ac7456db90a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -888,6 +905,9 @@ google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.0 h1:IBKSUNL2uBS2DkJBncPP+TwT0sp9tgA8A75NjHt6umg= google.golang.org/grpc v1.33.0/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/relayer/client-tx.go b/relayer/client-tx.go index ff825f0a6..c9f278afc 100644 --- a/relayer/client-tx.go +++ b/relayer/client-tx.go @@ -26,15 +26,10 @@ func (c *Chain) CreateClients(dst *Chain) (err error) { if err != nil { return err } - consensusParams, err := dst.QueryConsensusParams() - if err != nil { - return err - } msg := c.PathEnd.CreateClient( dstH, dst.GetTrustingPeriod(), ubdPeriod, - consensusParams, c.MustGetAddress(), ) clients.Src = append(clients.Src, msg) @@ -49,15 +44,10 @@ func (c *Chain) CreateClients(dst *Chain) (err error) { if err != nil { return err } - consensusParams, err := c.QueryConsensusParams() - if err != nil { - return err - } msg := dst.PathEnd.CreateClient( srcH, c.GetTrustingPeriod(), ubdPeriod, - consensusParams, dst.MustGetAddress(), ) clients.Dst = append(clients.Dst, msg) diff --git a/relayer/headers.go b/relayer/headers.go index 1ef77b854..7c22397ed 100644 --- a/relayer/headers.go +++ b/relayer/headers.go @@ -144,5 +144,5 @@ func MustGetHeight(h ibcexported.Height) uint64 { if !ok { panic("height is not an instance of height! wtf") } - return height.GetVersionHeight() + return height.GetRevisionHeight() } diff --git a/relayer/naive-strategy.go b/relayer/naive-strategy.go index 55d90d20d..c08173ff6 100644 --- a/relayer/naive-strategy.go +++ b/relayer/naive-strategy.go @@ -707,7 +707,7 @@ func relayPacketsFromResultTx(src, dst *PathEnd, res *ctypes.ResultTx, sh *SyncH switch { // If the packet has a timeout height, and it has been reached, return a timeout packet - case rp.timeout != 0 && block.GetHeight().GetVersionHeight() >= rp.timeout: + case rp.timeout != 0 && block.GetHeight().GetRevisionHeight() >= rp.timeout: timeoutPackets = append(timeoutPackets, rp.timeoutPacket()) // If the packet has a timeout timestamp and it has been reached, return a timeout packet case rp.timeoutStamp != 0 && block.GetTime().UnixNano() >= int64(rp.timeoutStamp): diff --git a/relayer/pathEnd.go b/relayer/pathEnd.go index b2f036295..e39bbba5b 100644 --- a/relayer/pathEnd.go +++ b/relayer/pathEnd.go @@ -12,7 +12,6 @@ import ( commitmenttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/23-commitment/types" ibcexported "github.com/cosmos/cosmos-sdk/x/ibc/core/exported" tmclient "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/07-tendermint/types" - abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/light" ) @@ -81,7 +80,6 @@ func (pe *PathEnd) UpdateClient(dstHeader ibcexported.Header, signer sdk.AccAddr func (pe *PathEnd) CreateClient( dstHeader *tmclient.Header, trustingPeriod, unbondingPeriod time.Duration, - consensusParams *abci.ConsensusParams, signer sdk.AccAddress) sdk.Msg { if err := dstHeader.ValidateBasic(); err != nil { panic(err) @@ -95,9 +93,8 @@ func (pe *PathEnd) CreateClient( unbondingPeriod, time.Minute*10, dstHeader.GetHeight().(clienttypes.Height), - consensusParams, commitmenttypes.GetSDKSpecs(), - "upgrade/upgradedClient", + []string{"upgrade", "upgradedClient"}, false, false, ) @@ -122,9 +119,7 @@ func (pe *PathEnd) CreateClient( func (pe *PathEnd) ConnInit(dst *PathEnd, signer sdk.AccAddress) sdk.Msg { var version *conntypes.Version return conntypes.NewMsgConnectionOpenInit( - pe.ConnectionID, pe.ClientID, - dst.ConnectionID, dst.ClientID, defaultChainPrefix, version, @@ -146,7 +141,6 @@ func (pe *PathEnd) ConnTry( panic(err) } msg := conntypes.NewMsgConnectionOpenTry( - pe.ConnectionID, pe.ConnectionID, pe.ClientID, dst.ConnectionID, @@ -209,12 +203,10 @@ func (pe *PathEnd) ConnConfirm(dstConnState *conntypes.QueryConnectionResponse, func (pe *PathEnd) ChanInit(dst *PathEnd, signer sdk.AccAddress) sdk.Msg { return chantypes.NewMsgChannelOpenInit( pe.PortID, - pe.ChannelID, pe.Version, pe.GetOrder(), []string{pe.ConnectionID}, dst.PortID, - dst.ChannelID, signer, ) } @@ -224,7 +216,6 @@ func (pe *PathEnd) ChanTry(dst *PathEnd, dstChanState *chantypes.QueryChannelRes return chantypes.NewMsgChannelOpenTry( pe.PortID, pe.ChannelID, - pe.ChannelID, pe.Version, dstChanState.Channel.Ordering, []string{pe.ConnectionID}, diff --git a/relayer/query.go b/relayer/query.go index a51bd46f1..85f234c09 100644 --- a/relayer/query.go +++ b/relayer/query.go @@ -9,6 +9,7 @@ import ( "strings" "time" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/store/rootmulti" sdk "github.com/cosmos/cosmos-sdk/types" @@ -331,9 +332,9 @@ func (c *Chain) QueryDenomTraces(offset, limit uint64, height int64) (*transfert // QueryHistoricalInfo returns historical header data func (c *Chain) QueryHistoricalInfo(height clienttypes.Height) (*stakingtypes.QueryHistoricalInfoResponse, error) { //TODO: use epoch number in query once SDK gets updated - qc := stakingtypes.NewQueryClient(c.CLIContext(int64(height.GetVersionHeight()))) + qc := stakingtypes.NewQueryClient(c.CLIContext(int64(height.GetRevisionHeight()))) return qc.HistoricalInfo(context.Background(), &stakingtypes.QueryHistoricalInfoRequest{ - Height: int64(height.GetVersionHeight()), + Height: int64(height.GetRevisionHeight()), }) } @@ -377,11 +378,11 @@ func (c *Chain) toTmValidator(val stakingtypes.Validator) (*tmtypes.Validator, e if err := c.Encoding.Marshaler.UnpackAny(val.ConsensusPubkey, &pk); err != nil { return nil, err } - intoTmPk, ok := pk.(cryptotypes.IntoTmPubKey) - if !ok { - return nil, fmt.Errorf("pubkey not a pub key *scratches head*") + tmkey, err := cryptocodec.ToTmPubKeyInterface(pk) + if err != nil { + return nil, fmt.Errorf("pubkey not a tendermint pub key %s", err) } - return tmtypes.NewValidator(intoTmPk.AsTmPubKey(), val.ConsensusPower()), nil + return tmtypes.NewValidator(tmkey, val.ConsensusPower()), nil } // QueryUnbondingPeriod returns the unbonding period of the chain