Skip to content

Commit

Permalink
feat: add inactive contract management in wasm (#655)
Browse files Browse the repository at this point in the history
* feat: add inactive contract management in wasm.

Signed-off-by: zemyblue <[email protected]>

* chore: add unittest in the x/wasm/lbm/keeper

Signed-off-by: zemyblue <[email protected]>

* chore: fix lint warning

Signed-off-by: zemyblue <[email protected]>

* chore: fix lint warning

Signed-off-by: zemyblue <[email protected]>

* feat: add proposal cli and unittest of lbm wasm

Signed-off-by: zemyblue <[email protected]>

* fix: lint warning

Signed-off-by: zemyblue <[email protected]>

* feat: add contract blacklist function
 - add inactive_contract_addresses in genesisStatus
 - modify Params of wasm
 - add custom tx and queries

Signed-off-by: zemyblue <[email protected]>

* chore: add wasm genesis for `TestProposalActivateContractCmd`

Signed-off-by: zemyblue <[email protected]>

* chore: change private `setParams` to public `SetParams` function of wasm.Keeper.
And change to proper gas data in unittest.

Signed-off-by: zemyblue <[email protected]>

* chore: change CHANGELOG

Signed-off-by: zemyblue <[email protected]>

* chore: apply review feedback

Signed-off-by: zemyblue <[email protected]>

* chore: apply review feedback(2)
 - response error if there isn't contract address in chain

Signed-off-by: zemyblue <[email protected]>

* chore: apply review feedback(3)

Signed-off-by: zemyblue <[email protected]>

* chore: apply review feedback(4)

Signed-off-by: zemyblue <[email protected]>

* fix: remove unsupported flags

Signed-off-by: zemyblue <[email protected]>

* fix: fix lint warning.

Signed-off-by: zemyblue <[email protected]>

* chore: unify the period point of the comment.

Signed-off-by: zemyblue <[email protected]>

* chore: unify comment period point

Signed-off-by: zemyblue <[email protected]>

Signed-off-by: zemyblue <[email protected]>
  • Loading branch information
zemyblue authored Sep 5, 2022
1 parent 0f5056f commit 6411ce4
Show file tree
Hide file tree
Showing 74 changed files with 4,723 additions and 2,005 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/collection) [\#608](https://github.com/line/lbm-sdk/pull/608) remove new APIs on x/collection
* (x/token) [\#609](https://github.com/line/lbm-sdk/pull/609) remove new APIs on x/token
* (x/wasm) [\#625](https://github.com/line/lbm-sdk/pull/625) detaching `StoreCodeAndInstantiateContract` from wasm's tx.proto
* (x/wasm) [\#655](https://github.com/line/lbm-sdk/pull/655) add inactive contract management in wasm (This replaces the contract blacklist function of contractStatus)

### Bug Fixes
* (x/wasm) [\#453](https://github.com/line/lbm-sdk/pull/453) modify wasm grpc query api path
Expand Down
3 changes: 3 additions & 0 deletions client/docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@
"Params": "FeegrantParams"
}
}
},
{
"url": "./tmp-swagger-gen/lbm/wasm/v1/query.swagger.json"
}
]
}
2 changes: 1 addition & 1 deletion client/docs/statik/statik.go

Large diffs are not rendered by default.

224 changes: 224 additions & 0 deletions client/docs/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44038,6 +44038,183 @@ paths:
format: boolean
tags:
- Query
/lbm/wasm/v1/inactive_contracts:
get:
summary: InactiveContracts queries all inactive contracts
operationId: InactiveContracts
responses:
'200':
description: A successful response.
schema:
type: object
properties:
addresses:
type: array
items:
type: string
title: addresses is the inactive address list
pagination:
title: 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: >-
PageResponse is to be embedded in gRPC response messages where
the

corresponding request message has used PageRequest.

message SomeResponse {
repeated Bar results = 1;
PageResponse page = 2;
}
description: >-
QueryInactiveContractsResponse is the response type for the
Query/InactiveContract 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
- name: pagination.reverse
description: >-
reverse is set to true if results are to be returned in the
descending order.


Since: cosmos-sdk 0.43
in: query
required: false
type: boolean
format: boolean
tags:
- Query
'/lbm/wasm/v1/inactive_contracts/{address}':
get:
operationId: InactiveContract
responses:
'200':
description: A successful response.
schema:
type: object
properties:
inactivated:
type: boolean
format: boolean
title: >-
inactivated is the result if the contract is inactive contract
or not
description: >-
QueryInactiveContractsResponse is the response type for the
Query/IsInactiveContract 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: address
description: address is the address of the contract
in: path
required: true
type: string
tags:
- Query
securityDefinitions:
kms:
type: basic
Expand Down Expand Up @@ -70353,3 +70530,50 @@ definitions:
description: >-
QueryAllowancesResponse is the response type for the Query/Allowances RPC
method.
lbm.wasm.v1.QueryInactiveContractResponse:
type: object
properties:
inactivated:
type: boolean
format: boolean
title: inactivated is the result if the contract is inactive contract or not
description: >-
QueryInactiveContractsResponse is the response type for the
Query/IsInactiveContract RPC method.
lbm.wasm.v1.QueryInactiveContractsResponse:
type: object
properties:
addresses:
type: array
items:
type: string
title: addresses is the inactive address list
pagination:
title: 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: |-
PageResponse is to be embedded in gRPC response messages where the
corresponding request message has used PageRequest.

message SomeResponse {
repeated Bar results = 1;
PageResponse page = 2;
}
description: >-
QueryInactiveContractsResponse is the response type for the
Query/InactiveContract RPC method.
Loading

0 comments on commit 6411ce4

Please sign in to comment.