diff --git a/PENDING.md b/PENDING.md index 45a606016c13..14aac94a4bdc 100644 --- a/PENDING.md +++ b/PENDING.md @@ -25,6 +25,7 @@ BREAKING CHANGES * `gaiacli gov vote --voter` * [x/gov] Added tags sub-package, changed tags to use dash-case * [x/gov] Governance parameters are now stored in globalparams store +* [lcd] \#1866 Updated lcd /slashing/signing_info endpoint to take cosmosvalpub instead of cosmosvaladdr * [types] sdk.NewCoin now takes sdk.Int, sdk.NewInt64Coin takes int64 FEATURES diff --git a/client/lcd/lcd_test.go b/client/lcd/lcd_test.go index 25c47ba6d150..ee9ff96f9b56 100644 --- a/client/lcd/lcd_test.go +++ b/client/lcd/lcd_test.go @@ -526,8 +526,8 @@ func TestUnrevoke(t *testing.T) { // XXX: any less than this and it fails tests.WaitForHeight(3, port) - - signingInfo := getSigningInfo(t, port, sdk.ValAddress(pks[0].Address())) + pkString, _ := sdk.Bech32ifyValPub(pks[0]) + signingInfo := getSigningInfo(t, port, pkString) tests.WaitForHeight(4, port) require.Equal(t, true, signingInfo.IndexOffset > 0) require.Equal(t, int64(0), signingInfo.JailedUntil) @@ -710,8 +710,8 @@ func doIBCTransfer(t *testing.T, port, seed, name, password string, addr sdk.Acc return resultTx } -func getSigningInfo(t *testing.T, port string, validatorAddr sdk.ValAddress) slashing.ValidatorSigningInfo { - res, body := Request(t, port, "GET", fmt.Sprintf("/slashing/signing_info/%s", validatorAddr), nil) +func getSigningInfo(t *testing.T, port string, validatorPubKey string) slashing.ValidatorSigningInfo { + res, body := Request(t, port, "GET", fmt.Sprintf("/slashing/signing_info/%s", validatorPubKey), nil) require.Equal(t, http.StatusOK, res.StatusCode, body) var signingInfo slashing.ValidatorSigningInfo err := cdc.UnmarshalJSON([]byte(body), &signingInfo) diff --git a/x/slashing/client/rest/query.go b/x/slashing/client/rest/query.go index 123e235ce0a5..535a642d4285 100644 --- a/x/slashing/client/rest/query.go +++ b/x/slashing/client/rest/query.go @@ -25,16 +25,15 @@ func signingInfoHandlerFn(ctx context.CoreContext, storeName string, cdc *wire.C // read parameters vars := mux.Vars(r) - bech32validator := vars["validator"] - validatorAddr, err := sdk.ValAddressFromBech32(bech32validator) + pk, err := sdk.GetValPubKeyBech32(vars["validator"]) if err != nil { w.WriteHeader(http.StatusBadRequest) w.Write([]byte(err.Error())) return } - key := slashing.GetValidatorSigningInfoKey(validatorAddr) + key := slashing.GetValidatorSigningInfoKey(sdk.ValAddress(pk.Address())) res, err := ctx.QueryStore(key, storeName) if err != nil { w.WriteHeader(http.StatusInternalServerError)