Skip to content

Commit

Permalink
feat: Add CreateValidator access control feature (#406)
Browse files Browse the repository at this point in the history
* feat: add consortium proto

* feat: add consortium module

* feat: add consortium to simapp

* refactor: new protos

* refactor: consortium module

* refactor: simapp

* test: add unit-tests for consortium

* feat: do not use hooks and endblocker of consortium

* feat: introduce stakingplus and replace staking with it

* chore: lint

* chore: cleanup unused codes and add additional infos to errors

* chore: lint

* chore: revert hooks and blocker formats

* docs: update CHANGELOG

* chore: fix var names and comments

* chore: lint

* refactor: apply feedbacks

* feat: add event proto for consortium

* feat: emit events in consortium proposals

* docs: add consortium apis to config

* refactor: remove deprecated REST handlers
  • Loading branch information
0Tech committed Dec 23, 2021
1 parent 57f3a38 commit 0e7b3cf
Show file tree
Hide file tree
Showing 45 changed files with 6,228 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* (x/wasm) [\#358] (https://github.com/line/lbm-sdk/pull/358) change wasm metrics method to using prometheus directly
* (x/feegrant) [\#380] (https://github.com/line/lbm-sdk/pull/380) Feegrant module
* (x/wasm) [\#395] (https://github.com/line/lbm-sdk/pull/395) Add the instantiate_permission in the CodeInfoResponse
* (x/consortium) [\#406] (https://github.com/line/lbm-sdk/pull/406) Add CreateValidator access control feature

### Improvements
* (slashing) [\#347](https://github.com/line/lbm-sdk/pull/347) Introduce VoterSetCounter
Expand Down
10 changes: 9 additions & 1 deletion client/docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@
},
{
"url": "./tmp-swagger-gen/lbm/wasm/v1/query.swagger.json"
}
},
{
"url": "./tmp-swagger-gen/lbm/consortium/v1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "ConsortiumParams"
}
}
},
]
}
3 changes: 2 additions & 1 deletion client/docs/statik/statik.go

Large diffs are not rendered by default.

287 changes: 287 additions & 0 deletions client/docs/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33321,6 +33321,216 @@ paths:
format: boolean
tags:
- Query
/lbm/consortium/v1/params:
get:
summary: Params queries the module params.
operationId: ConsortiumParams
responses:
'200':
description: A successful response.
schema:
type: object
properties:
params:
type: object
properties:
enabled:
type: boolean
format: boolean
description: Params defines the parameters for the consortium module.
description: >-
QueryParamsResponse is the response type for the Query/Params RPC
method.
default:
description: An unexpected error response
schema:
type: object
properties:
error:
type: string
code:
type: integer
format: int32
message:
type: string
details:
type: array
items:
type: object
properties:
type_url:
type: string
value:
type: string
format: byte
tags:
- Query
/lbm/consortium/v1/validators:
get:
summary: ValidatorAuths queries authorization infos of validators.
operationId: ValidatorAuths
responses:
'200':
description: A successful response.
schema:
type: object
properties:
auths:
type: array
items:
type: object
properties:
operator_address:
type: string
creation_allowed:
type: boolean
format: boolean
description: ValidatorAuth defines authorization info of a validator.
pagination:
description: pagination defines the pagination in the response.
type: object
properties:
next_key:
type: string
format: byte
title: |-
next_key is the key to be passed to PageRequest.key to
query the next page most efficiently
total:
type: string
format: uint64
title: >-
total is total number of results available if
PageRequest.count_total

was set, its value is undefined otherwise
description: |-
QueryValidatorAuthsResponse is the response type for the
Query/ValidatorAuths RPC method.
default:
description: An unexpected error response
schema:
type: object
properties:
error:
type: string
code:
type: integer
format: int32
message:
type: string
details:
type: array
items:
type: object
properties:
type_url:
type: string
value:
type: string
format: byte
parameters:
- name: pagination.key
description: |-
key is a value returned in PageResponse.next_key to begin
querying the next page most efficiently. Only one of offset or key
should be set.
in: query
required: false
type: string
format: byte
- name: pagination.offset
description: >-
offset is a numeric offset that can be used when key is unavailable.

It is less efficient than using key. Only one of offset or key
should

be set.
in: query
required: false
type: string
format: uint64
- name: pagination.limit
description: >-
limit is the total number of results to be returned in the result
page.

If left empty it will default to a value to be set by each app.
in: query
required: false
type: string
format: uint64
- name: pagination.count_total
description: >-
count_total is set to true to indicate that the result set should
include

a count of the total number of items available for pagination in
UIs.

count_total is only respected when offset is used. It is ignored
when key

is set.
in: query
required: false
type: boolean
format: boolean
tags:
- Query
'/lbm/consortium/v1/validators/{validator_address}':
get:
summary: ValidatorAuth queries authorization info of a validator.
operationId: ValidatorAuth
responses:
'200':
description: A successful response.
schema:
type: object
properties:
auth:
type: object
properties:
operator_address:
type: string
creation_allowed:
type: boolean
format: boolean
description: ValidatorAuth defines authorization info of a validator.
description: |-
QueryValidatorAuthResponse is the request type for the
Query/ValidatorAuth RPC method.
default:
description: An unexpected error response
schema:
type: object
properties:
error:
type: string
code:
type: integer
format: int32
message:
type: string
details:
type: array
items:
type: object
properties:
type_url:
type: string
value:
type: string
format: byte
parameters:
- name: validator_address
description: validator_address defines the validator address to query for.
in: path
required: true
type: string
tags:
- Query
securityDefinitions:
kms:
type: basic
Expand Down Expand Up @@ -54642,3 +54852,80 @@ definitions:
title: |-
QuerySmartContractStateResponse is the response type for the
Query/SmartContractState RPC method
lbm.consortium.v1.Params:
type: object
properties:
enabled:
type: boolean
format: boolean
description: Params defines the parameters for the consortium module.
lbm.consortium.v1.QueryParamsResponse:
type: object
properties:
params:
type: object
properties:
enabled:
type: boolean
format: boolean
description: Params defines the parameters for the consortium module.
description: QueryParamsResponse is the response type for the Query/Params RPC method.
lbm.consortium.v1.QueryValidatorAuthResponse:
type: object
properties:
auth:
type: object
properties:
operator_address:
type: string
creation_allowed:
type: boolean
format: boolean
description: ValidatorAuth defines authorization info of a validator.
description: |-
QueryValidatorAuthResponse is the request type for the
Query/ValidatorAuth RPC method.
lbm.consortium.v1.QueryValidatorAuthsResponse:
type: object
properties:
auths:
type: array
items:
type: object
properties:
operator_address:
type: string
creation_allowed:
type: boolean
format: boolean
description: ValidatorAuth defines authorization info of a validator.
pagination:
description: pagination defines the pagination in the response.
type: object
properties:
next_key:
type: string
format: byte
title: |-
next_key is the key to be passed to PageRequest.key to
query the next page most efficiently
total:
type: string
format: uint64
title: >-
total is total number of results available if
PageRequest.count_total

was set, its value is undefined otherwise
description: |-
QueryValidatorAuthsResponse is the response type for the
Query/ValidatorAuths RPC method.
lbm.consortium.v1.ValidatorAuth:
type: object
properties:
operator_address:
type: string
creation_allowed:
type: boolean
format: boolean
description: ValidatorAuth defines authorization info of a validator.
Loading

0 comments on commit 0e7b3cf

Please sign in to comment.