Add Slashing Query Params (#3117)
This commit is contained in:
committed by
Jack Zampolin
parent
65beea4430
commit
110fd63e22
@@ -26,6 +26,7 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/x/auth"
|
||||
authrest "github.com/cosmos/cosmos-sdk/x/auth/client/rest"
|
||||
"github.com/cosmos/cosmos-sdk/x/gov"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing"
|
||||
"github.com/cosmos/cosmos-sdk/x/stake"
|
||||
stakeTypes "github.com/cosmos/cosmos-sdk/x/stake/types"
|
||||
)
|
||||
@@ -741,3 +742,15 @@ func TestProposalsQuery(t *testing.T) {
|
||||
require.True(t, addrs[0].String() == votes[0].Voter.String() || addrs[0].String() == votes[1].Voter.String())
|
||||
require.True(t, addrs[1].String() == votes[0].Voter.String() || addrs[1].String() == votes[1].Voter.String())
|
||||
}
|
||||
|
||||
func TestSlashingGetParams(t *testing.T) {
|
||||
cleanup, _, _, port := InitializeTestLCD(t, 1, []sdk.AccAddress{})
|
||||
defer cleanup()
|
||||
|
||||
res, body := Request(t, port, "GET", "/slashing/parameters", nil)
|
||||
require.Equal(t, http.StatusOK, res.StatusCode, body)
|
||||
|
||||
var params slashing.Params
|
||||
err := cdc.UnmarshalJSON([]byte(body), ¶ms)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
@@ -1187,6 +1187,35 @@ paths:
|
||||
description: Key password is wrong
|
||||
500:
|
||||
description: Internal Server Error
|
||||
/slashing/parameters:
|
||||
get:
|
||||
summary: Get the current slashing parameters
|
||||
tags:
|
||||
- ICS23
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
200:
|
||||
description: OK
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
max_evidence_age:
|
||||
type: integer
|
||||
signed_blocks_window:
|
||||
type: integer
|
||||
min_signed_per_window:
|
||||
type: integer
|
||||
double_sign_unbond_duration:
|
||||
type: integer
|
||||
downtime_unbond_duration:
|
||||
type: integer
|
||||
slash_fraction_double_sign:
|
||||
type: integer
|
||||
slash_fraction_downtime:
|
||||
type: integer
|
||||
500:
|
||||
description: Internal Server Error
|
||||
/gov/proposals:
|
||||
post:
|
||||
summary: Submit a proposal
|
||||
|
||||
Reference in New Issue
Block a user