From d4d888b6dc62a087f88f102d161f02ff6da27853 Mon Sep 17 00:00:00 2001 From: Dzmitry Hil Date: Wed, 27 Nov 2024 15:08:22 +0300 Subject: [PATCH] Integrate DEX-related asset FT queries and messages for the WASM. (#1031) * Integrate DEX-related asset FT queries and messages for the WASM. * Allow to use DEX-related asset FT queries for the WASM smart contracts. * Add integration tests to test it. --- docs/api.md | 6 +- docs/static/openapi.json | 4 +- .../contracts/modules/dex/src/contract.rs | 72 +++++++- .../contracts/modules/dex/src/msg.rs | 33 +++- integration-tests/modules/wasm_test.go | 154 ++++++++++++++---- proto/coreum/asset/ft/v1/query.proto | 7 + proto/coreum/asset/ft/v1/token.proto | 2 +- proto/coreum/asset/ft/v1/tx.proto | 2 +- proto/coreum/dex/v1/params.proto | 2 +- x/asset/ft/client/cli/tx.go | 2 +- x/asset/ft/keeper/grpc_query.go | 4 +- x/asset/ft/types/query.pb.go | 154 +++++++++--------- x/asset/ft/types/token.pb.go | 2 +- x/asset/ft/types/tx.pb.go | 2 +- x/dex/types/params.pb.go | 2 +- x/wasm/handler/message.go | 1 + x/wasm/handler/query.go | 1 + 17 files changed, 319 insertions(+), 131 deletions(-) diff --git a/docs/api.md b/docs/api.md index 78b487549..039b2d100 100644 --- a/docs/api.md +++ b/docs/api.md @@ -2366,7 +2366,7 @@ DEXSettings defines the token settings of the dex. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `unified_ref_amount` | [string](#string) | | `unified_ref_amount is the approximate amount you need to by 1USD, used to define the price tick size` | +| `unified_ref_amount` | [string](#string) | | `unified_ref_amount is the approximate amount you need to buy 1USD, used to define the price tick size` | | `whitelisted_denoms` | [string](#string) | repeated | `whitelisted_denoms is the list of denoms to trade with.` | @@ -2795,7 +2795,7 @@ MsgIssue defines message to issue new fungible token. | ----- | ---- | ----- | ----------- | | `sender` | [string](#string) | | | | `denom` | [string](#string) | | | -| `unified_ref_amount` | [string](#string) | | `unified_ref_amount is the approximate amount you need to by 1USD, used to define the price tick size` | +| `unified_ref_amount` | [string](#string) | | `unified_ref_amount is the approximate amount you need to buy 1USD, used to define the price tick size` | @@ -4917,7 +4917,7 @@ Params keeps gov manageable parameters. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `default_unified_ref_amount` | [string](#string) | | `default_unified_ref_amount is the default approximate amount you need to by 1USD, used to for tokens without custom value` | +| `default_unified_ref_amount` | [string](#string) | | `default_unified_ref_amount is the default approximate amount you need to buy 1USD, used to for tokens without custom value` | | `price_tick_exponent` | [int32](#int32) | | `price_tick_exponent is the exponent used for the price tick calculation` | | `max_orders_per_denom` | [uint64](#uint64) | | `max_orders_per_denom is the maximum number of orders per denom the user can have` | | `order_reserve` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | `order_reserve is the reserve required to save the order in the order book` | diff --git a/docs/static/openapi.json b/docs/static/openapi.json index 981a9c795..fddf80941 100644 --- a/docs/static/openapi.json +++ b/docs/static/openapi.json @@ -9592,7 +9592,7 @@ "properties": { "unified_ref_amount": { "type": "string", - "title": "unified_ref_amount is the approximate amount you need to by 1USD, used to define the price tick size" + "title": "unified_ref_amount is the approximate amount you need to buy 1USD, used to define the price tick size" }, "whitelisted_denoms": { "type": "array", @@ -10178,7 +10178,7 @@ "properties": { "default_unified_ref_amount": { "type": "string", - "title": "default_unified_ref_amount is the default approximate amount you need to by 1USD, used to for tokens without custom value" + "title": "default_unified_ref_amount is the default approximate amount you need to buy 1USD, used to for tokens without custom value" }, "price_tick_exponent": { "type": "integer", diff --git a/integration-tests/contracts/modules/dex/src/contract.rs b/integration-tests/contracts/modules/dex/src/contract.rs index a479c6b1f..d15bd92d5 100644 --- a/integration-tests/contracts/modules/dex/src/contract.rs +++ b/integration-tests/contracts/modules/dex/src/contract.rs @@ -1,11 +1,12 @@ -use coreum_wasm_sdk::types::coreum::asset::ft::v1::MsgIssue; +use coreum_wasm_sdk::types::coreum::asset::ft::v1::{MsgIssue, MsgUpdateDexUnifiedRefAmount, MsgUpdateDexWhitelistedDenoms, QueryBalanceRequest, QueryBalanceResponse, QueryDexSettingsRequest, QueryDexSettingsResponse}; use coreum_wasm_sdk::types::coreum::dex::v1::{ - MsgCancelOrder, MsgCancelOrdersByDenom, MsgPlaceOrder, Order, OrderType, + MsgCancelOrder, MsgCancelOrdersByDenom, MsgPlaceOrder, OrderType, QueryAccountDenomOrdersCountRequest, QueryAccountDenomOrdersCountResponse, QueryOrderBookOrdersRequest, QueryOrderBookOrdersResponse, QueryOrderBooksRequest, QueryOrderBooksResponse, QueryOrderRequest, QueryOrderResponse, QueryOrdersRequest, QueryOrdersResponse, QueryParamsRequest, QueryParamsResponse, Side, TimeInForce, }; + use coreum_wasm_sdk::types::cosmos::base::query::v1beta1::PageRequest; use cosmwasm_std::{entry_point, to_json_binary, Binary, CosmosMsg, Deps, StdError, StdResult}; use cosmwasm_std::{DepsMut, Env, MessageInfo, Response}; @@ -70,6 +71,13 @@ pub fn execute( ExecuteMsg::CancelOrdersByDenom { account, denom } => { cancel_orders_by_denom(env, account, denom) } + ExecuteMsg::UpdateDEXUnifiedRefAmount { denom, amount } => { + update_dex_unified_ref_amount(env, denom, amount) + } + ExecuteMsg::UpdateDEXWhitelistedDenoms { + denom, + whitelisted_denoms, + } => update_dex_whitelisted_denoms(env, denom, whitelisted_denoms), } } @@ -169,6 +177,43 @@ fn cancel_orders_by_denom( .add_message(CosmosMsg::Any(cancel_orders_by_denom.to_any()))) } +fn update_dex_unified_ref_amount( + env: Env, + denom: String, + amount: String, +) -> Result { + let dex_unified_ref_amount = MsgUpdateDexUnifiedRefAmount { + sender: env.contract.address.to_string(), + denom: denom.clone(), + unified_ref_amount: amount.clone(), + }; + + Ok(Response::new() + .add_attribute("method", "dex_unified_ref_amount") + .add_attribute("sender", env.contract.address.to_string()) + .add_attribute("unified_ref_amount", amount) + .add_message(CosmosMsg::Any(dex_unified_ref_amount.to_any()))) +} + +fn update_dex_whitelisted_denoms( + env: Env, + denom: String, + whitelisted_denoms: Vec, +) -> Result { + let update_dex_whitelisted_denoms = MsgUpdateDexWhitelistedDenoms { + sender: env.contract.address.to_string(), + denom: denom.clone(), + whitelisted_denoms: whitelisted_denoms.clone(), + }; + + Ok(Response::new() + .add_attribute("method", "update_dex_whitelisted_denoms") + .add_attribute("sender", env.contract.address.to_string()) + .add_attribute("account", denom) + .add_attribute("whitelisted_denoms", whitelisted_denoms.join(",")) + .add_message(CosmosMsg::Any(update_dex_whitelisted_denoms.to_any()))) +} + // ********** Queries ********** #[cfg_attr(not(feature = "library"), entry_point)] pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { @@ -190,6 +235,12 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { QueryMsg::AccountDenomOrdersCount { account, denom } => { to_json_binary(&query_account_denom_orders_count(deps, account, denom)?) } + QueryMsg::DEXSettings { denom } => { + to_json_binary(&query_dex_settings(deps, denom)?) + } + QueryMsg::Balance { account, denom } => { + to_json_binary(&query_balance(deps, account, denom)?) + } } } @@ -311,3 +362,20 @@ fn query_account_denom_orders_count( let request = QueryAccountDenomOrdersCountRequest { account, denom }; request.query(&deps.querier) } + +fn query_dex_settings( + deps: Deps, + denom: String, +) -> StdResult { + let request = QueryDexSettingsRequest { denom }; + request.query(&deps.querier) +} + +fn query_balance( + deps: Deps, + account: String, + denom: String, +) -> StdResult { + let request = QueryBalanceRequest { account, denom }; + request.query(&deps.querier) +} diff --git a/integration-tests/contracts/modules/dex/src/msg.rs b/integration-tests/contracts/modules/dex/src/msg.rs index 4c39828a6..6840051a2 100644 --- a/integration-tests/contracts/modules/dex/src/msg.rs +++ b/integration-tests/contracts/modules/dex/src/msg.rs @@ -1,5 +1,5 @@ use coreum_wasm_sdk::types::coreum::asset::ft::v1::{DexSettings, ExtensionIssueSettings}; -use coreum_wasm_sdk::types::coreum::dex::v1::{MsgPlaceOrder, Order}; +use coreum_wasm_sdk::types::coreum::dex::v1::MsgPlaceOrder; use cosmwasm_schema::cw_serde; use cosmwasm_std::Uint128; @@ -21,9 +21,26 @@ pub struct InstantiateMsg { #[cw_serde] pub enum ExecuteMsg { - PlaceOrder { order: MsgPlaceOrder }, - CancelOrder { order_id: String }, - CancelOrdersByDenom { account: String, denom: String }, + PlaceOrder { + order: MsgPlaceOrder, + }, + CancelOrder { + order_id: String, + }, + CancelOrdersByDenom { + account: String, + denom: String, + }, + #[serde(rename = "update_dex_unified_ref_amount")] + UpdateDEXUnifiedRefAmount { + denom: String, + amount: String, + }, + #[serde(rename = "update_dex_whitelisted_denoms")] + UpdateDEXWhitelistedDenoms { + denom: String, + whitelisted_denoms: Vec, + }, } #[cw_serde] @@ -46,4 +63,12 @@ pub enum QueryMsg { account: String, denom: String, }, + #[serde(rename = "dex_settings")] + DEXSettings { + denom: String, + }, + Balance { + account: String, + denom: String, + }, } diff --git a/integration-tests/modules/wasm_test.go b/integration-tests/modules/wasm_test.go index ebfc3c42a..ccb9b7042 100644 --- a/integration-tests/modules/wasm_test.go +++ b/integration-tests/modules/wasm_test.go @@ -64,6 +64,14 @@ const ( acceptNftOffer authzNFTMethod = "accept_nft_offer" ) +// fungible token wasm models +// +//nolint:tagliatelle +type ftDEXSettings struct { + UnifiedRefAmount string `json:"unified_ref_amount"` + WhitelistedDenoms []string `json:"whitelisted_denoms"` +} + // fungible token wasm models // //nolint:tagliatelle @@ -79,7 +87,7 @@ type issueFTRequest struct { URI string `json:"uri"` URIHash string `json:"uri_hash"` ExtensionSettings *assetfttypes.ExtensionIssueSettings `json:"extension_settings"` - DexSettings *assetfttypes.DEXSettings `json:"dex_settings"` + DEXSettings *ftDEXSettings `json:"dex_settings"` } // fungible token wasm models @@ -134,24 +142,44 @@ type cancelOrdersByDenomBodyDEXRequest struct { Denom string `json:"denom"` } +type updateDEXUnifiedRefAmountRequest struct { + Denom string `json:"denom"` + Amount string `json:"amount"` +} + +//nolint:tagliatelle +type updateDEXWhitelistedDenoms struct { + Denom string `json:"denom"` + WhitelistedDenoms []string `json:"whitelisted_denoms"` +} + //nolint:tagliatelle -type OrderBodyDEXRequest struct { +type orderBodyDEXRequest struct { Account string `json:"acc"` OrderID string `json:"order_id"` } -type OrdersBodyDEXRequest struct { +type ordersBodyDEXRequest struct { Creator string `json:"creator"` } //nolint:tagliatelle -type OrderBookOrdersBodyDEXRequest struct { +type orderBookOrdersBodyDEXRequest struct { BaseDenom string `json:"base_denom"` QuoteDenom string `json:"quote_denom"` Side dextypes.Side `json:"side"` } -type AccountDenomOrdersCountBodyDEXRequest struct { +type accountDenomOrdersCountBodyDEXRequest struct { + Account string `json:"account"` + Denom string `json:"denom"` +} + +type dexSettingsDEXRequest struct { + Denom string `json:"denom"` +} + +type balanceDEXRequest struct { Account string `json:"account"` Denom string `json:"denom"` } @@ -186,9 +214,11 @@ type dexMethod string const ( // tx. - dexMethodPlaceOrder dexMethod = "place_order" - dexMethodCancelOrder dexMethod = "cancel_order" - dexMethodCancelOrdersByDenom dexMethod = "cancel_orders_by_denom" + dexMethodPlaceOrder dexMethod = "place_order" + dexMethodCancelOrder dexMethod = "cancel_order" + dexMethodCancelOrdersByDenom dexMethod = "cancel_orders_by_denom" + dexMethodUpdateDEXUnifiedRefAmount dexMethod = "update_dex_unified_ref_amount" + dexMethodUpdateDEXWhitelistedDenoms dexMethod = "update_dex_whitelisted_denoms" // query. dexMethodParams dexMethod = "params" dexMethodOrder dexMethod = "order" @@ -196,6 +226,8 @@ const ( dexMethodOrderBooks dexMethod = "order_books" dexMethodOrderBookOrders dexMethod = "order_book_orders" dexMethodAccountDenomOrdersCount dexMethod = "account_denom_orders_count" + dexMethodDEXSettings dexMethod = "dex_settings" + dexMethodBalance dexMethod = "balance" ) // TestContractInstantiation tests contract instantiation using two instantiation methods. @@ -1797,11 +1829,11 @@ func TestWASMFungibleTokenInContractLegacy(t *testing.T) { // ********** Params ********** - paramsPayLoad, err := json.Marshal(map[ftMethod]struct{}{ + paramsPayload, err := json.Marshal(map[ftMethod]struct{}{ ftMethodParams: {}, }) requireT.NoError(err) - queryOut, err := chain.Wasm.QueryWASMContract(ctx, contractAddr, paramsPayLoad) + queryOut, err := chain.Wasm.QueryWASMContract(ctx, contractAddr, paramsPayload) requireT.NoError(err) var wasmParamsRes assetfttypes.QueryParamsResponse requireT.NoError(json.Unmarshal(queryOut, &wasmParamsRes)) @@ -2931,11 +2963,11 @@ func TestWASMNonFungibleTokenInContractLegacy(t *testing.T) { // ********** Params ********** - paramsPayLoad, err := json.Marshal(map[moduleswasm.NftMethod]struct{}{ + paramsPayload, err := json.Marshal(map[moduleswasm.NftMethod]struct{}{ moduleswasm.NftMethodParams: {}, }) requireT.NoError(err) - queryOut, err := chain.Wasm.QueryWASMContract(ctx, contractAddr, paramsPayLoad) + queryOut, err := chain.Wasm.QueryWASMContract(ctx, contractAddr, paramsPayload) requireT.NoError(err) var wasmParamsRes assetnfttypes.QueryParamsResponse requireT.NoError(json.Unmarshal(queryOut, &wasmParamsRes)) @@ -3066,11 +3098,11 @@ func TestWASMNonFungibleTokenInContractLegacy(t *testing.T) { _, err = chain.Wasm.ExecuteWASMContract(ctx, txf, admin, contractAddr, classFreezePayload, sdk.Coin{}) requireT.NoError(err) - classFrozenAccountsPayLoad, err := json.Marshal(map[moduleswasm.NftMethod]struct{}{ + classFrozenAccountsPayload, err := json.Marshal(map[moduleswasm.NftMethod]struct{}{ moduleswasm.NftMethodClassFrozenAccounts: {}, }) requireT.NoError(err) - queryOut, err = chain.Wasm.QueryWASMContract(ctx, contractAddr, classFrozenAccountsPayLoad) + queryOut, err = chain.Wasm.QueryWASMContract(ctx, contractAddr, classFrozenAccountsPayload) requireT.NoError(err) var classFrozenAccountsQueryRes assetnfttypes.QueryClassFrozenAccountsResponse requireT.NoError(json.Unmarshal(queryOut, &classFrozenAccountsQueryRes)) @@ -3117,11 +3149,11 @@ func TestWASMNonFungibleTokenInContractLegacy(t *testing.T) { _, err = chain.Wasm.ExecuteWASMContract(ctx, txf, admin, contractAddr, addToClassWhitelistPayload, sdk.Coin{}) requireT.NoError(err) - classWhitelistedAccountsPayLoad, err := json.Marshal(map[moduleswasm.NftMethod]struct{}{ + classWhitelistedAccountsPayload, err := json.Marshal(map[moduleswasm.NftMethod]struct{}{ moduleswasm.NftMethodClassWhitelistedAccounts: {}, }) requireT.NoError(err) - queryOut, err = chain.Wasm.QueryWASMContract(ctx, contractAddr, classWhitelistedAccountsPayLoad) + queryOut, err = chain.Wasm.QueryWASMContract(ctx, contractAddr, classWhitelistedAccountsPayload) requireT.NoError(err) var classWhitelistedAccountsQueryRes assetnfttypes.QueryClassWhitelistedAccountsResponse requireT.NoError(json.Unmarshal(queryOut, &classWhitelistedAccountsQueryRes)) @@ -3632,7 +3664,6 @@ func TestWASMDEXInContract(t *testing.T) { clientCtx := chain.ClientContext txf := chain.TxFactoryAuto() bankClient := banktypes.NewQueryClient(clientCtx) - assetftClient := assetfttypes.NewQueryClient(clientCtx) tmQueryClient := cmtservice.NewServiceClient(chain.ClientContext) dexParms := chain.QueryDEXParams(ctx, t) @@ -3672,10 +3703,6 @@ func TestWASMDEXInContract(t *testing.T) { requireT.NoError(err) denom1 := assetfttypes.BuildDenom(issueMsg.Subunit, issuer) - // Issue another fungible token using smart contract - burnRate := "1000000000000000000" // LegacyDec has 18 decimal positions, so here we are passing 1e19= 100% - sendCommissionRate := "1000000000000000000" // LegacyDec has 18 decimal positions, so here we are passing 1e19 = 100% - issuanceAmount := sdkmath.NewInt(10_000_000) issuanceReq := issueFTRequest{ Symbol: "ABC2", @@ -3688,10 +3715,14 @@ func TestWASMDEXInContract(t *testing.T) { assetfttypes.Feature_dex_order_cancellation, assetfttypes.Feature_dex_unified_ref_amount_change, }, - BurnRate: burnRate, - SendCommissionRate: sendCommissionRate, + BurnRate: sdkmath.LegacyMustNewDecFromStr("1").BigInt().String(), + SendCommissionRate: sdkmath.LegacyMustNewDecFromStr("1").BigInt().String(), URI: "https://example.com", URIHash: "1234567890abcdef", + DEXSettings: &ftDEXSettings{ + UnifiedRefAmount: sdkmath.LegacyMustNewDecFromStr("150").BigInt().String(), + WhitelistedDenoms: []string{denom1}, + }, } issuerFTInstantiatePayload, err := json.Marshal(issuanceReq) requireT.NoError(err) @@ -3741,13 +3772,13 @@ func TestWASMDEXInContract(t *testing.T) { blockRes, err := tmQueryClient.GetLatestBlock(ctx, &cmtservice.GetLatestBlockRequest{}) requireT.NoError(err) - // ********** Query Params ********** + // ********** Query params ********** - paramsPayLoad, err := json.Marshal(map[dexMethod]struct{}{ + paramsPayload, err := json.Marshal(map[dexMethod]struct{}{ dexMethodParams: {}, }) requireT.NoError(err) - queryOut, err := chain.Wasm.QueryWASMContract(ctx, contractAddr, paramsPayLoad) + queryOut, err := chain.Wasm.QueryWASMContract(ctx, contractAddr, paramsPayload) requireT.NoError(err) var wasmParamsRes dextypes.QueryParamsResponse requireT.NoError(json.Unmarshal(queryOut, &wasmParamsRes)) @@ -3761,6 +3792,55 @@ func TestWASMDEXInContract(t *testing.T) { dexParms.PriceTickExponent, wasmParamsRes.Params.PriceTickExponent, ) + // ********** Query and update asset FT DEX settings ********** + + dexSettingsPayload, err := json.Marshal(map[dexMethod]dexSettingsDEXRequest{ + dexMethodDEXSettings: { + denom2, + }, + }) + requireT.NoError(err) + queryOut, err = chain.Wasm.QueryWASMContract(ctx, contractAddr, dexSettingsPayload) + requireT.NoError(err) + //nolint:tagliatelle + var dexSettingsRes struct { + DEXSettings ftDEXSettings `json:"dex_settings"` + } + requireT.NoError(json.Unmarshal(queryOut, &dexSettingsRes)) + requireT.Equal(*issuanceReq.DEXSettings, dexSettingsRes.DEXSettings) + + newUnifiedRefAmount := sdkmath.LegacyMustNewDecFromStr("19000") + updateDEXUnifiedRefAmountPayload, err := json.Marshal(map[dexMethod]updateDEXUnifiedRefAmountRequest{ + dexMethodUpdateDEXUnifiedRefAmount: { + Denom: denom2, + Amount: newUnifiedRefAmount.BigInt().String(), + }, + }) + requireT.NoError(err) + _, err = chain.Wasm.ExecuteWASMContract(ctx, txf, admin, contractAddr, updateDEXUnifiedRefAmountPayload, sdk.Coin{}) + requireT.NoError(err) + + newWhitelistedDenoms := []string{denom1, chain.ChainSettings.Denom} + updateDEXWhitelistedDenomsPayload, err := json.Marshal(map[dexMethod]updateDEXWhitelistedDenoms{ + dexMethodUpdateDEXWhitelistedDenoms: { + Denom: denom2, + WhitelistedDenoms: newWhitelistedDenoms, + }, + }) + requireT.NoError(err) + _, err = chain.Wasm.ExecuteWASMContract(ctx, txf, admin, contractAddr, updateDEXWhitelistedDenomsPayload, sdk.Coin{}) + requireT.NoError(err) + + queryOut, err = chain.Wasm.QueryWASMContract(ctx, contractAddr, dexSettingsPayload) + requireT.NoError(err) + requireT.NoError(json.Unmarshal(queryOut, &dexSettingsRes)) + requireT.Equal( + ftDEXSettings{ + UnifiedRefAmount: newUnifiedRefAmount.BigInt().String(), + WhitelistedDenoms: newWhitelistedDenoms, + }, dexSettingsRes.DEXSettings, + ) + // ********** Place Order ********** orderQuantity := sdkmath.NewInt(100) @@ -3787,16 +3867,22 @@ func TestWASMDEXInContract(t *testing.T) { _, err = chain.Wasm.ExecuteWASMContract(ctx, txf, admin, contractAddr, placeOrderPayload, sdk.Coin{}) requireT.NoError(err) - assetftBalanceRes, err := assetftClient.Balance(ctx, &assetfttypes.QueryBalanceRequest{ - Account: contractAddr, - Denom: denom1, + balancePayload, err := json.Marshal(map[dexMethod]balanceDEXRequest{ + dexMethodBalance: { + Account: contractAddr, + Denom: denom1, + }, }) requireT.NoError(err) - requireT.Equal(orderQuantity.String(), assetftBalanceRes.LockedInDEX.String()) + queryOut, err = chain.Wasm.QueryWASMContract(ctx, contractAddr, balancePayload) + requireT.NoError(err) + var ftBalanceRes assetfttypes.QueryBalanceResponse + requireT.NoError(json.Unmarshal(queryOut, &ftBalanceRes)) + requireT.Equal(orderQuantity.String(), ftBalanceRes.LockedInDEX.String()) // ********** Query Order ********** - orderPayload, err := json.Marshal(map[dexMethod]OrderBodyDEXRequest{ + orderPayload, err := json.Marshal(map[dexMethod]orderBodyDEXRequest{ dexMethodOrder: { Account: contractAddr, OrderID: "id1", @@ -3830,7 +3916,7 @@ func TestWASMDEXInContract(t *testing.T) { // ********** Query Orders ********** - ordersPayload, err := json.Marshal(map[dexMethod]OrdersBodyDEXRequest{ + ordersPayload, err := json.Marshal(map[dexMethod]ordersBodyDEXRequest{ dexMethodOrders: { Creator: contractAddr, }, @@ -3864,7 +3950,7 @@ func TestWASMDEXInContract(t *testing.T) { // ********** Query Order Book Orders ********** - orderBookOrdersPayload, err := json.Marshal(map[dexMethod]OrderBookOrdersBodyDEXRequest{ + orderBookOrdersPayload, err := json.Marshal(map[dexMethod]orderBookOrdersBodyDEXRequest{ dexMethodOrderBookOrders: { BaseDenom: denom1, QuoteDenom: denom2, @@ -3883,7 +3969,7 @@ func TestWASMDEXInContract(t *testing.T) { // ********** Query Account Denom Orders Count ********** - accountDenomOrdersCountPayload, err := json.Marshal(map[dexMethod]AccountDenomOrdersCountBodyDEXRequest{ + accountDenomOrdersCountPayload, err := json.Marshal(map[dexMethod]accountDenomOrdersCountBodyDEXRequest{ dexMethodAccountDenomOrdersCount: { Account: contractAddr, Denom: denom1, diff --git a/proto/coreum/asset/ft/v1/query.proto b/proto/coreum/asset/ft/v1/query.proto index 6272d0955..81d213e7b 100644 --- a/proto/coreum/asset/ft/v1/query.proto +++ b/proto/coreum/asset/ft/v1/query.proto @@ -15,11 +15,13 @@ option go_package = "github.com/CoreumFoundation/coreum/v5/x/asset/ft/types"; service Query { // Params queries the parameters of x/asset/ft module. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/coreum/asset/ft/v1/params"; } // Tokens queries the fungible tokens of the module. rpc Tokens(QueryTokensRequest) returns (QueryTokensResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/coreum/asset/ft/v1/tokens"; } @@ -31,16 +33,19 @@ service Query { // TokenUpgradeStatuses returns token upgrades info. rpc TokenUpgradeStatuses(QueryTokenUpgradeStatusesRequest) returns (QueryTokenUpgradeStatusesResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/coreum/asset/ft/v1/tokens/{denom}/upgrade-statuses"; } // Balance returns balance of the denom for the account. rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/coreum/asset/ft/v1/accounts/{account}/balances/summary/{denom}"; } // FrozenBalances returns all the frozen balances for the account. rpc FrozenBalances(QueryFrozenBalancesRequest) returns (QueryFrozenBalancesResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/coreum/asset/ft/v1/accounts/{account}/balances/frozen"; } @@ -52,6 +57,7 @@ service Query { // WhitelistedBalances returns all the whitelisted balances for the account. rpc WhitelistedBalances(QueryWhitelistedBalancesRequest) returns (QueryWhitelistedBalancesResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/coreum/asset/ft/v1/accounts/{account}/balances/whitelisted"; } @@ -63,6 +69,7 @@ service Query { // DEXSettings returns DEX settings of the denom. rpc DEXSettings(QueryDEXSettingsRequest) returns (QueryDEXSettingsResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/coreum/asset/ft/v1/tokens/{denom}/dex-settings"; } } diff --git a/proto/coreum/asset/ft/v1/token.proto b/proto/coreum/asset/ft/v1/token.proto index 5f1cd7934..d251dd2b2 100644 --- a/proto/coreum/asset/ft/v1/token.proto +++ b/proto/coreum/asset/ft/v1/token.proto @@ -105,7 +105,7 @@ message TokenUpgradeStatuses { // DEXSettings defines the token settings of the dex. message DEXSettings { - // unified_ref_amount is the approximate amount you need to by 1USD, used to define the price tick size + // unified_ref_amount is the approximate amount you need to buy 1USD, used to define the price tick size string unified_ref_amount = 1 [(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec"]; // whitelisted_denoms is the list of denoms to trade with. repeated string whitelisted_denoms = 2; diff --git a/proto/coreum/asset/ft/v1/tx.proto b/proto/coreum/asset/ft/v1/tx.proto index 1ac663aea..f074c5229 100644 --- a/proto/coreum/asset/ft/v1/tx.proto +++ b/proto/coreum/asset/ft/v1/tx.proto @@ -243,7 +243,7 @@ message MsgUpdateDEXUnifiedRefAmount { string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string denom = 2; - // unified_ref_amount is the approximate amount you need to by 1USD, used to define the price tick size + // unified_ref_amount is the approximate amount you need to buy 1USD, used to define the price tick size string unified_ref_amount = 3 [ (gogoproto.nullable) = false, (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec" diff --git a/proto/coreum/dex/v1/params.proto b/proto/coreum/dex/v1/params.proto index 331b90bce..ff58c844a 100644 --- a/proto/coreum/dex/v1/params.proto +++ b/proto/coreum/dex/v1/params.proto @@ -8,7 +8,7 @@ option go_package = "github.com/CoreumFoundation/coreum/v5/x/dex/types"; // Params keeps gov manageable parameters. message Params { - // default_unified_ref_amount is the default approximate amount you need to by 1USD, used to for tokens without custom value + // default_unified_ref_amount is the default approximate amount you need to buy 1USD, used to for tokens without custom value string default_unified_ref_amount = 1 [ (gogoproto.nullable) = false, (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec" diff --git a/x/asset/ft/client/cli/tx.go b/x/asset/ft/client/cli/tx.go index f09471121..57065b668 100644 --- a/x/asset/ft/client/cli/tx.go +++ b/x/asset/ft/client/cli/tx.go @@ -252,7 +252,7 @@ $ %s tx %s issue WBTC wsatoshi 8 100000 "Wrapped Bitcoin Token" --from [issuer] //nolint:lll // breaking this down will make it look worse when printed to user screen. cmd.Flags().String(ExtensionIssuanceMsgFlag, "{}", "Optional json encoded data to pass to WASM on instantiation by the ft issuer.") //nolint:lll // breaking this down will make it look worse when printed to user screen. - cmd.Flags().String(DEXUnifiedRefAmountFlag, "", "DEX unified ref amount is the approximate amount you need to by 1USD, used to define the price tick size.") + cmd.Flags().String(DEXUnifiedRefAmountFlag, "", "DEX unified ref amount is the approximate amount you need to buy 1USD, used to define the price tick size.") flags.AddTxFlagsToCmd(cmd) diff --git a/x/asset/ft/keeper/grpc_query.go b/x/asset/ft/keeper/grpc_query.go index 24208461f..8e259657f 100644 --- a/x/asset/ft/keeper/grpc_query.go +++ b/x/asset/ft/keeper/grpc_query.go @@ -127,7 +127,7 @@ func (qs QueryService) Balance( denom := req.GetDenom() vestingLocked := qs.bankKeeper.LockedCoins(ctx, account).AmountOf(denom) dexLocked := qs.keeper.GetDEXLockedBalance(sdk.UnwrapSDKContext(ctx), account, denom).Amount - expectedToReceiveInDex := qs.keeper.GetDEXExpectedToReceivedBalance( + expectedToReceiveInDEX := qs.keeper.GetDEXExpectedToReceivedBalance( sdk.UnwrapSDKContext(ctx), account, denom, ).Amount @@ -145,7 +145,7 @@ func (qs QueryService) Balance( Locked: vestingLocked.Add(dexLocked), LockedInVesting: vestingLocked, LockedInDEX: dexLocked, - ExpectedToReceiveInDEX: expectedToReceiveInDex, + ExpectedToReceiveInDEX: expectedToReceiveInDEX, }, nil } diff --git a/x/asset/ft/types/query.pb.go b/x/asset/ft/types/query.pb.go index d9afccfbe..efd9f6d78 100644 --- a/x/asset/ft/types/query.pb.go +++ b/x/asset/ft/types/query.pb.go @@ -1030,83 +1030,83 @@ func init() { func init() { proto.RegisterFile("coreum/asset/ft/v1/query.proto", fileDescriptor_e9fe336d9bdb8f05) } var fileDescriptor_e9fe336d9bdb8f05 = []byte{ - // 1208 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0xcd, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0xa6, 0x89, 0x53, 0x26, 0x04, 0xd4, 0x49, 0x08, 0xee, 0xb6, 0xd8, 0x61, 0x05, 0x69, - 0x28, 0xcd, 0x0e, 0x49, 0x9a, 0x26, 0xa8, 0xa2, 0x05, 0xe7, 0xa3, 0x0a, 0x41, 0xc2, 0xb8, 0x85, - 0x54, 0x08, 0x29, 0xda, 0x78, 0x27, 0xce, 0x2a, 0x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xd1, 0x51, 0x46, 0x7b, 0x72, 0x94, 0xd1, 0xfe, 0x38, 0xca, - 0x68, 0x0f, 0x8e, 0x33, 0x7d, 0x4f, 0x8e, 0x33, 0x7d, 0xbf, 0x1e, 0x67, 0xfa, 0x3e, 0xbc, 0x16, - 0x1a, 0x28, 0x96, 0x24, 0xe9, 0x2a, 0xab, 0xb9, 0xb6, 0x1c, 0x51, 0x7c, 0x95, 0xfa, 0x3c, 0x69, - 0x04, 0x52, 0x72, 0xc8, 0xd8, 0x4a, 0xc9, 0x7f, 0x52, 0xcc, 0xfd, 0x1d, 0x00, 0x00, 0xff, 0xff, - 0xd7, 0xd2, 0x61, 0x1e, 0xb8, 0x11, 0x00, 0x00, + // 1213 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0xa6, 0x89, 0x53, 0x26, 0x04, 0xd4, 0x49, 0x08, 0xee, 0xb6, 0xd8, 0x61, 0x05, 0x49, + 0x28, 0xcd, 0x0e, 0x49, 0x9a, 0x26, 0x88, 0x1f, 0x2d, 0xce, 0x0f, 0x08, 0xa9, 0x84, 0x71, 0x0b, + 0xa9, 0x10, 0x52, 0xb4, 0xf6, 0x4e, 0x9c, 0x55, 0xe2, 0x1d, 0xd7, 0x33, 0x36, 0x0e, 0x55, 0x39, + 0x94, 0x03, 0x1c, 0x2b, 0x71, 0xe0, 0x3f, 0xe0, 0xd0, 0x13, 0x27, 0x2e, 0x9c, 0x91, 0x2a, 0x2e, + 0xa9, 0x04, 0x07, 0xc4, 0x21, 0xa0, 0x04, 0x89, 0x7f, 0x03, 0xed, 0xcc, 0x5b, 0xef, 0x1a, 0xaf, + 0xed, 0x75, 0x88, 0x90, 0x7a, 0xf2, 0xee, 0xec, 0xfb, 0xbe, 0xf7, 0x7d, 0x33, 0x6f, 0x66, 0x9e, + 0x8c, 0x52,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0xa7, 0x1d, 0xd5, 0xdd, 0x11, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/asset/ft/types/token.pb.go b/x/asset/ft/types/token.pb.go index 932b52f06..80d4d266f 100644 --- a/x/asset/ft/types/token.pb.go +++ b/x/asset/ft/types/token.pb.go @@ -345,7 +345,7 @@ func (m *TokenUpgradeStatuses) GetV1() *TokenUpgradeV1Status { // DEXSettings defines the token settings of the dex. type DEXSettings struct { - // unified_ref_amount is the approximate amount you need to by 1USD, used to define the price tick size + // unified_ref_amount is the approximate amount you need to buy 1USD, used to define the price tick size UnifiedRefAmount *cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=unified_ref_amount,json=unifiedRefAmount,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"unified_ref_amount,omitempty"` // whitelisted_denoms is the list of denoms to trade with. WhitelistedDenoms []string `protobuf:"bytes,2,rep,name=whitelisted_denoms,json=whitelistedDenoms,proto3" json:"whitelisted_denoms,omitempty"` diff --git a/x/asset/ft/types/tx.pb.go b/x/asset/ft/types/tx.pb.go index 886ca4c17..295a65de8 100644 --- a/x/asset/ft/types/tx.pb.go +++ b/x/asset/ft/types/tx.pb.go @@ -643,7 +643,7 @@ var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo type MsgUpdateDEXUnifiedRefAmount struct { Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` - // unified_ref_amount is the approximate amount you need to by 1USD, used to define the price tick size + // unified_ref_amount is the approximate amount you need to buy 1USD, used to define the price tick size UnifiedRefAmount cosmossdk_io_math.LegacyDec `protobuf:"bytes,3,opt,name=unified_ref_amount,json=unifiedRefAmount,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"unified_ref_amount"` } diff --git a/x/dex/types/params.pb.go b/x/dex/types/params.pb.go index 46a022d1f..9ab538331 100644 --- a/x/dex/types/params.pb.go +++ b/x/dex/types/params.pb.go @@ -28,7 +28,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params keeps gov manageable parameters. type Params struct { - // default_unified_ref_amount is the default approximate amount you need to by 1USD, used to for tokens without custom value + // default_unified_ref_amount is the default approximate amount you need to buy 1USD, used to for tokens without custom value DefaultUnifiedRefAmount cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=default_unified_ref_amount,json=defaultUnifiedRefAmount,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"default_unified_ref_amount"` // price_tick_exponent is the exponent used for the price tick calculation PriceTickExponent int32 `protobuf:"varint,2,opt,name=price_tick_exponent,json=priceTickExponent,proto3" json:"price_tick_exponent,omitempty"` diff --git a/x/wasm/handler/message.go b/x/wasm/handler/message.go index 4306a71a0..7b16d6d47 100644 --- a/x/wasm/handler/message.go +++ b/x/wasm/handler/message.go @@ -93,6 +93,7 @@ type coreumMsg struct { // NewCoreumMsgHandler returns coreum handler that handles messages received from smart contracts. // The in the input sender is the address of smart contract. +// Deprecated: Supported for backward compatibility of legacy smart contracts only. func NewCoreumMsgHandler() *wasmkeeper.MessageEncoders { return &wasmkeeper.MessageEncoders{ Custom: func(sender sdk.AccAddress, msg json.RawMessage) ([]sdk.Msg, error) { diff --git a/x/wasm/handler/query.go b/x/wasm/handler/query.go index 7764a4ca7..0a100ad32 100644 --- a/x/wasm/handler/query.go +++ b/x/wasm/handler/query.go @@ -241,6 +241,7 @@ func convertStringToDataBytes(dataString string) (*codectypes.Any, error) { return dataValue, nil } +// Deprecated: Supported for backward compatibility of legacy smart contracts only. func processCoreumQuery( ctx sdk.Context, queries coreumQuery,