From 33670d67de3a8e2135468d8a5c2b53279db83213 Mon Sep 17 00:00:00 2001 From: nhpd Date: Fri, 23 Jun 2023 17:45:18 +0400 Subject: [PATCH 1/3] tmp --- app/app.go | 4 + wasmbinding/stargate_allowlist.go | 164 ++++++++++++++++++++++++++++++ 2 files changed, 168 insertions(+) create mode 100644 wasmbinding/stargate_allowlist.go diff --git a/app/app.go b/app/app.go index 9a3798396..7928e005d 100644 --- a/app/app.go +++ b/app/app.go @@ -578,6 +578,10 @@ func New( app.CronKeeper = *cronkeeper.NewKeeper(appCodec, keys[crontypes.StoreKey], keys[crontypes.MemStoreKey], app.GetSubspace(crontypes.ModuleName), app.AccountKeeper) wasmOpts = append(wasmbinding.RegisterCustomPlugins(&app.InterchainTxsKeeper, &app.InterchainQueriesKeeper, app.TransferKeeper, &app.AdminmoduleKeeper, app.FeeBurnerKeeper, app.FeeKeeper, &app.BankKeeper, app.TokenFactoryKeeper, &app.CronKeeper), wasmOpts...) + queryPlugins := wasmkeeper.WithQueryPlugins( + &wasmkeeper.QueryPlugins{Stargate: wasmkeeper.AcceptListStargateQuerier(wasmbinding.AcceptedStargateQueries(), app.GRPCQueryRouter(), appCodec)}) + wasmOpts = append(wasmOpts, queryPlugins) + app.WasmKeeper = wasm.NewKeeper( appCodec, keys[wasm.StoreKey], diff --git a/wasmbinding/stargate_allowlist.go b/wasmbinding/stargate_allowlist.go new file mode 100644 index 000000000..5c64c1464 --- /dev/null +++ b/wasmbinding/stargate_allowlist.go @@ -0,0 +1,164 @@ +package wasmbinding + +import ( + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" + ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + ibcconnectiontypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types" + tokenfactorytypes "github.com/neutron-org/neutron/x/tokenfactory/types" +) + +func AcceptedStargateQueries() wasmkeeper.AcceptedStargateQueries { + // ===== JUNO + return wasmkeeper.AcceptedStargateQueries{ + // ibc + "/ibc.core.client.v1.Query/ClientState": &ibcclienttypes.QueryClientStateResponse{}, + "/ibc.core.client.v1.Query/ConsensusState": &ibcclienttypes.QueryConsensusStateResponse{}, + "/ibc.core.connection.v1.Query/Connection": &ibcconnectiontypes.QueryConnectionResponse{}, + + // governance + //"/cosmos.gov.v1beta1.Query/Vote": &govv1.QueryVoteResponse{}, + + // distribution + //"/cosmos.distribution.v1beta1.Query/DelegationRewards": &distrtypes.QueryDelegationRewardsResponse{}, + + // staking + //"/cosmos.staking.v1beta1.Query/Delegation": &stakingtypes.QueryDelegationResponse{}, + //"/cosmos.staking.v1beta1.Query/Redelegations": &stakingtypes.QueryRedelegationsResponse{}, + //"/cosmos.staking.v1beta1.Query/UnbondingDelegation": &stakingtypes.QueryUnbondingDelegationResponse{}, + //"/cosmos.staking.v1beta1.Query/Validator": &stakingtypes.QueryValidatorResponse{}, + //"/cosmos.staking.v1beta1.Query/Params": &stakingtypes.QueryParamsResponse{}, + //"/cosmos.staking.v1beta1.Query/Pool": &stakingtypes.QueryPoolResponse{}, + + // token factory + "/osmosis.tokenfactory.v1beta1.Query/Params": &tokenfactorytypes.QueryParamsResponse{}, + "/osmosis.tokenfactory.v1beta1.Query/DenomAuthorityMetadata": &tokenfactorytypes.QueryDenomAuthorityMetadataResponse{}, + "/osmosis.tokenfactory.v1beta1.Query/DenomsFromCreator": &tokenfactorytypes.QueryDenomsFromCreatorResponse{}, + + // ===== OSMOSIS + // ibc queries + "/ibc.applications.transfer.v1.Query/DenomTrace": &ibctransfertypes.QueryDenomTraceResponse{}, + + // cosmos-sdk queries + + // auth + "/cosmos.auth.v1beta1.Query/Account": &authtypes.QueryAccountResponse{}, + "/cosmos.auth.v1beta1.Query/Params": &authtypes.QueryParamsResponse{}, + + // bank + "/cosmos.bank.v1beta1.Query/Balance": &banktypes.QueryBalanceResponse{}, + "/cosmos.bank.v1beta1.Query/DenomMetadata": &banktypes.QueryDenomsMetadataResponse{}, + "/cosmos.bank.v1beta1.Query/Params": &banktypes.QueryParamsResponse{}, + "/cosmos.bank.v1beta1.Query/SupplyOf": &banktypes.QuerySupplyOfResponse{}, + + // distribution + //TODO: check what distribution module does. We disabled it. why? + //"/cosmos.distribution.v1beta1.Query/Params": distributiontypes.QueryParamsResponse{}, + //"/cosmos.distribution.v1beta1.Query/DelegatorWithdrawAddress": distributiontypes.QueryDelegatorWithdrawAddressResponse{}, + //"/cosmos.distribution.v1beta1.Query/ValidatorCommission": distributiontypes.QueryValidatorCommissionResponse{}, + + // gov + //"/cosmos.gov.v1beta1.Query/Deposit": govtypes.QueryDepositResponse{}, + //"/cosmos.gov.v1beta1.Query/Params": govtypes.QueryParamsResponse{}, + //"/cosmos.gov.v1beta1.Query/Vote": govtypes.QueryVoteResponse{}, + + // slashing + //TODO: no sense since provider only slashing? + //"/cosmos.slashing.v1beta1.Query/Params": slashingtypes.QueryParamsResponse{}, + //"/cosmos.slashing.v1beta1.Query/SigningInfo": slashingtypes.QuerySigningInfoResponse{}, + + // staking + //"/cosmos.staking.v1beta1.Query/Delegation": stakingtypes.QueryDelegationResponse{}, + //"/cosmos.staking.v1beta1.Query/Params": stakingtypes.QueryParamsResponse{}, + //"/cosmos.staking.v1beta1.Query/Validator": stakingtypes.QueryValidatorResponse{}, + + // osmosis queries + + // epochs + //"/osmosis.epochs.v1beta1.Query/EpochInfos": epochtypes.QueryEpochsInfoResponse{}, + //"/osmosis.epochs.v1beta1.Query/CurrentEpoch": epochtypes.QueryCurrentEpochResponse{}, + + // gamm + //"/osmosis.gamm.v1beta1.Query/NumPools": gammtypes.QueryNumPoolsResponse{}, + //"/osmosis.gamm.v1beta1.Query/TotalLiquidity": gammtypes.QueryTotalLiquidityResponse{}, + //"/osmosis.gamm.v1beta1.Query/Pool": gammtypes.QueryPoolResponse{}, + //"/osmosis.gamm.v1beta1.Query/PoolParams": gammtypes.QueryPoolParamsResponse{}, + //"/osmosis.gamm.v1beta1.Query/TotalPoolLiquidity": gammtypes.QueryTotalPoolLiquidityResponse{}, + //"/osmosis.gamm.v1beta1.Query/TotalShares": gammtypes.QueryTotalSharesResponse{}, + //"/osmosis.gamm.v1beta1.Query/CalcJoinPoolShares": gammtypes.QueryCalcJoinPoolSharesResponse{}, + //"/osmosis.gamm.v1beta1.Query/CalcExitPoolCoinsFromShares": gammtypes.QueryCalcExitPoolCoinsFromSharesResponse{}, + //"/osmosis.gamm.v1beta1.Query/CalcJoinPoolNoSwapShares": gammtypes.QueryCalcJoinPoolNoSwapSharesResponse{}, + //"/osmosis.gamm.v1beta1.Query/PoolType": gammtypes.QueryPoolTypeResponse{}, + //"/osmosis.gamm.v2.Query/SpotPrice": gammv2types.QuerySpotPriceResponse{}, + //"/osmosis.gamm.v1beta1.Query/EstimateSwapExactAmountIn": gammtypes.QuerySwapExactAmountInResponse{}, + //"/osmosis.gamm.v1beta1.Query/EstimateSwapExactAmountOut": gammtypes.QuerySwapExactAmountOutResponse{}, + + // incentives + //"/osmosis.incentives.Query/ModuleToDistributeCoins": incentivestypes.ModuleToDistributeCoinsResponse{}, + //"/osmosis.incentives.Query/LockableDurations": incentivestypes.QueryLockableDurationsResponse{}, + + // lockup + //"/osmosis.lockup.Query/ModuleBalance": lockuptypes.ModuleBalanceResponse{}, + //"/osmosis.lockup.Query/ModuleLockedAmount": lockuptypes.ModuleLockedAmountResponse{}, + //"/osmosis.lockup.Query/AccountUnlockableCoins": lockuptypes.AccountUnlockableCoinsResponse{}, + //"/osmosis.lockup.Query/AccountUnlockingCoins": lockuptypes.AccountUnlockingCoinsResponse{}, + //"/osmosis.lockup.Query/LockedDenom": lockuptypes.LockedDenomResponse{}, + //"/osmosis.lockup.Query/LockedByID": lockuptypes.LockedResponse{}, + //"/osmosis.lockup.Query/NextLockID": lockuptypes.NextLockIDResponse{}, + //"/osmosis.lockup.Query/LockRewardReceiver": lockuptypes.LockRewardReceiverResponse{}, + + // mint + //"/osmosis.mint.v1beta1.Query/EpochProvisions": minttypes.QueryEpochProvisionsResponse{}, + //"/osmosis.mint.v1beta1.Query/Params": minttypes.QueryParamsResponse{}, + + // pool-incentives + //"/osmosis.poolincentives.v1beta1.Query/GaugeIds": poolincentivestypes.QueryGaugeIdsResponse{}, + + // superfluid + //"/osmosis.superfluid.Query/Params": superfluidtypes.QueryParamsResponse{}, + //"/osmosis.superfluid.Query/AssetType": superfluidtypes.AssetTypeResponse{}, + //"/osmosis.superfluid.Query/AllAssets": superfluidtypes.AllAssetsResponse{}, + //"/osmosis.superfluid.Query/AssetMultiplier": superfluidtypes.AssetMultiplierResponse{}, + + // poolmanager + //"/osmosis.poolmanager.v1beta1.Query/NumPools": poolmanagerqueryproto.NumPoolsResponse{}, + //"/osmosis.poolmanager.v1beta1.Query/EstimateSwapExactAmountIn": poolmanagerqueryproto.EstimateSwapExactAmountInResponse{}, + //"/osmosis.poolmanager.v1beta1.Query/EstimateSwapExactAmountOut": poolmanagerqueryproto.EstimateSwapExactAmountOutResponse{}, + //"/osmosis.poolmanager.v1beta1.Query/EstimateSinglePoolSwapExactAmountIn": poolmanagerqueryproto.EstimateSwapExactAmountInResponse{}, + //"/osmosis.poolmanager.v1beta1.Query/EstimateSinglePoolSwapExactAmountOut": poolmanagerqueryproto.EstimateSwapExactAmountOutResponse{}, + //"/osmosis.poolmanager.v1beta1.Query/Pool": poolmanagerqueryproto.PoolResponse{}, + //"/osmosis.poolmanager.v1beta1.Query/SpotPrice": poolmanagerqueryproto.SpotPriceResponse{}, + + // txfees + //"/osmosis.txfees.v1beta1.Query/FeeTokens": txfeestypes.QueryFeeTokensResponse{}, + //"/osmosis.txfees.v1beta1.Query/DenomSpotPrice": txfeestypes.QueryDenomSpotPriceResponse{}, + //"/osmosis.txfees.v1beta1.Query/DenomPoolId": txfeestypes.QueryDenomPoolIdResponse{}, + //"/osmosis.txfees.v1beta1.Query/BaseDenom": txfeestypes.QueryBaseDenomResponse{}, + + // twap + //"/osmosis.twap.v1beta1.Query/ArithmeticTwap": twapquerytypes.ArithmeticTwapResponse{}, + //"/osmosis.twap.v1beta1.Query/ArithmeticTwapToNow": twapquerytypes.ArithmeticTwapToNowResponse{}, + //"/osmosis.twap.v1beta1.Query/GeometricTwap": twapquerytypes.GeometricTwapResponse{}, + //"/osmosis.twap.v1beta1.Query/GeometricTwapToNow": twapquerytypes.GeometricTwapToNowResponse{}, + //"/osmosis.twap.v1beta1.Query/Params": twapquerytypes.ParamsResponse{}, + + // downtime-detector + //"/osmosis.downtimedetector.v1beta1.Query/RecoveredSinceDowntimeOfLength": downtimequerytypes.RecoveredSinceDowntimeOfLengthResponse{}, + + // concentrated-liquidity + //"/osmosis.concentratedliquidity.v1beta1.Query/Pools": concentratedliquidityquery.PoolsResponse{}, + //"/osmosis.concentratedliquidity.v1beta1.Query/UserPositions": concentratedliquidityquery.UserPositionsResponse{}, + //"/osmosis.concentratedliquidity.v1beta1.Query/LiquidityPerTickRange": concentratedliquidityquery.LiquidityPerTickRangeResponse{}, + //"/osmosis.concentratedliquidity.v1beta1.Query/LiquidityNetInDirection": concentratedliquidityquery.LiquidityNetInDirectionResponse{}, + //"/osmosis.concentratedliquidity.v1beta1.Query/ClaimableSpreadRewards": concentratedliquidityquery.ClaimableSpreadRewardsResponse{}, + //"/osmosis.concentratedliquidity.v1beta1.Query/ClaimableIncentives": concentratedliquidityquery.ClaimableIncentivesResponse{}, + //"/osmosis.concentratedliquidity.v1beta1.Query/PositionById": concentratedliquidityquery.PositionByIdResponse{}, + //"/osmosis.concentratedliquidity.v1beta1.Query/Params": concentratedliquidityquery.ParamsResponse{}, + //"/osmosis.concentratedliquidity.v1beta1.Query/PoolAccumulatorRewards": concentratedliquidityquery.PoolAccumulatorRewardsResponse{}, + //"/osmosis.concentratedliquidity.v1beta1.Query/IncentiveRecords": concentratedliquidityquery.IncentiveRecordsResponse{}, + //"/osmosis.concentratedliquidity.v1beta1.Query/TickAccumulatorTrackers": concentratedliquidityquery.TickAccumulatorTrackersResponse{}, + //"/osmosis.concentratedliquidity.v1beta1.Query/CFMMPoolIdLinkFromConcentratedPoolId": concentratedliquidityquery.CFMMPoolIdLinkFromConcentratedPoolIdResponse{}, + } +} From cc817e0d6332ce254c7b3a33d381fc3baf8dd65e Mon Sep 17 00:00:00 2001 From: nhpd Date: Fri, 23 Jun 2023 18:13:29 +0400 Subject: [PATCH 2/3] allow some stargate queries --- wasmbinding/stargate_allowlist.go | 165 +++++++----------------------- 1 file changed, 39 insertions(+), 126 deletions(-) diff --git a/wasmbinding/stargate_allowlist.go b/wasmbinding/stargate_allowlist.go index 5c64c1464..81294f046 100644 --- a/wasmbinding/stargate_allowlist.go +++ b/wasmbinding/stargate_allowlist.go @@ -7,42 +7,30 @@ import ( ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" ibcconnectiontypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types" + contractmanagertypes "github.com/neutron-org/neutron/x/contractmanager/types" + crontypes "github.com/neutron-org/neutron/x/cron/types" + feeburnertypes "github.com/neutron-org/neutron/x/feeburner/types" + feerefundertypes "github.com/neutron-org/neutron/x/feerefunder/types" + interchainqueriestypes "github.com/neutron-org/neutron/x/interchainqueries/types" + interchaintxstypes "github.com/neutron-org/neutron/x/interchaintxs/types" tokenfactorytypes "github.com/neutron-org/neutron/x/tokenfactory/types" ) func AcceptedStargateQueries() wasmkeeper.AcceptedStargateQueries { - // ===== JUNO return wasmkeeper.AcceptedStargateQueries{ // ibc "/ibc.core.client.v1.Query/ClientState": &ibcclienttypes.QueryClientStateResponse{}, "/ibc.core.client.v1.Query/ConsensusState": &ibcclienttypes.QueryConsensusStateResponse{}, "/ibc.core.connection.v1.Query/Connection": &ibcconnectiontypes.QueryConnectionResponse{}, - // governance - //"/cosmos.gov.v1beta1.Query/Vote": &govv1.QueryVoteResponse{}, - - // distribution - //"/cosmos.distribution.v1beta1.Query/DelegationRewards": &distrtypes.QueryDelegationRewardsResponse{}, - - // staking - //"/cosmos.staking.v1beta1.Query/Delegation": &stakingtypes.QueryDelegationResponse{}, - //"/cosmos.staking.v1beta1.Query/Redelegations": &stakingtypes.QueryRedelegationsResponse{}, - //"/cosmos.staking.v1beta1.Query/UnbondingDelegation": &stakingtypes.QueryUnbondingDelegationResponse{}, - //"/cosmos.staking.v1beta1.Query/Validator": &stakingtypes.QueryValidatorResponse{}, - //"/cosmos.staking.v1beta1.Query/Params": &stakingtypes.QueryParamsResponse{}, - //"/cosmos.staking.v1beta1.Query/Pool": &stakingtypes.QueryPoolResponse{}, - // token factory "/osmosis.tokenfactory.v1beta1.Query/Params": &tokenfactorytypes.QueryParamsResponse{}, "/osmosis.tokenfactory.v1beta1.Query/DenomAuthorityMetadata": &tokenfactorytypes.QueryDenomAuthorityMetadataResponse{}, "/osmosis.tokenfactory.v1beta1.Query/DenomsFromCreator": &tokenfactorytypes.QueryDenomsFromCreatorResponse{}, - // ===== OSMOSIS - // ibc queries + // transfer "/ibc.applications.transfer.v1.Query/DenomTrace": &ibctransfertypes.QueryDenomTraceResponse{}, - // cosmos-sdk queries - // auth "/cosmos.auth.v1beta1.Query/Account": &authtypes.QueryAccountResponse{}, "/cosmos.auth.v1beta1.Query/Params": &authtypes.QueryParamsResponse{}, @@ -53,112 +41,37 @@ func AcceptedStargateQueries() wasmkeeper.AcceptedStargateQueries { "/cosmos.bank.v1beta1.Query/Params": &banktypes.QueryParamsResponse{}, "/cosmos.bank.v1beta1.Query/SupplyOf": &banktypes.QuerySupplyOfResponse{}, - // distribution - //TODO: check what distribution module does. We disabled it. why? - //"/cosmos.distribution.v1beta1.Query/Params": distributiontypes.QueryParamsResponse{}, - //"/cosmos.distribution.v1beta1.Query/DelegatorWithdrawAddress": distributiontypes.QueryDelegatorWithdrawAddressResponse{}, - //"/cosmos.distribution.v1beta1.Query/ValidatorCommission": distributiontypes.QueryValidatorCommissionResponse{}, - - // gov - //"/cosmos.gov.v1beta1.Query/Deposit": govtypes.QueryDepositResponse{}, - //"/cosmos.gov.v1beta1.Query/Params": govtypes.QueryParamsResponse{}, - //"/cosmos.gov.v1beta1.Query/Vote": govtypes.QueryVoteResponse{}, - - // slashing - //TODO: no sense since provider only slashing? - //"/cosmos.slashing.v1beta1.Query/Params": slashingtypes.QueryParamsResponse{}, - //"/cosmos.slashing.v1beta1.Query/SigningInfo": slashingtypes.QuerySigningInfoResponse{}, - - // staking - //"/cosmos.staking.v1beta1.Query/Delegation": stakingtypes.QueryDelegationResponse{}, - //"/cosmos.staking.v1beta1.Query/Params": stakingtypes.QueryParamsResponse{}, - //"/cosmos.staking.v1beta1.Query/Validator": stakingtypes.QueryValidatorResponse{}, - - // osmosis queries - - // epochs - //"/osmosis.epochs.v1beta1.Query/EpochInfos": epochtypes.QueryEpochsInfoResponse{}, - //"/osmosis.epochs.v1beta1.Query/CurrentEpoch": epochtypes.QueryCurrentEpochResponse{}, - - // gamm - //"/osmosis.gamm.v1beta1.Query/NumPools": gammtypes.QueryNumPoolsResponse{}, - //"/osmosis.gamm.v1beta1.Query/TotalLiquidity": gammtypes.QueryTotalLiquidityResponse{}, - //"/osmosis.gamm.v1beta1.Query/Pool": gammtypes.QueryPoolResponse{}, - //"/osmosis.gamm.v1beta1.Query/PoolParams": gammtypes.QueryPoolParamsResponse{}, - //"/osmosis.gamm.v1beta1.Query/TotalPoolLiquidity": gammtypes.QueryTotalPoolLiquidityResponse{}, - //"/osmosis.gamm.v1beta1.Query/TotalShares": gammtypes.QueryTotalSharesResponse{}, - //"/osmosis.gamm.v1beta1.Query/CalcJoinPoolShares": gammtypes.QueryCalcJoinPoolSharesResponse{}, - //"/osmosis.gamm.v1beta1.Query/CalcExitPoolCoinsFromShares": gammtypes.QueryCalcExitPoolCoinsFromSharesResponse{}, - //"/osmosis.gamm.v1beta1.Query/CalcJoinPoolNoSwapShares": gammtypes.QueryCalcJoinPoolNoSwapSharesResponse{}, - //"/osmosis.gamm.v1beta1.Query/PoolType": gammtypes.QueryPoolTypeResponse{}, - //"/osmosis.gamm.v2.Query/SpotPrice": gammv2types.QuerySpotPriceResponse{}, - //"/osmosis.gamm.v1beta1.Query/EstimateSwapExactAmountIn": gammtypes.QuerySwapExactAmountInResponse{}, - //"/osmosis.gamm.v1beta1.Query/EstimateSwapExactAmountOut": gammtypes.QuerySwapExactAmountOutResponse{}, - - // incentives - //"/osmosis.incentives.Query/ModuleToDistributeCoins": incentivestypes.ModuleToDistributeCoinsResponse{}, - //"/osmosis.incentives.Query/LockableDurations": incentivestypes.QueryLockableDurationsResponse{}, - - // lockup - //"/osmosis.lockup.Query/ModuleBalance": lockuptypes.ModuleBalanceResponse{}, - //"/osmosis.lockup.Query/ModuleLockedAmount": lockuptypes.ModuleLockedAmountResponse{}, - //"/osmosis.lockup.Query/AccountUnlockableCoins": lockuptypes.AccountUnlockableCoinsResponse{}, - //"/osmosis.lockup.Query/AccountUnlockingCoins": lockuptypes.AccountUnlockingCoinsResponse{}, - //"/osmosis.lockup.Query/LockedDenom": lockuptypes.LockedDenomResponse{}, - //"/osmosis.lockup.Query/LockedByID": lockuptypes.LockedResponse{}, - //"/osmosis.lockup.Query/NextLockID": lockuptypes.NextLockIDResponse{}, - //"/osmosis.lockup.Query/LockRewardReceiver": lockuptypes.LockRewardReceiverResponse{}, - - // mint - //"/osmosis.mint.v1beta1.Query/EpochProvisions": minttypes.QueryEpochProvisionsResponse{}, - //"/osmosis.mint.v1beta1.Query/Params": minttypes.QueryParamsResponse{}, - - // pool-incentives - //"/osmosis.poolincentives.v1beta1.Query/GaugeIds": poolincentivestypes.QueryGaugeIdsResponse{}, - - // superfluid - //"/osmosis.superfluid.Query/Params": superfluidtypes.QueryParamsResponse{}, - //"/osmosis.superfluid.Query/AssetType": superfluidtypes.AssetTypeResponse{}, - //"/osmosis.superfluid.Query/AllAssets": superfluidtypes.AllAssetsResponse{}, - //"/osmosis.superfluid.Query/AssetMultiplier": superfluidtypes.AssetMultiplierResponse{}, - - // poolmanager - //"/osmosis.poolmanager.v1beta1.Query/NumPools": poolmanagerqueryproto.NumPoolsResponse{}, - //"/osmosis.poolmanager.v1beta1.Query/EstimateSwapExactAmountIn": poolmanagerqueryproto.EstimateSwapExactAmountInResponse{}, - //"/osmosis.poolmanager.v1beta1.Query/EstimateSwapExactAmountOut": poolmanagerqueryproto.EstimateSwapExactAmountOutResponse{}, - //"/osmosis.poolmanager.v1beta1.Query/EstimateSinglePoolSwapExactAmountIn": poolmanagerqueryproto.EstimateSwapExactAmountInResponse{}, - //"/osmosis.poolmanager.v1beta1.Query/EstimateSinglePoolSwapExactAmountOut": poolmanagerqueryproto.EstimateSwapExactAmountOutResponse{}, - //"/osmosis.poolmanager.v1beta1.Query/Pool": poolmanagerqueryproto.PoolResponse{}, - //"/osmosis.poolmanager.v1beta1.Query/SpotPrice": poolmanagerqueryproto.SpotPriceResponse{}, - - // txfees - //"/osmosis.txfees.v1beta1.Query/FeeTokens": txfeestypes.QueryFeeTokensResponse{}, - //"/osmosis.txfees.v1beta1.Query/DenomSpotPrice": txfeestypes.QueryDenomSpotPriceResponse{}, - //"/osmosis.txfees.v1beta1.Query/DenomPoolId": txfeestypes.QueryDenomPoolIdResponse{}, - //"/osmosis.txfees.v1beta1.Query/BaseDenom": txfeestypes.QueryBaseDenomResponse{}, - - // twap - //"/osmosis.twap.v1beta1.Query/ArithmeticTwap": twapquerytypes.ArithmeticTwapResponse{}, - //"/osmosis.twap.v1beta1.Query/ArithmeticTwapToNow": twapquerytypes.ArithmeticTwapToNowResponse{}, - //"/osmosis.twap.v1beta1.Query/GeometricTwap": twapquerytypes.GeometricTwapResponse{}, - //"/osmosis.twap.v1beta1.Query/GeometricTwapToNow": twapquerytypes.GeometricTwapToNowResponse{}, - //"/osmosis.twap.v1beta1.Query/Params": twapquerytypes.ParamsResponse{}, - - // downtime-detector - //"/osmosis.downtimedetector.v1beta1.Query/RecoveredSinceDowntimeOfLength": downtimequerytypes.RecoveredSinceDowntimeOfLengthResponse{}, - - // concentrated-liquidity - //"/osmosis.concentratedliquidity.v1beta1.Query/Pools": concentratedliquidityquery.PoolsResponse{}, - //"/osmosis.concentratedliquidity.v1beta1.Query/UserPositions": concentratedliquidityquery.UserPositionsResponse{}, - //"/osmosis.concentratedliquidity.v1beta1.Query/LiquidityPerTickRange": concentratedliquidityquery.LiquidityPerTickRangeResponse{}, - //"/osmosis.concentratedliquidity.v1beta1.Query/LiquidityNetInDirection": concentratedliquidityquery.LiquidityNetInDirectionResponse{}, - //"/osmosis.concentratedliquidity.v1beta1.Query/ClaimableSpreadRewards": concentratedliquidityquery.ClaimableSpreadRewardsResponse{}, - //"/osmosis.concentratedliquidity.v1beta1.Query/ClaimableIncentives": concentratedliquidityquery.ClaimableIncentivesResponse{}, - //"/osmosis.concentratedliquidity.v1beta1.Query/PositionById": concentratedliquidityquery.PositionByIdResponse{}, - //"/osmosis.concentratedliquidity.v1beta1.Query/Params": concentratedliquidityquery.ParamsResponse{}, - //"/osmosis.concentratedliquidity.v1beta1.Query/PoolAccumulatorRewards": concentratedliquidityquery.PoolAccumulatorRewardsResponse{}, - //"/osmosis.concentratedliquidity.v1beta1.Query/IncentiveRecords": concentratedliquidityquery.IncentiveRecordsResponse{}, - //"/osmosis.concentratedliquidity.v1beta1.Query/TickAccumulatorTrackers": concentratedliquidityquery.TickAccumulatorTrackersResponse{}, - //"/osmosis.concentratedliquidity.v1beta1.Query/CFMMPoolIdLinkFromConcentratedPoolId": concentratedliquidityquery.CFMMPoolIdLinkFromConcentratedPoolIdResponse{}, + // TODO: check all queries below if DETERMINISTIC + + // cron + "/neutron.cron.Query/Params": &crontypes.QueryParamsResponse{}, + "/neutron.cron.Query/Schedule": &crontypes.QueryGetScheduleResponse{}, + "/neutron.cron.Query/Schedules": &crontypes.QuerySchedulesResponse{}, + + // contractmanager + "/neutron.contractmanager.Query/Params": &contractmanagertypes.QueryParamsResponse{}, + "/neutron.contractmanager.Query/AddressFailures": &contractmanagertypes.QueryFailuresResponse{}, + "/neutron.contractmanager.Query/Failures": &contractmanagertypes.QueryFailuresResponse{}, + + // interchaintxs + // TODO: do we need it or duplicated in custom queries + "/neutron.interchaintxs.Query/Params": &interchaintxstypes.QueryParamsResponse{}, + "/neutron.interchaintxs.Query/InterchainAccountAddress": &interchaintxstypes.QueryInterchainAccountAddressResponse{}, + + // interchainqueries + // TODO: do we need it or duplicated in custom queries + "/neutron.interchainqueries.Query/Params": &interchainqueriestypes.QueryParamsResponse{}, + "/neutron.interchainqueries.Query/RegisteredQueries": &interchainqueriestypes.QueryRegisteredQueriesResponse{}, + "/neutron.interchainqueries.Query/RegisteredQuery": &interchainqueriestypes.QueryRegisteredQueryResponse{}, + "/neutron.interchainqueries.Query/QueryResult": &interchainqueriestypes.QueryRegisteredQueryResultResponse{}, + "/neutron.interchainqueries.Query/LastRemoteHeight": &interchainqueriestypes.QueryLastRemoteHeightResponse{}, + + // feerefunder + "/neutron.feerefunder.Query/Params": &feerefundertypes.QueryParamsResponse{}, + "/neutron.feerefunder.Query/FeeInfo": &feerefundertypes.FeeInfoResponse{}, + + // feeburner + "/neutron.feeburner.Query/Params": &feeburnertypes.QueryParamsResponse{}, + "/neutron.feeburner.Query/TotalBurnedNeutronsAmount": &feeburnertypes.QueryTotalBurnedNeutronsAmountResponse{}, } } From 167b7b578891ba6887f8779bb831855708bd0bfd Mon Sep 17 00:00:00 2001 From: nhpd Date: Wed, 28 Jun 2023 18:24:35 +0400 Subject: [PATCH 3/3] remove unneded/unchecked queries --- wasmbinding/stargate_allowlist.go | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/wasmbinding/stargate_allowlist.go b/wasmbinding/stargate_allowlist.go index 81294f046..d60eed580 100644 --- a/wasmbinding/stargate_allowlist.go +++ b/wasmbinding/stargate_allowlist.go @@ -8,9 +8,7 @@ import ( ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" ibcconnectiontypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types" contractmanagertypes "github.com/neutron-org/neutron/x/contractmanager/types" - crontypes "github.com/neutron-org/neutron/x/cron/types" feeburnertypes "github.com/neutron-org/neutron/x/feeburner/types" - feerefundertypes "github.com/neutron-org/neutron/x/feerefunder/types" interchainqueriestypes "github.com/neutron-org/neutron/x/interchainqueries/types" interchaintxstypes "github.com/neutron-org/neutron/x/interchaintxs/types" tokenfactorytypes "github.com/neutron-org/neutron/x/tokenfactory/types" @@ -41,37 +39,17 @@ func AcceptedStargateQueries() wasmkeeper.AcceptedStargateQueries { "/cosmos.bank.v1beta1.Query/Params": &banktypes.QueryParamsResponse{}, "/cosmos.bank.v1beta1.Query/SupplyOf": &banktypes.QuerySupplyOfResponse{}, - // TODO: check all queries below if DETERMINISTIC - - // cron - "/neutron.cron.Query/Params": &crontypes.QueryParamsResponse{}, - "/neutron.cron.Query/Schedule": &crontypes.QueryGetScheduleResponse{}, - "/neutron.cron.Query/Schedules": &crontypes.QuerySchedulesResponse{}, - // contractmanager - "/neutron.contractmanager.Query/Params": &contractmanagertypes.QueryParamsResponse{}, "/neutron.contractmanager.Query/AddressFailures": &contractmanagertypes.QueryFailuresResponse{}, "/neutron.contractmanager.Query/Failures": &contractmanagertypes.QueryFailuresResponse{}, // interchaintxs - // TODO: do we need it or duplicated in custom queries - "/neutron.interchaintxs.Query/Params": &interchaintxstypes.QueryParamsResponse{}, - "/neutron.interchaintxs.Query/InterchainAccountAddress": &interchaintxstypes.QueryInterchainAccountAddressResponse{}, + "/neutron.interchaintxs.Query/Params": &interchaintxstypes.QueryParamsResponse{}, // interchainqueries - // TODO: do we need it or duplicated in custom queries - "/neutron.interchainqueries.Query/Params": &interchainqueriestypes.QueryParamsResponse{}, - "/neutron.interchainqueries.Query/RegisteredQueries": &interchainqueriestypes.QueryRegisteredQueriesResponse{}, - "/neutron.interchainqueries.Query/RegisteredQuery": &interchainqueriestypes.QueryRegisteredQueryResponse{}, - "/neutron.interchainqueries.Query/QueryResult": &interchainqueriestypes.QueryRegisteredQueryResultResponse{}, - "/neutron.interchainqueries.Query/LastRemoteHeight": &interchainqueriestypes.QueryLastRemoteHeightResponse{}, - - // feerefunder - "/neutron.feerefunder.Query/Params": &feerefundertypes.QueryParamsResponse{}, - "/neutron.feerefunder.Query/FeeInfo": &feerefundertypes.FeeInfoResponse{}, + "/neutron.interchainqueries.Query/Params": &interchainqueriestypes.QueryParamsResponse{}, // feeburner - "/neutron.feeburner.Query/Params": &feeburnertypes.QueryParamsResponse{}, - "/neutron.feeburner.Query/TotalBurnedNeutronsAmount": &feeburnertypes.QueryTotalBurnedNeutronsAmountResponse{}, + "/neutron.feeburner.Query/Params": &feeburnertypes.QueryParamsResponse{}, } }