Skip to content

Commit

Permalink
Added CouncilVotingTimeLimit
Browse files Browse the repository at this point in the history
  • Loading branch information
lxgr-linux committed Oct 17, 2023
1 parent e18992b commit b4e44ec
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 42 deletions.
12 changes: 12 additions & 0 deletions docs/static/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32948,6 +32948,10 @@ paths:
uniqueDropRatio:
type: string
format: uint64
councilVotingTimeLimit:
type: string
format: uint64
title: seconds till the council ends
description: >-
QueryParamsResponse is response type for the Query/Params RPC
method.
Expand Down Expand Up @@ -69301,6 +69305,10 @@ definitions:
uniqueDropRatio:
type: string
format: uint64
councilVotingTimeLimit:
type: string
format: uint64
title: seconds till the council ends
description: Params defines the parameters for the module.
DecentralCardGame.cardchain.cardchain.QueryParamsResponse:
type: object
Expand Down Expand Up @@ -69374,6 +69382,10 @@ definitions:
uniqueDropRatio:
type: string
format: uint64
councilVotingTimeLimit:
type: string
format: uint64
title: seconds till the council ends
description: QueryParamsResponse is response type for the Query/Params RPC method.
DecentralCardGame.cardchain.cardchain.QueryQCardContentResponse:
type: object
Expand Down
1 change: 1 addition & 0 deletions proto/cardchain/cardchain/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ message Params {
uint64 rareDropRatio = 22;
uint64 exceptionalDropRatio = 23;
uint64 uniqueDropRatio = 24;
uint64 councilVotingTimeLimit = 25; // seconds till the council ends
}
10 changes: 10 additions & 0 deletions x/cardchain/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func NewParams() Params {
RareDropRatio: 150,
ExceptionalDropRatio: 50,
UniqueDropRatio: 1,
CouncilVotingTimeLimit: 24 * 60 * 60, // One day
}
}

Expand Down Expand Up @@ -81,6 +82,7 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs {
paramtypes.NewParamSetPair([]byte("RareDropRatio"), &p.RareDropRatio, validateRareDropRatio),
paramtypes.NewParamSetPair([]byte("ExceptionalDropRatio"), &p.ExceptionalDropRatio, validateExceptionalDropRatio),
paramtypes.NewParamSetPair([]byte("UniqueDropRatio"), &p.UniqueDropRatio, validateUniqueDropRatio),
paramtypes.NewParamSetPair([]byte("CouncilVotingTimeLimit"), &p.CouncilVotingTimeLimit, validateCouncilVotingTimeLimit),
}
}

Expand Down Expand Up @@ -333,3 +335,11 @@ func validateUniqueDropRatio(i interface{}) error {
}
return nil
}

func validateCouncilVotingTimeLimit(i interface{}) error {
_, ok := i.(uint64)
if !ok {
return fmt.Errorf("invalid parameter type: %T", i)
}
return nil
}
123 changes: 81 additions & 42 deletions x/cardchain/types/params.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b4e44ec

Please sign in to comment.