Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Introduce AcceptListStargateQuerier #84

Merged
merged 3 commits into from
Aug 23, 2023

Conversation

dudong2
Copy link

@dudong2 dudong2 commented Aug 17, 2023

Description

This PR is based on CosmWasm#1069

accepted := wasmkeeper.AcceptedStargateQueries{
	"/lbm.collection.v1.Query/Contract": &collection.QueryContractResponse{},
}
querierOpts := wasmkeeper.WithQueryPlugins(
	&wasmkeeper.QueryPlugins{
		Stargate: wasmkeeper.AcceptListStargateQuerier(accepted, app.GRPCQueryRouter(), appCodec),
	})
wasmOpts = append(wasmOpts, querierOpts)

// The last arguments can contain custom message handlers, and custom query handlers,
// if we want to allow any custom callbacks
availableCapabilities := "iterator,staking,stargate,cosmwasm_1_1"
app.WasmKeeper = wasmpluskeeper.NewKeeper(
	appCodec,
	keys[wasmplustypes.StoreKey],
	app.GetSubspace(wasmplustypes.ModuleName),
	app.AccountKeeper,
	app.BankKeeper,
	app.StakingKeeper,
	app.DistrKeeper,
	app.IBCKeeper.ChannelKeeper,
	&app.IBCKeeper.PortKeeper,
	scopedWasmKeeper,
	app.TransferKeeper,
	app.MsgServiceRouter(),
	app.GRPCQueryRouter(),
	wasmDir,
	wasmConfig,
	availableCapabilities,
	wasmOpts...,
)

Motivation and context

How has this been tested?

Screenshots (if appropriate):

Checklist:

  • I followed the contributing guidelines and code of conduct.
  • I have added a relevant changelog to CHANGELOG.md
  • I have added tests to cover my changes.
  • I have updated the documentation accordingly.
  • I have updated API documentation client/docs/swagger-ui/swagger.yaml

* Stargate query enable

* Remove initialized whitelists

* Roman's review

* Minor improvement

* Add tests

* Add testings and codec

* Fix lint

* Fix test

* Fix from code review

* Refactor Stargate querier init

* Fix typo

Co-authored-by: mattverse <[email protected]>
@dudong2 dudong2 self-assigned this Aug 17, 2023
@dudong2 dudong2 added the enhancement New feature or request label Aug 17, 2023
@dudong2 dudong2 changed the title Introduce AcceptListStargateQuerier (#1069) feat: Introduce AcceptListStargateQuerier Aug 17, 2023
@dudong2 dudong2 marked this pull request as ready for review August 17, 2023 17:59
@dudong2 dudong2 requested review from zemyblue and 170210 August 18, 2023 00:18
da1suk8
da1suk8 previously approved these changes Aug 21, 2023
Copy link

@loloicci loloicci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this PR should be merged into main, not to release/v0.1.x

@dudong2 dudong2 changed the base branch from release/v0.1.x to main August 21, 2023 11:02
@dudong2 dudong2 dismissed da1suk8’s stale review August 21, 2023 11:02

The base branch was changed.

@codecov
Copy link

codecov bot commented Aug 21, 2023

Codecov Report

Merging #84 (fd61bef) into main (40fa7c7) will increase coverage by 0.07%.
The diff coverage is 91.17%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #84      +/-   ##
==========================================
+ Coverage   62.80%   62.88%   +0.07%     
==========================================
  Files          80       80              
  Lines        9966     9995      +29     
==========================================
+ Hits         6259     6285      +26     
- Misses       3379     3381       +2     
- Partials      328      329       +1     
Files Changed Coverage Δ
x/wasm/keeper/options.go 74.71% <ø> (ø)
x/wasm/keeper/query_plugins.go 76.12% <91.17%> (+0.94%) ⬆️

@dudong2 dudong2 requested review from da1suk8 and loloicci August 21, 2023 11:08
@dudong2 dudong2 merged commit 00c6a22 into main Aug 23, 2023
@dudong2 dudong2 deleted the dudong2/feat/stargate-querier branch August 23, 2023 06:37
@zemyblue zemyblue mentioned this pull request Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants