From daf06357e9d67b17e7033fbfff564e070e3115cd Mon Sep 17 00:00:00 2001 From: Artem Linetskiy Date: Fri, 25 Oct 2024 17:13:16 +0200 Subject: [PATCH 1/5] Add timeout to CI jobs (#1011) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8573f56e3..ff4297c35 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,7 @@ concurrency: jobs: ci: + timeout-minutes: 60 strategy: fail-fast: false matrix: @@ -72,4 +73,3 @@ jobs: if: failure() uses: jwalton/gh-docker-logs@v2 - From 11a451e7a54192efbc16c6c30d9e1f5b61d6efe9 Mon Sep 17 00:00:00 2001 From: Masih Yeganeh Date: Tue, 29 Oct 2024 22:24:06 +0330 Subject: [PATCH 2/5] Test DEX messages and queries in wasm (#1012) * Test DEX messages and queries in wasm * Use module_query_safe for gRPC query accept list * Update dependencies * Fix FT bug * Fix NFT bug * Fix CI errors * Disable breakingProto * Fix linter errors * Fix naming in ExtensionIssueSettings message * Fix tests * Fix lints * Fix unchecked nils * Gave up * Fix FT test --- build/coreum/build.go | 2 +- build/coreum/generate-proto-breaking.go | 3 + docs/api.md | 4 +- docs/static/openapi.json | 4 +- .../modules/authz-nft-trade/Cargo.lock | 71 +- .../modules/authz-nft-trade/Cargo.toml | 2 +- .../modules/authz-stargate/Cargo.lock | 69 +- .../modules/authz-stargate/Cargo.toml | 2 +- .../modules/authz-transfer/Cargo.lock | 69 +- .../modules/authz-transfer/Cargo.toml | 2 +- .../contracts/modules/bank-send/Cargo.lock | 69 +- .../contracts/modules/bank-send/Cargo.toml | 2 +- .../contracts/modules/contract.go | 2 + .../contracts/modules/dex/Cargo.lock | 1202 +++++++++++++++++ .../contracts/modules/dex/Cargo.toml | 36 + .../contracts/modules/dex/src/contract.rs | 313 +++++ .../contracts/modules/dex/src/error.rs | 8 + .../contracts/modules/dex/src/lib.rs | 3 + .../contracts/modules/dex/src/msg.rs | 49 + .../contracts/modules/ft/Cargo.lock | 131 +- .../contracts/modules/ft/Cargo.toml | 2 +- .../contracts/modules/ft/src/contract.rs | 31 +- .../contracts/modules/ft/src/msg.rs | 18 +- .../contracts/modules/nft/Cargo.lock | 69 +- .../contracts/modules/nft/Cargo.toml | 2 +- .../contracts/modules/nft/src/contract.rs | 2 +- .../modules/assetft_extension_test.go | 17 +- integration-tests/modules/dex_test.go | 2 +- integration-tests/modules/wasm_test.go | 396 +++++- proto/coreum/asset/ft/v1/query.proto | 4 + proto/coreum/asset/ft/v1/tx.proto | 2 +- proto/coreum/asset/nft/v1/query.proto | 3 + proto/coreum/dex/v1/query.proto | 11 +- testutil/integration/coreum.go | 12 + .../test-contracts/asset-extension/Cargo.lock | 70 +- .../test-contracts/asset-extension/Cargo.toml | 4 +- x/asset/ft/types/query.pb.go | 153 +-- x/asset/ft/types/tx.pb.go | 192 +-- x/asset/nft/types/query.pb.go | 135 +- x/dex/client/cli/query.go | 2 +- x/dex/keeper/grpc_query.go | 4 +- x/dex/types/query.pb.go | 133 +- x/dex/types/query.pb.gw.go | 30 +- x/wasm/handler/query.go | 78 +- 44 files changed, 2658 insertions(+), 757 deletions(-) create mode 100644 integration-tests/contracts/modules/dex/Cargo.lock create mode 100644 integration-tests/contracts/modules/dex/Cargo.toml create mode 100644 integration-tests/contracts/modules/dex/src/contract.rs create mode 100644 integration-tests/contracts/modules/dex/src/error.rs create mode 100644 integration-tests/contracts/modules/dex/src/lib.rs create mode 100644 integration-tests/contracts/modules/dex/src/msg.rs diff --git a/build/coreum/build.go b/build/coreum/build.go index 0812ca0e5..8d63f9d0a 100644 --- a/build/coreum/build.go +++ b/build/coreum/build.go @@ -195,7 +195,7 @@ func Lint(ctx context.Context, deps types.DepsFunc) error { CompileAllSmartContracts, formatProto, lintProto, - breakingProto, + // breakingProto, // TODO: uncomment in next PR ) return golang.Lint(ctx, deps) } diff --git a/build/coreum/generate-proto-breaking.go b/build/coreum/generate-proto-breaking.go index 6df51dae3..5e869f1a5 100644 --- a/build/coreum/generate-proto-breaking.go +++ b/build/coreum/generate-proto-breaking.go @@ -1,3 +1,4 @@ +//nolint:unused package coreum import ( @@ -21,8 +22,10 @@ import ( ) //go:embed proto-breaking.tmpl.json +//nolint:unused // TODO: uncomment in next PR var configBreakingTmpl string +//nolint:deadcode func breakingProto(ctx context.Context, deps types.DepsFunc) error { deps(golang.Tidy, tools.EnsureProtoc, tools.EnsureProtocGenBufBreaking) diff --git a/docs/api.md b/docs/api.md index 589eec78a..dce78466f 100644 --- a/docs/api.md +++ b/docs/api.md @@ -2564,7 +2564,7 @@ the source code for the extension. | `code_id` | [uint64](#uint64) | | `code_id is the reference to the stored WASM code` | | `label` | [string](#string) | | `label is optional metadata to be stored with a contract instance.` | | `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | `funds coins that are transferred to the contract on instantiation` | -| `issuanceMsg` | [bytes](#bytes) | | `optional json encoded data to pass to WASM on instantiation by the ft issuer` | +| `issuance_msg` | [bytes](#bytes) | | `optional json encoded data to pass to WASM on instantiation by the ft issuer` | @@ -5184,7 +5184,7 @@ Query defines the gRPC query service. | `Order` | [QueryOrderRequest](#coreum.dex.v1.QueryOrderRequest) | [QueryOrderResponse](#coreum.dex.v1.QueryOrderResponse) | `Order queries order by creator and ID.` | GET|/coreum/dex/v1/orders/{creator}/{id} | | `Orders` | [QueryOrdersRequest](#coreum.dex.v1.QueryOrdersRequest) | [QueryOrdersResponse](#coreum.dex.v1.QueryOrdersResponse) | `Orders queries creator orders.` | GET|/coreum/dex/v1/orders/{creator} | | `OrderBooks` | [QueryOrderBooksRequest](#coreum.dex.v1.QueryOrderBooksRequest) | [QueryOrderBooksResponse](#coreum.dex.v1.QueryOrderBooksResponse) | `OrderBooks queries order books.` | GET|/coreum/dex/v1/order-books | -| `OrdersBookOrders` | [QueryOrderBookOrdersRequest](#coreum.dex.v1.QueryOrderBookOrdersRequest) | [QueryOrderBookOrdersResponse](#coreum.dex.v1.QueryOrderBookOrdersResponse) | `OrdersBookOrders queries order book orders.` | GET|/coreum/dex/v1/order-books/{base_denom}/{quote_denom}/orders | +| `OrderBookOrders` | [QueryOrderBookOrdersRequest](#coreum.dex.v1.QueryOrderBookOrdersRequest) | [QueryOrderBookOrdersResponse](#coreum.dex.v1.QueryOrderBookOrdersResponse) | `OrderBookOrders queries order book orders.` | GET|/coreum/dex/v1/order-books/{base_denom}/{quote_denom}/orders | | `AccountDenomOrdersCount` | [QueryAccountDenomOrdersCountRequest](#coreum.dex.v1.QueryAccountDenomOrdersCountRequest) | [QueryAccountDenomOrdersCountResponse](#coreum.dex.v1.QueryAccountDenomOrdersCountResponse) | `AccountDenomOrdersCount queries account denom orders count.` | GET|/coreum/dex/v1/accounts/{account}/denoms/{denom}/orders-count | diff --git a/docs/static/openapi.json b/docs/static/openapi.json index 363d9f6ba..190396045 100644 --- a/docs/static/openapi.json +++ b/docs/static/openapi.json @@ -1139,7 +1139,7 @@ }, "/coreum/dex/v1/order-books/{base_denom}/{quote_denom}/orders": { "get": { - "operationId": "GithubComCoreumFoundationCoreumV5XDexTypesOrdersBookOrders", + "operationId": "GithubComCoreumFoundationCoreumV5XDexTypesOrderBookOrders", "parameters": [ { "name": "base_denom", @@ -1221,7 +1221,7 @@ } } }, - "summary": "OrdersBookOrders queries order book orders.", + "summary": "OrderBookOrders queries order book orders.", "tags": [ "Query" ] diff --git a/integration-tests/contracts/modules/authz-nft-trade/Cargo.lock b/integration-tests/contracts/modules/authz-nft-trade/Cargo.lock index 13c21cf20..3a60c2751 100644 --- a/integration-tests/contracts/modules/authz-nft-trade/Cargo.lock +++ b/integration-tests/contracts/modules/authz-nft-trade/Cargo.lock @@ -157,7 +157,7 @@ dependencies = [ "cw-storage-plus", "cw-utils", "cw2", - "prost 0.12.6", + "prost", "thiserror", ] @@ -233,17 +233,30 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "coreum-std-derive" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fee3df604ec822e6a66c0279f2d8840da010f8e07503423ba413baac03c830f" +dependencies = [ + "itertools 0.10.5", + "proc-macro2", + "prost", + "quote", + "syn 1.0.109", +] + [[package]] name = "coreum-wasm-sdk" version = "1.1.0" -source = "git+https://github.com/CoreumFoundation/coreum-wasm-sdk.git?branch=upgrade-cosmwasm-std#0c2f105969a2ce3711c6da2a9e6b9613d6c787d6" +source = "git+https://github.com/CoreumFoundation/coreum-wasm-sdk.git#352e54d12300d263ce135579d5d697d3e46c8431" dependencies = [ "chrono", + "coreum-std-derive", "cosmwasm-schema", "cosmwasm-std", - "osmosis-std-derive", - "prost 0.12.6", - "prost-types 0.12.6", + "prost", + "prost-types", "schemars", "serde", "serde-cw-value", @@ -744,18 +757,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "osmosis-std-derive" -version = "0.20.1" -source = "git+https://github.com/CoreumFoundation/osmosis-std-derive.git?branch=cosmwasm_2_0#7b837aa9fae698f8432003d44d80e19921b615ea" -dependencies = [ - "itertools 0.10.5", - "proc-macro2", - "prost-types 0.11.9", - "quote", - "syn 1.0.109", -] - [[package]] name = "p256" version = "0.13.2" @@ -801,16 +802,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "prost" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" -dependencies = [ - "bytes", - "prost-derive 0.11.9", -] - [[package]] name = "prost" version = "0.12.6" @@ -818,20 +809,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", - "prost-derive 0.12.6", -] - -[[package]] -name = "prost-derive" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" -dependencies = [ - "anyhow", - "itertools 0.10.5", - "proc-macro2", - "quote", - "syn 1.0.109", + "prost-derive", ] [[package]] @@ -847,22 +825,13 @@ dependencies = [ "syn 2.0.79", ] -[[package]] -name = "prost-types" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" -dependencies = [ - "prost 0.11.9", -] - [[package]] name = "prost-types" version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" dependencies = [ - "prost 0.12.6", + "prost", ] [[package]] diff --git a/integration-tests/contracts/modules/authz-nft-trade/Cargo.toml b/integration-tests/contracts/modules/authz-nft-trade/Cargo.toml index 80b5dc4b6..8515376de 100644 --- a/integration-tests/contracts/modules/authz-nft-trade/Cargo.toml +++ b/integration-tests/contracts/modules/authz-nft-trade/Cargo.toml @@ -29,6 +29,6 @@ cosmwasm-std = { version = "2.1.4", features = ["cosmwasm_2_0"] } cw2 = "2.0.0" cw-storage-plus = "2.0.0" cosmwasm-schema = "2.1.4" -coreum-wasm-sdk = {git = "https://github.com/CoreumFoundation/coreum-wasm-sdk.git", branch = "upgrade-cosmwasm-std"} +coreum-wasm-sdk = { git = "https://github.com/CoreumFoundation/coreum-wasm-sdk.git" } cw-utils = "2.0.0" prost = "0.12.6" diff --git a/integration-tests/contracts/modules/authz-stargate/Cargo.lock b/integration-tests/contracts/modules/authz-stargate/Cargo.lock index 5ddf380dd..25d20e0fa 100644 --- a/integration-tests/contracts/modules/authz-stargate/Cargo.lock +++ b/integration-tests/contracts/modules/authz-stargate/Cargo.lock @@ -230,17 +230,30 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "coreum-std-derive" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fee3df604ec822e6a66c0279f2d8840da010f8e07503423ba413baac03c830f" +dependencies = [ + "itertools 0.10.5", + "proc-macro2", + "prost", + "quote", + "syn 1.0.109", +] + [[package]] name = "coreum-wasm-sdk" version = "1.1.0" -source = "git+https://github.com/CoreumFoundation/coreum-wasm-sdk.git?branch=upgrade-cosmwasm-std#0c2f105969a2ce3711c6da2a9e6b9613d6c787d6" +source = "git+https://github.com/CoreumFoundation/coreum-wasm-sdk.git#352e54d12300d263ce135579d5d697d3e46c8431" dependencies = [ "chrono", + "coreum-std-derive", "cosmwasm-schema", "cosmwasm-std", - "osmosis-std-derive", - "prost 0.12.6", - "prost-types 0.12.6", + "prost", + "prost-types", "schemars", "serde", "serde-cw-value", @@ -728,18 +741,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "osmosis-std-derive" -version = "0.20.1" -source = "git+https://github.com/CoreumFoundation/osmosis-std-derive.git?branch=cosmwasm_2_0#7b837aa9fae698f8432003d44d80e19921b615ea" -dependencies = [ - "itertools 0.10.5", - "proc-macro2", - "prost-types 0.11.9", - "quote", - "syn 1.0.109", -] - [[package]] name = "p256" version = "0.13.2" @@ -785,16 +786,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "prost" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" -dependencies = [ - "bytes", - "prost-derive 0.11.9", -] - [[package]] name = "prost" version = "0.12.6" @@ -802,20 +793,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", - "prost-derive 0.12.6", -] - -[[package]] -name = "prost-derive" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" -dependencies = [ - "anyhow", - "itertools 0.10.5", - "proc-macro2", - "quote", - "syn 1.0.109", + "prost-derive", ] [[package]] @@ -831,22 +809,13 @@ dependencies = [ "syn 2.0.79", ] -[[package]] -name = "prost-types" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" -dependencies = [ - "prost 0.11.9", -] - [[package]] name = "prost-types" version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" dependencies = [ - "prost 0.12.6", + "prost", ] [[package]] diff --git a/integration-tests/contracts/modules/authz-stargate/Cargo.toml b/integration-tests/contracts/modules/authz-stargate/Cargo.toml index 000a29e59..d962820e9 100644 --- a/integration-tests/contracts/modules/authz-stargate/Cargo.toml +++ b/integration-tests/contracts/modules/authz-stargate/Cargo.toml @@ -28,4 +28,4 @@ thiserror = "1.0.56" cosmwasm-std = { version = "2.1.4", features = ["stargate", "cosmwasm_2_0"] } cw2 = "2.0.0" cosmwasm-schema = "2.1.4" -coreum-wasm-sdk = {git = "https://github.com/CoreumFoundation/coreum-wasm-sdk.git", branch = "upgrade-cosmwasm-std"} +coreum-wasm-sdk = { git = "https://github.com/CoreumFoundation/coreum-wasm-sdk.git" } diff --git a/integration-tests/contracts/modules/authz-transfer/Cargo.lock b/integration-tests/contracts/modules/authz-transfer/Cargo.lock index b1ac532a7..c643d3ba5 100644 --- a/integration-tests/contracts/modules/authz-transfer/Cargo.lock +++ b/integration-tests/contracts/modules/authz-transfer/Cargo.lock @@ -231,17 +231,30 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "coreum-std-derive" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fee3df604ec822e6a66c0279f2d8840da010f8e07503423ba413baac03c830f" +dependencies = [ + "itertools 0.10.5", + "proc-macro2", + "prost", + "quote", + "syn 1.0.109", +] + [[package]] name = "coreum-wasm-sdk" version = "1.1.0" -source = "git+https://github.com/CoreumFoundation/coreum-wasm-sdk.git?branch=upgrade-cosmwasm-std#0c2f105969a2ce3711c6da2a9e6b9613d6c787d6" +source = "git+https://github.com/CoreumFoundation/coreum-wasm-sdk.git#352e54d12300d263ce135579d5d697d3e46c8431" dependencies = [ "chrono", + "coreum-std-derive", "cosmwasm-schema", "cosmwasm-std", - "osmosis-std-derive", - "prost 0.12.6", - "prost-types 0.12.6", + "prost", + "prost-types", "schemars", "serde", "serde-cw-value", @@ -729,18 +742,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "osmosis-std-derive" -version = "0.20.1" -source = "git+https://github.com/CoreumFoundation/osmosis-std-derive.git?branch=cosmwasm_2_0#7b837aa9fae698f8432003d44d80e19921b615ea" -dependencies = [ - "itertools 0.10.5", - "proc-macro2", - "prost-types 0.11.9", - "quote", - "syn 1.0.109", -] - [[package]] name = "p256" version = "0.13.2" @@ -786,16 +787,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "prost" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" -dependencies = [ - "bytes", - "prost-derive 0.11.9", -] - [[package]] name = "prost" version = "0.12.6" @@ -803,20 +794,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", - "prost-derive 0.12.6", -] - -[[package]] -name = "prost-derive" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" -dependencies = [ - "anyhow", - "itertools 0.10.5", - "proc-macro2", - "quote", - "syn 1.0.109", + "prost-derive", ] [[package]] @@ -832,22 +810,13 @@ dependencies = [ "syn 2.0.79", ] -[[package]] -name = "prost-types" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" -dependencies = [ - "prost 0.11.9", -] - [[package]] name = "prost-types" version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" dependencies = [ - "prost 0.12.6", + "prost", ] [[package]] diff --git a/integration-tests/contracts/modules/authz-transfer/Cargo.toml b/integration-tests/contracts/modules/authz-transfer/Cargo.toml index a70441dec..4b0275cb3 100644 --- a/integration-tests/contracts/modules/authz-transfer/Cargo.toml +++ b/integration-tests/contracts/modules/authz-transfer/Cargo.toml @@ -29,4 +29,4 @@ cosmwasm-std = { version = "2.1.4", features = ["cosmwasm_2_0"] } cw2 = "2.0.0" cw-storage-plus = "2.0.0" cosmwasm-schema = "2.1.4" -coreum-wasm-sdk = {git = "https://github.com/CoreumFoundation/coreum-wasm-sdk.git", branch = "upgrade-cosmwasm-std"} +coreum-wasm-sdk = { git = "https://github.com/CoreumFoundation/coreum-wasm-sdk.git" } diff --git a/integration-tests/contracts/modules/bank-send/Cargo.lock b/integration-tests/contracts/modules/bank-send/Cargo.lock index 0256652f1..fdfde3c1b 100644 --- a/integration-tests/contracts/modules/bank-send/Cargo.lock +++ b/integration-tests/contracts/modules/bank-send/Cargo.lock @@ -232,17 +232,30 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "520fbf3c07483f94e3e3ca9d0cfd913d7718ef2483d2cfd91c0d9e91474ab913" +[[package]] +name = "coreum-std-derive" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fee3df604ec822e6a66c0279f2d8840da010f8e07503423ba413baac03c830f" +dependencies = [ + "itertools", + "proc-macro2", + "prost", + "quote", + "syn 1.0.109", +] + [[package]] name = "coreum-wasm-sdk" version = "1.1.0" -source = "git+https://github.com/CoreumFoundation/coreum-wasm-sdk.git?branch=upgrade-cosmwasm-std#0c2f105969a2ce3711c6da2a9e6b9613d6c787d6" +source = "git+https://github.com/CoreumFoundation/coreum-wasm-sdk.git#352e54d12300d263ce135579d5d697d3e46c8431" dependencies = [ "chrono", + "coreum-std-derive", "cosmwasm-schema", "cosmwasm-std", - "osmosis-std-derive", - "prost 0.12.6", - "prost-types 0.12.6", + "prost", + "prost-types", "schemars", "serde", "serde-cw-value", @@ -766,18 +779,6 @@ dependencies = [ "portable-atomic", ] -[[package]] -name = "osmosis-std-derive" -version = "0.20.1" -source = "git+https://github.com/CoreumFoundation/osmosis-std-derive.git?branch=cosmwasm_2_0#7b837aa9fae698f8432003d44d80e19921b615ea" -dependencies = [ - "itertools", - "proc-macro2", - "prost-types 0.11.9", - "quote", - "syn 1.0.109", -] - [[package]] name = "p256" version = "0.13.2" @@ -829,16 +830,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "prost" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" -dependencies = [ - "bytes", - "prost-derive 0.11.9", -] - [[package]] name = "prost" version = "0.12.6" @@ -846,20 +837,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", - "prost-derive 0.12.6", -] - -[[package]] -name = "prost-derive" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" -dependencies = [ - "anyhow", - "itertools", - "proc-macro2", - "quote", - "syn 1.0.109", + "prost-derive", ] [[package]] @@ -875,22 +853,13 @@ dependencies = [ "syn 2.0.79", ] -[[package]] -name = "prost-types" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" -dependencies = [ - "prost 0.11.9", -] - [[package]] name = "prost-types" version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" dependencies = [ - "prost 0.12.6", + "prost", ] [[package]] diff --git a/integration-tests/contracts/modules/bank-send/Cargo.toml b/integration-tests/contracts/modules/bank-send/Cargo.toml index f444f50b1..3fba5bf03 100644 --- a/integration-tests/contracts/modules/bank-send/Cargo.toml +++ b/integration-tests/contracts/modules/bank-send/Cargo.toml @@ -28,7 +28,7 @@ library = [] [dependencies] cosmwasm-std = { version = "2.1.4", features = ["cosmwasm_2_0"] } -coreum-wasm-sdk = {git = "https://github.com/CoreumFoundation/coreum-wasm-sdk.git", branch = "upgrade-cosmwasm-std"} +coreum-wasm-sdk = { git = "https://github.com/CoreumFoundation/coreum-wasm-sdk.git" } cw-storage-plus = "2.0.0" cw2 = "2.0.0" thiserror = "1.0.59" diff --git a/integration-tests/contracts/modules/contract.go b/integration-tests/contracts/modules/contract.go index dac06498b..377a26383 100644 --- a/integration-tests/contracts/modules/contract.go +++ b/integration-tests/contracts/modules/contract.go @@ -26,4 +26,6 @@ var ( AuthzNftTradeWASM []byte //go:embed authz-stargate/artifacts/authz_stargate.wasm AuthzStargateWASM []byte + //go:embed dex/artifacts/dex.wasm + DEXWASM []byte ) diff --git a/integration-tests/contracts/modules/dex/Cargo.lock b/integration-tests/contracts/modules/dex/Cargo.lock new file mode 100644 index 000000000..a92096770 --- /dev/null +++ b/integration-tests/contracts/modules/dex/Cargo.lock @@ -0,0 +1,1202 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "anyhow" +version = "1.0.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" + +[[package]] +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools 0.10.5", + "num-traits", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rayon", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", + "rayon", +] + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bech32" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bnum" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +dependencies = [ + "num-traits", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "coreum-std-derive" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fee3df604ec822e6a66c0279f2d8840da010f8e07503423ba413baac03c830f" +dependencies = [ + "itertools 0.10.5", + "proc-macro2", + "prost", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "coreum-wasm-sdk" +version = "1.1.0" +source = "git+https://github.com/CoreumFoundation/coreum-wasm-sdk.git#352e54d12300d263ce135579d5d697d3e46c8431" +dependencies = [ + "chrono", + "coreum-std-derive", + "cosmwasm-schema", + "cosmwasm-std", + "prost", + "prost-types", + "schemars", + "serde", + "serde-cw-value", +] + +[[package]] +name = "cosmwasm-core" +version = "2.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6ceb8624260d0d3a67c4e1a1d43fc7e9406720afbcb124521501dd138f90aa" + +[[package]] +name = "cosmwasm-crypto" +version = "2.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4125381e5fd7fefe9f614640049648088015eca2b60d861465329a5d87dfa538" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "cosmwasm-core", + "digest", + "ecdsa", + "ed25519-zebra", + "k256", + "num-traits", + "p256", + "rand_core", + "rayon", + "sha2", + "thiserror", +] + +[[package]] +name = "cosmwasm-derive" +version = "2.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5658b1dc64e10b56ae7a449f678f96932a96f6cfad1769d608d1d1d656480a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "cosmwasm-schema" +version = "2.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f86b4d949b6041519c58993a73f4bbfba8083ba14f7001eae704865a09065845" +dependencies = [ + "cosmwasm-schema-derive", + "schemars", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cosmwasm-schema-derive" +version = "2.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8ef1b5835a65fcca3ab8b9a02b4f4dacc78e233a5c2f20b270efb9db0666d12" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "cosmwasm-std" +version = "2.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70eb7ab0c1e99dd6207496963ba2a457c4128ac9ad9c72a83f8d9808542b849b" +dependencies = [ + "base64", + "bech32", + "bnum", + "cosmwasm-core", + "cosmwasm-crypto", + "cosmwasm-derive", + "derive_more", + "hex", + "rand_core", + "schemars", + "serde", + "serde-json-wasm", + "sha2", + "static_assertions", + "thiserror", +] + +[[package]] +name = "cpufeatures" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "cw-address-like" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73553ee4dad5b1678977ff603e72c3fdd41518ca2b0bd9b245b21e4c72eafa9e" +dependencies = [ + "cosmwasm-std", +] + +[[package]] +name = "cw-ownable" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2f8ee96ac5342c795a0610410998fc075a95af8c796b6d16479cdffd2471f1" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "cw-address-like", + "cw-ownable-derive", + "cw-storage-plus", + "cw-utils", + "thiserror", +] + +[[package]] +name = "cw-ownable-derive" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e69178d27793063dd13812777709cf7d7860ba35a598094d4bd89e1b30c9341" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "cw-storage-plus" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f13360e9007f51998d42b1bc6b7fa0141f74feae61ed5fd1e5b0a89eec7b5de1" +dependencies = [ + "cosmwasm-std", + "schemars", + "serde", +] + +[[package]] +name = "cw-utils" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07dfee7f12f802431a856984a32bce1cb7da1e6c006b5409e3981035ce562dec" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "cw2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b04852cd38f044c0751259d5f78255d07590d136b8a86d4e09efdd7666bd6d27" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "cw-storage-plus", + "schemars", + "semver", + "serde", + "thiserror", +] + +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", + "unicode-xid", +] + +[[package]] +name = "dex" +version = "0.1.0" +dependencies = [ + "coreum-wasm-sdk", + "cosmwasm-schema", + "cosmwasm-std", + "cw-ownable", + "cw-storage-plus", + "cw2", + "thiserror", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "dyn-clone" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-zebra" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" +dependencies = [ + "curve25519-dalek", + "ed25519", + "hashbrown 0.14.5", + "hex", + "rand_core", + "sha2", + "zeroize", +] + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "k256" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2", +] + +[[package]] +name = "libc" +version = "0.2.160" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0b21006cd1874ae9e650973c565615676dc4a274c965bb0a73796dac838ce4f" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro2" +version = "1.0.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-derive" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" +dependencies = [ + "anyhow", + "itertools 0.12.1", + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "prost-types" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" +dependencies = [ + "prost", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "schemars" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.79", +] + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-cw-value" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75d32da6b8ed758b7d850b6c3c08f1d7df51a4df3cb201296e63e34a78e99d4" +dependencies = [ + "serde", +] + +[[package]] +name = "serde-json-wasm" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f05da0d153dd4595bdffd5099dc0e9ce425b205ee648eb93437ff7302af8c9a5" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "serde_json" +version = "1.0.128" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] diff --git a/integration-tests/contracts/modules/dex/Cargo.toml b/integration-tests/contracts/modules/dex/Cargo.toml new file mode 100644 index 000000000..678a09b30 --- /dev/null +++ b/integration-tests/contracts/modules/dex/Cargo.toml @@ -0,0 +1,36 @@ +[package] +name = "dex" +version = "0.1.0" +authors = ["Coreum"] +edition = "2021" + +exclude = [ + "dex.wasm", + "checksums.txt", +] + +[lib] +crate-type = ["cdylib", "rlib"] + +[profile.release] +opt-level = 3 +debug = false +rpath = false +lto = true +debug-assertions = false +codegen-units = 1 +panic = 'abort' +incremental = false +overflow-checks = true + +[features] +library = [] + +[dependencies] +cosmwasm-std = { version = "2.1.4", features = ["cosmwasm_2_0"] } +cw-storage-plus = "2.0.0" +cw2 = "2.0.0" +thiserror = "1.0.59" +coreum-wasm-sdk = { git = "https://github.com/CoreumFoundation/coreum-wasm-sdk.git" } +cosmwasm-schema = "2.1.4" +cw-ownable = "2.1.0" diff --git a/integration-tests/contracts/modules/dex/src/contract.rs b/integration-tests/contracts/modules/dex/src/contract.rs new file mode 100644 index 000000000..7cab7ed65 --- /dev/null +++ b/integration-tests/contracts/modules/dex/src/contract.rs @@ -0,0 +1,313 @@ +use coreum_wasm_sdk::types::coreum::asset::ft::v1::MsgIssue; +use coreum_wasm_sdk::types::coreum::dex::v1::{ + MsgCancelOrder, MsgCancelOrdersByDenom, MsgPlaceOrder, Order, 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}; +use cw2::set_contract_version; +use cw_ownable::initialize_owner; + +use crate::error::ContractError; +use crate::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; + +// version info for migration info +const CONTRACT_NAME: &str = env!("CARGO_PKG_NAME"); +const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); + +// ********** Instantiate ********** + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn instantiate( + deps: DepsMut, + env: Env, + info: MessageInfo, + msg: InstantiateMsg, +) -> Result { + set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?; + initialize_owner(deps.storage, deps.api, Some(info.sender.as_ref()))?; + + let issue = MsgIssue { + issuer: env.contract.address.to_string(), + symbol: msg.symbol.clone(), + subunit: msg.subunit.clone(), + precision: msg.precision, + initial_amount: msg.initial_amount.to_string(), + description: msg.description.unwrap_or_default(), + features: msg.features.unwrap_or_default(), + burn_rate: msg.burn_rate, + send_commission_rate: msg.send_commission_rate, + uri: msg.uri.unwrap_or_default(), + uri_hash: msg.uri_hash.unwrap_or_default(), + extension_settings: msg.extension_settings, + dex_settings: msg.dex_settings, + }; + + let denom = format!("{}-{}", msg.subunit, env.contract.address).to_lowercase(); + + Ok(Response::new() + .add_attribute("owner", info.sender) + .add_attribute("denom", denom) + .add_message(CosmosMsg::Any(issue.to_any()))) +} + +// ********** Execute ********** + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn execute( + _deps: DepsMut, + env: Env, + _info: MessageInfo, + msg: ExecuteMsg, +) -> Result { + match msg { + ExecuteMsg::PlaceOrder { order } => place_order(env, order), + ExecuteMsg::CancelOrder { order_id } => cancel_order(env, order_id), + ExecuteMsg::CancelOrdersByDenom { account, denom } => { + cancel_orders_by_denom(env, account, denom) + } + } +} + +// ********** Transactions ********** + +fn place_order(env: Env, order: Order) -> Result { + let place_order = MsgPlaceOrder { + sender: env.contract.address.to_string(), + r#type: order.r#type, + id: order.id.clone(), + base_denom: order.base_denom.clone(), + quote_denom: order.quote_denom.clone(), + price: order.price.clone(), + quantity: order.quantity.clone(), + side: order.side, + good_til: order.good_til.clone(), + time_in_force: order.time_in_force, + }; + + let mut res = Response::new() + .add_attribute("method", "place_order") + .add_attribute("sender", env.contract.address.to_string()) + .add_attribute( + "type", + OrderType::try_from(order.r#type) + .or(Err(ContractError::Std(StdError::generic_err( + "wrong order type", + ))))? + .as_str_name(), + ) + .add_attribute("id", order.id) + .add_attribute("base_denom", order.base_denom) + .add_attribute("quote_denom", order.quote_denom) + .add_attribute("price", order.price) + .add_attribute("quantity", order.quantity) + .add_attribute( + "side", + Side::try_from(order.side) + .or(Err(ContractError::Std(StdError::generic_err( + "wrong order side", + ))))? + .as_str_name(), + ) + .add_attribute( + "time_in_force", + TimeInForce::try_from(order.time_in_force) + .or(Err(ContractError::Std(StdError::generic_err( + "wrong order side", + ))))? + .as_str_name(), + ); + if let Some(good_til) = order.good_til { + res = res.add_attribute( + "good_til_block_height", + good_til.good_til_block_height.to_string(), + ); + if let Some(good_til_block_time) = good_til.good_til_block_time { + res = res.add_attribute( + "good_til_block_time_seconds", + good_til_block_time.seconds.to_string(), + ); + } + } + res = res.add_message(CosmosMsg::Any(place_order.to_any())); + Ok(res) +} + +fn cancel_order(env: Env, order_id: String) -> Result { + let cancel_order = MsgCancelOrder { + sender: env.contract.address.to_string(), + id: order_id.clone(), + }; + + Ok(Response::new() + .add_attribute("method", "cancel_order") + .add_attribute("sender", env.contract.address.to_string()) + .add_attribute("order_id", order_id) + .add_message(CosmosMsg::Any(cancel_order.to_any()))) +} + +fn cancel_orders_by_denom( + env: Env, + account: String, + denom: String, +) -> Result { + let cancel_orders_by_denom = MsgCancelOrdersByDenom { + sender: env.contract.address.to_string(), + denom: denom.clone(), + account: account.clone(), + }; + + Ok(Response::new() + .add_attribute("method", "cancel_orders_by_denom") + .add_attribute("sender", env.contract.address.to_string()) + .add_attribute("account", account) + .add_attribute("denom", denom) + .add_message(CosmosMsg::Any(cancel_orders_by_denom.to_any()))) +} + +// ********** Queries ********** +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { + match msg { + QueryMsg::Params {} => to_json_binary(&query_params(deps)?), + QueryMsg::Order { acc, order_id } => to_json_binary(&query_order(deps, acc, order_id)?), + QueryMsg::Orders { creator } => to_json_binary(&query_orders(deps, creator)?), + QueryMsg::OrderBooks {} => to_json_binary(&query_order_books(deps)?), + QueryMsg::OrderBookOrders { + base_denom, + quote_denom, + side, + } => to_json_binary(&query_order_book_orders( + deps, + base_denom, + quote_denom, + side, + )?), + QueryMsg::AccountDenomOrdersCount { account, denom } => { + to_json_binary(&query_account_denom_orders_count(deps, account, denom)?) + } + } +} + +fn query_params(deps: Deps) -> StdResult { + let request = QueryParamsRequest {}; + request.query(&deps.querier) +} + +fn query_order(deps: Deps, acc: String, order_id: String) -> StdResult { + let request = QueryOrderRequest { + creator: acc, + id: order_id, + }; + request.query(&deps.querier) +} + +fn query_orders(deps: Deps, creator: String) -> StdResult { + let mut pagination = None; + let mut orders = vec![]; + let mut res: QueryOrdersResponse; + loop { + let request = QueryOrdersRequest { + pagination, + creator: creator.clone(), + }; + res = request.query(&deps.querier)?; + orders.append(&mut res.orders); + let next_key = res.pagination.clone().and_then(|p| p.next_key); + if next_key.is_none() { + break; + } else { + pagination = Some(PageRequest { + key: next_key.unwrap(), + offset: 0, + limit: 0, + count_total: false, + reverse: false, + }) + } + } + let res = QueryOrdersResponse { + pagination: res.pagination, + orders, + }; + Ok(res) +} + +fn query_order_books(deps: Deps) -> StdResult { + let mut pagination = None; + let mut order_books = vec![]; + let mut res: QueryOrderBooksResponse; + loop { + let request = QueryOrderBooksRequest { pagination }; + res = request.query(&deps.querier)?; + order_books.append(&mut res.order_books); + let next_key = res.pagination.clone().and_then(|p| p.next_key); + if next_key.is_none() { + break; + } else { + pagination = Some(PageRequest { + key: next_key.unwrap(), + offset: 0, + limit: 0, + count_total: false, + reverse: false, + }) + } + } + let res = QueryOrderBooksResponse { + pagination: res.pagination, + order_books, + }; + Ok(res) +} + +fn query_order_book_orders( + deps: Deps, + base_denom: String, + quote_denom: String, + side: i32, +) -> StdResult { + let mut pagination = None; + let mut orders = vec![]; + let mut res: QueryOrderBookOrdersResponse; + loop { + let request = QueryOrderBookOrdersRequest { + pagination, + base_denom: base_denom.clone(), + quote_denom: quote_denom.clone(), + side, + }; + res = request.query(&deps.querier)?; + orders.append(&mut res.orders); + let next_key = res.pagination.clone().and_then(|p| p.next_key); + if next_key.is_none() { + break; + } else { + pagination = Some(PageRequest { + key: next_key.unwrap(), + offset: 0, + limit: 0, + count_total: false, + reverse: false, + }) + } + } + let res = QueryOrderBookOrdersResponse { + pagination: res.pagination, + orders, + }; + Ok(res) +} + +fn query_account_denom_orders_count( + deps: Deps, + account: String, + denom: String, +) -> StdResult { + let request = QueryAccountDenomOrdersCountRequest { account, denom }; + request.query(&deps.querier) +} diff --git a/integration-tests/contracts/modules/dex/src/error.rs b/integration-tests/contracts/modules/dex/src/error.rs new file mode 100644 index 000000000..40dab9ff3 --- /dev/null +++ b/integration-tests/contracts/modules/dex/src/error.rs @@ -0,0 +1,8 @@ +use cosmwasm_std::StdError; +use thiserror::Error; + +#[derive(Error, Debug)] +pub enum ContractError { + #[error("{0}")] + Std(#[from] StdError), +} diff --git a/integration-tests/contracts/modules/dex/src/lib.rs b/integration-tests/contracts/modules/dex/src/lib.rs new file mode 100644 index 000000000..91c7e60f8 --- /dev/null +++ b/integration-tests/contracts/modules/dex/src/lib.rs @@ -0,0 +1,3 @@ +pub mod contract; +pub mod error; +pub mod msg; diff --git a/integration-tests/contracts/modules/dex/src/msg.rs b/integration-tests/contracts/modules/dex/src/msg.rs new file mode 100644 index 000000000..06eabe944 --- /dev/null +++ b/integration-tests/contracts/modules/dex/src/msg.rs @@ -0,0 +1,49 @@ +use coreum_wasm_sdk::types::coreum::asset::ft::v1::{DexSettings, ExtensionIssueSettings}; +use coreum_wasm_sdk::types::coreum::dex::v1::Order; +use cosmwasm_schema::cw_serde; +use cosmwasm_std::Uint128; + +#[cw_serde] +pub struct InstantiateMsg { + pub symbol: String, + pub subunit: String, + pub precision: u32, + pub initial_amount: Uint128, + pub description: Option, + pub features: Option>, + pub burn_rate: String, + pub send_commission_rate: String, + pub uri: Option, + pub uri_hash: Option, + pub extension_settings: Option, + pub dex_settings: Option, +} + +#[cw_serde] +pub enum ExecuteMsg { + PlaceOrder { order: Order }, + CancelOrder { order_id: String }, + CancelOrdersByDenom { account: String, denom: String }, +} + +#[cw_serde] +pub enum QueryMsg { + Params {}, + Order { + acc: String, + order_id: String, + }, + Orders { + creator: String, + }, + OrderBooks {}, + OrderBookOrders { + base_denom: String, + quote_denom: String, + side: i32, + }, + AccountDenomOrdersCount { + account: String, + denom: String, + }, +} diff --git a/integration-tests/contracts/modules/ft/Cargo.lock b/integration-tests/contracts/modules/ft/Cargo.lock index 66c4a2468..9c8da0dde 100644 --- a/integration-tests/contracts/modules/ft/Cargo.lock +++ b/integration-tests/contracts/modules/ft/Cargo.lock @@ -22,9 +22,9 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "anyhow" -version = "1.0.89" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" [[package]] name = "ark-bls12-381" @@ -194,9 +194,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "cfg-if" @@ -219,17 +219,30 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "coreum-std-derive" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fee3df604ec822e6a66c0279f2d8840da010f8e07503423ba413baac03c830f" +dependencies = [ + "itertools 0.10.5", + "proc-macro2", + "prost", + "quote", + "syn 1.0.109", +] + [[package]] name = "coreum-wasm-sdk" version = "1.1.0" -source = "git+https://github.com/CoreumFoundation/coreum-wasm-sdk.git?branch=upgrade-cosmwasm-std#0c2f105969a2ce3711c6da2a9e6b9613d6c787d6" +source = "git+https://github.com/CoreumFoundation/coreum-wasm-sdk.git#352e54d12300d263ce135579d5d697d3e46c8431" dependencies = [ "chrono", + "coreum-std-derive", "cosmwasm-schema", "cosmwasm-std", - "osmosis-std-derive", - "prost 0.12.6", - "prost-types 0.12.6", + "prost", + "prost-types", "schemars", "serde", "serde-cw-value", @@ -272,7 +285,7 @@ checksum = "1b5658b1dc64e10b56ae7a449f678f96932a96f6cfad1769d608d1d1d656480a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -296,7 +309,7 @@ checksum = "c8ef1b5835a65fcca3ab8b9a02b4f4dacc78e233a5c2f20b270efb9db0666d12" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -402,7 +415,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -517,7 +530,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "unicode-xid", ] @@ -734,9 +747,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.159" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "memchr" @@ -778,18 +791,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "osmosis-std-derive" -version = "0.20.1" -source = "git+https://github.com/CoreumFoundation/osmosis-std-derive.git?branch=cosmwasm_2_0#7b837aa9fae698f8432003d44d80e19921b615ea" -dependencies = [ - "itertools 0.10.5", - "proc-macro2", - "prost-types 0.11.9", - "quote", - "syn 1.0.109", -] - [[package]] name = "p256" version = "0.13.2" @@ -828,23 +829,13 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] -[[package]] -name = "prost" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" -dependencies = [ - "bytes", - "prost-derive 0.11.9", -] - [[package]] name = "prost" version = "0.12.6" @@ -852,20 +843,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", - "prost-derive 0.12.6", -] - -[[package]] -name = "prost-derive" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" -dependencies = [ - "anyhow", - "itertools 0.10.5", - "proc-macro2", - "quote", - "syn 1.0.109", + "prost-derive", ] [[package]] @@ -878,16 +856,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.79", -] - -[[package]] -name = "prost-types" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" -dependencies = [ - "prost 0.11.9", + "syn 2.0.85", ] [[package]] @@ -896,7 +865,7 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" dependencies = [ - "prost 0.12.6", + "prost", ] [[package]] @@ -1003,7 +972,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1027,9 +996,9 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "3ea7893ff5e2466df8d720bb615088341b295f849602c6956047f8f80f0e9bc1" dependencies = [ "serde_derive", ] @@ -1054,13 +1023,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1071,14 +1040,14 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa", "memchr", @@ -1132,9 +1101,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" dependencies = [ "proc-macro2", "quote", @@ -1143,22 +1112,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1209,7 +1178,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1229,5 +1198,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] diff --git a/integration-tests/contracts/modules/ft/Cargo.toml b/integration-tests/contracts/modules/ft/Cargo.toml index cee9e74b1..2fcf2f95c 100644 --- a/integration-tests/contracts/modules/ft/Cargo.toml +++ b/integration-tests/contracts/modules/ft/Cargo.toml @@ -31,6 +31,6 @@ cosmwasm-std = { version = "2.1.4", features = ["cosmwasm_2_0"] } cw-storage-plus = "2.0.0" cw2 = "2.0.0" thiserror = "1.0.59" -coreum-wasm-sdk = {git = "https://github.com/CoreumFoundation/coreum-wasm-sdk.git", branch = "upgrade-cosmwasm-std"} +coreum-wasm-sdk = { git = "https://github.com/CoreumFoundation/coreum-wasm-sdk.git" } cosmwasm-schema = "2.1.4" cw-ownable = "2.1.0" diff --git a/integration-tests/contracts/modules/ft/src/contract.rs b/integration-tests/contracts/modules/ft/src/contract.rs index 7a3967b91..65ebba2da 100644 --- a/integration-tests/contracts/modules/ft/src/contract.rs +++ b/integration-tests/contracts/modules/ft/src/contract.rs @@ -1,15 +1,17 @@ use coreum_wasm_sdk::types::coreum::asset::ft::v1::{ - MsgBurn, MsgClawback, MsgClearAdmin, MsgFreeze, MsgGloballyFreeze, MsgGloballyUnfreeze, - MsgIssue, MsgMint, MsgSetFrozen, MsgSetWhitelistedLimit, MsgTransferAdmin, MsgUnfreeze, - MsgUpgradeTokenV1, QueryBalanceRequest, QueryBalanceResponse, QueryFrozenBalanceRequest, - QueryFrozenBalanceResponse, QueryFrozenBalancesRequest, QueryFrozenBalancesResponse, - QueryParamsRequest, QueryParamsResponse, QueryTokenRequest, QueryTokenResponse, - QueryTokensRequest, QueryTokensResponse, QueryWhitelistedBalanceRequest, + ExtensionIssueSettings, MsgBurn, MsgClawback, MsgClearAdmin, MsgFreeze, MsgGloballyFreeze, + MsgGloballyUnfreeze, MsgIssue, MsgMint, MsgSetFrozen, MsgSetWhitelistedLimit, MsgTransferAdmin, + MsgUnfreeze, MsgUpgradeTokenV1, QueryBalanceRequest, QueryBalanceResponse, + QueryFrozenBalanceRequest, QueryFrozenBalanceResponse, QueryFrozenBalancesRequest, + QueryFrozenBalancesResponse, QueryParamsRequest, QueryParamsResponse, QueryTokenRequest, + QueryTokenResponse, QueryTokensRequest, QueryTokensResponse, QueryWhitelistedBalanceRequest, QueryWhitelistedBalanceResponse, QueryWhitelistedBalancesRequest, QueryWhitelistedBalancesResponse, }; use coreum_wasm_sdk::types::cosmos::base::{query::v1beta1::PageRequest, v1beta1::Coin}; -use cosmwasm_std::{entry_point, to_json_binary, Binary, CosmosMsg, Deps, StdResult, Uint128}; +use cosmwasm_std::{ + entry_point, to_json_binary, to_json_vec, Binary, CosmosMsg, Deps, StdResult, Uint128, +}; use cosmwasm_std::{DepsMut, Env, MessageInfo, Response}; use cw2::set_contract_version; use cw_ownable::{assert_owner, initialize_owner}; @@ -46,7 +48,20 @@ pub fn instantiate( send_commission_rate: msg.send_commission_rate, uri: msg.uri.unwrap_or_default(), uri_hash: msg.uri_hash.unwrap_or_default(), - extension_settings: msg.extension_settings, + extension_settings: msg.extension_settings.map(|s| ExtensionIssueSettings { + code_id: s.code_id, + label: s.label, + funds: s + .funds + .iter() + .map(|f| Coin { + denom: f.denom.to_string(), + amount: f.amount.to_string(), + }) + .collect(), + issuance_msg: to_json_vec(&s.issuance_msg).unwrap(), + }), + dex_settings: msg.dex_settings, }; let denom = format!("{}-{}", msg.subunit, env.contract.address).to_lowercase(); diff --git a/integration-tests/contracts/modules/ft/src/msg.rs b/integration-tests/contracts/modules/ft/src/msg.rs index 7cb96fe64..f20a84adb 100644 --- a/integration-tests/contracts/modules/ft/src/msg.rs +++ b/integration-tests/contracts/modules/ft/src/msg.rs @@ -1,6 +1,6 @@ -use coreum_wasm_sdk::types::coreum::asset::ft::v1::ExtensionIssueSettings; +use coreum_wasm_sdk::types::coreum::asset::ft::v1::DexSettings; use cosmwasm_schema::cw_serde; -use cosmwasm_std::Uint128; +use cosmwasm_std::{Coin, Uint128}; #[cw_serde] pub struct InstantiateMsg { @@ -15,6 +15,20 @@ pub struct InstantiateMsg { pub uri: Option, pub uri_hash: Option, pub extension_settings: Option, + pub dex_settings: Option, +} + +#[cw_serde] +pub struct ExtensionIssueSettings { + pub code_id: u64, + pub label: String, + pub funds: Vec, + pub issuance_msg: IssuanceMsg, +} + +#[cw_serde] +pub struct IssuanceMsg { + pub extra_data: String, } #[cw_serde] diff --git a/integration-tests/contracts/modules/nft/Cargo.lock b/integration-tests/contracts/modules/nft/Cargo.lock index 77cf749f3..36cca124b 100644 --- a/integration-tests/contracts/modules/nft/Cargo.lock +++ b/integration-tests/contracts/modules/nft/Cargo.lock @@ -219,17 +219,30 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "coreum-std-derive" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fee3df604ec822e6a66c0279f2d8840da010f8e07503423ba413baac03c830f" +dependencies = [ + "itertools 0.10.5", + "proc-macro2", + "prost", + "quote", + "syn 1.0.109", +] + [[package]] name = "coreum-wasm-sdk" version = "1.1.0" -source = "git+https://github.com/CoreumFoundation/coreum-wasm-sdk.git?branch=upgrade-cosmwasm-std#0c2f105969a2ce3711c6da2a9e6b9613d6c787d6" +source = "git+https://github.com/CoreumFoundation/coreum-wasm-sdk.git#352e54d12300d263ce135579d5d697d3e46c8431" dependencies = [ "chrono", + "coreum-std-derive", "cosmwasm-schema", "cosmwasm-std", - "osmosis-std-derive", - "prost 0.12.6", - "prost-types 0.12.6", + "prost", + "prost-types", "schemars", "serde", "serde-cw-value", @@ -779,18 +792,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "osmosis-std-derive" -version = "0.20.1" -source = "git+https://github.com/CoreumFoundation/osmosis-std-derive.git?branch=cosmwasm_2_0#7b837aa9fae698f8432003d44d80e19921b615ea" -dependencies = [ - "itertools 0.10.5", - "proc-macro2", - "prost-types 0.11.9", - "quote", - "syn 1.0.109", -] - [[package]] name = "p256" version = "0.13.2" @@ -836,16 +837,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "prost" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" -dependencies = [ - "bytes", - "prost-derive 0.11.9", -] - [[package]] name = "prost" version = "0.12.6" @@ -853,20 +844,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", - "prost-derive 0.12.6", -] - -[[package]] -name = "prost-derive" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" -dependencies = [ - "anyhow", - "itertools 0.10.5", - "proc-macro2", - "quote", - "syn 1.0.109", + "prost-derive", ] [[package]] @@ -882,22 +860,13 @@ dependencies = [ "syn 2.0.79", ] -[[package]] -name = "prost-types" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" -dependencies = [ - "prost 0.11.9", -] - [[package]] name = "prost-types" version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" dependencies = [ - "prost 0.12.6", + "prost", ] [[package]] diff --git a/integration-tests/contracts/modules/nft/Cargo.toml b/integration-tests/contracts/modules/nft/Cargo.toml index f8bd3ce35..75192cd37 100644 --- a/integration-tests/contracts/modules/nft/Cargo.toml +++ b/integration-tests/contracts/modules/nft/Cargo.toml @@ -32,6 +32,6 @@ cw-storage-plus = "2.0.0" cw2 = "2.0.0" thiserror = "1.0.59" schemars = "0.8.16" -coreum-wasm-sdk = {git = "https://github.com/CoreumFoundation/coreum-wasm-sdk.git", branch = "upgrade-cosmwasm-std"} +coreum-wasm-sdk = { git = "https://github.com/CoreumFoundation/coreum-wasm-sdk.git" } cosmwasm-schema = "2.1.4" cw-ownable = "2.1.0" diff --git a/integration-tests/contracts/modules/nft/src/contract.rs b/integration-tests/contracts/modules/nft/src/contract.rs index d32f7e54e..721fe7d17 100644 --- a/integration-tests/contracts/modules/nft/src/contract.rs +++ b/integration-tests/contracts/modules/nft/src/contract.rs @@ -11,7 +11,7 @@ use coreum_wasm_sdk::types::coreum::asset::nft::v1::{ QueryWhitelistedAccountsForNftRequest, QueryWhitelistedAccountsForNftResponse, QueryWhitelistedRequest, QueryWhitelistedResponse, }; -use coreum_wasm_sdk::types::coreum::nft::v1beta1::{ +use coreum_wasm_sdk::types::cosmos::nft::v1beta1::{ self, QueryBalanceRequest, QueryBalanceResponse, QueryNfTsRequest, QueryNfTsResponse, QueryNftRequest, QueryNftResponse, QueryOwnerRequest, QueryOwnerResponse, QuerySupplyRequest, QuerySupplyResponse, diff --git a/integration-tests/modules/assetft_extension_test.go b/integration-tests/modules/assetft_extension_test.go index 20a033a34..948e5b3c7 100644 --- a/integration-tests/modules/assetft_extension_test.go +++ b/integration-tests/modules/assetft_extension_test.go @@ -248,8 +248,8 @@ func TestAssetFTExtensionWhitelist(t *testing.T) { chain.TxFactoryAuto(), msg, ) - requireT.NotEqualValues(chain.GasLimitByMsgs(msg), res.GasUsed) requireT.NoError(err) + requireT.NotEqualValues(chain.GasLimitByMsgs(msg), res.GasUsed) // Issue the new fungible token without extension subunit = "uabe" @@ -1207,6 +1207,16 @@ func TestAssetFTExtensionIssuingSmartContractIsAllowedToSendAndReceive(t *testin codeID, err := chain.Wasm.DeployWASMContract(ctx, txf, admin, testcontracts.AssetExtensionWasm) requireT.NoError(err) + //nolint:tagliatelle // these will be exposed to rust and must be snake case. + issuanceMsg := struct { + ExtraData string `json:"extra_data"` + }{ + ExtraData: "test", + } + + issuanceMsgBytes, err := json.Marshal(issuanceMsg) + requireT.NoError(err) + issuanceAmount := sdkmath.NewInt(10_000) issuanceReq := issueFTRequest{ Symbol: "symbol", @@ -1219,8 +1229,9 @@ func TestAssetFTExtensionIssuingSmartContractIsAllowedToSendAndReceive(t *testin assetfttypes.Feature_extension, }, ExtensionSettings: &assetfttypes.ExtensionIssueSettings{ - CodeId: codeID, - Label: "block-smart-contract", + CodeId: codeID, + Label: "smart-contract", + IssuanceMsg: wasmtypes.RawContractMessage(issuanceMsgBytes), }, BurnRate: "0", SendCommissionRate: "0", diff --git a/integration-tests/modules/dex_test.go b/integration-tests/modules/dex_test.go index c4165203b..83977e8d2 100644 --- a/integration-tests/modules/dex_test.go +++ b/integration-tests/modules/dex_test.go @@ -694,7 +694,7 @@ func TestOrderBooksAndOrdersQueries(t *testing.T) { }) // check order book orders query - orderBookOrdersRes, err := dexClient.OrdersBookOrders(ctx, &dextypes.QueryOrderBookOrdersRequest{ + orderBookOrdersRes, err := dexClient.OrderBookOrders(ctx, &dextypes.QueryOrderBookOrdersRequest{ BaseDenom: denom1, QuoteDenom: denom2, Side: dextypes.SIDE_SELL, diff --git a/integration-tests/modules/wasm_test.go b/integration-tests/modules/wasm_test.go index 8d333275f..cff47670c 100644 --- a/integration-tests/modules/wasm_test.go +++ b/integration-tests/modules/wasm_test.go @@ -13,6 +13,7 @@ import ( sdkmath "cosmossdk.io/math" nfttypes "cosmossdk.io/x/nft" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" cosmoserrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -34,6 +35,7 @@ import ( assetfttypes "github.com/CoreumFoundation/coreum/v5/x/asset/ft/types" assetnfttypes "github.com/CoreumFoundation/coreum/v5/x/asset/nft/types" deterministicgastypes "github.com/CoreumFoundation/coreum/v5/x/deterministicgas/types" + dextypes "github.com/CoreumFoundation/coreum/v5/x/dex/types" ) // authz models @@ -77,6 +79,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"` } // fungible token wasm models @@ -117,6 +120,42 @@ type accountBodyFTRequest struct { Account string `json:"account"` } +type placeOrderBodyDEXRequest struct { + Order dextypes.Order `json:"order"` +} + +//nolint:tagliatelle +type cancelOrderBodyDEXRequest struct { + OrderID string `json:"order_id"` +} + +type cancelOrdersByDenomBodyDEXRequest struct { + Account string `json:"account"` + Denom string `json:"denom"` +} + +//nolint:tagliatelle +type OrderBodyDEXRequest struct { + Account string `json:"acc"` + OrderID string `json:"order_id"` +} + +type OrdersBodyDEXRequest struct { + Creator string `json:"creator"` +} + +//nolint:tagliatelle +type OrderBookOrdersBodyDEXRequest struct { + BaseDenom string `json:"base_denom"` + QuoteDenom string `json:"quote_denom"` + Side dextypes.Side `json:"side"` +} + +type AccountDenomOrdersCountBodyDEXRequest struct { + Account string `json:"account"` + Denom string `json:"denom"` +} + type ftMethod string const ( @@ -143,6 +182,22 @@ const ( ftMethodWhitelistedBalances ftMethod = "whitelisted_balances" ) +type dexMethod string + +const ( + // tx. + dexMethodPlaceOrder dexMethod = "place_order" + dexMethodCancelOrder dexMethod = "cancel_order" + dexMethodCancelOrdersByDenom dexMethod = "cancel_orders_by_denom" + // query. + dexMethodParams dexMethod = "params" + dexMethodOrder dexMethod = "order" + dexMethodOrders dexMethod = "orders" + dexMethodOrderBooks dexMethod = "order_books" + dexMethodOrderBookOrders dexMethod = "order_book_orders" + dexMethodAccountDenomOrdersCount dexMethod = "account_denom_orders_count" +) + // TestContractInstantiation tests contract instantiation using two instantiation methods. func TestContractInstantiation(t *testing.T) { t.Parallel() @@ -1930,11 +1985,11 @@ func TestWASMNonFungibleTokenInContract(t *testing.T) { dataBytes, err := codectypes.NewAnyWithValue(&assetnfttypes.DataBytes{Data: data}) // we need to do this, otherwise assertion fails because some private fields are set differently + requireT.NoError(err) dataToCompare := &codectypes.Any{ TypeUrl: dataBytes.TypeUrl, Value: dataBytes.Value, } - requireT.NoError(err) classID := assetnfttypes.BuildClassID( issueClassReqNoWhitelist.Symbol, @@ -2046,11 +2101,11 @@ func TestWASMNonFungibleTokenInContract(t *testing.T) { Data: []byte("mutable_data"), }}}) + requireT.NoError(err) dataToCompare = &codectypes.Any{ TypeUrl: dataBytes.TypeUrl, Value: dataBytes.Value, } - requireT.NoError(err) requireT.Equal(dataToCompare, nftResp.Nft.Data) @@ -2079,11 +2134,11 @@ func TestWASMNonFungibleTokenInContract(t *testing.T) { Data: []byte("edited_data_by_admin"), }}}) + requireT.NoError(err) dataToCompare = &codectypes.Any{ TypeUrl: dataBytes.TypeUrl, Value: dataBytes.Value, } - requireT.NoError(err) nftResp, err = nftClient.NFT(ctx, &nfttypes.QueryNFTRequest{ ClassId: classIDNoWhitelist, @@ -2128,11 +2183,11 @@ func TestWASMNonFungibleTokenInContract(t *testing.T) { Data: []byte("edited_data_by_owner"), }}}) + requireT.NoError(err) dataToCompare = &codectypes.Any{ TypeUrl: dataBytes.TypeUrl, Value: dataBytes.Value, } - requireT.NoError(err) nftResp, err = nftClient.NFT(ctx, &nfttypes.QueryNFTRequest{ ClassId: classIDNoWhitelist, @@ -2278,11 +2333,11 @@ func TestWASMNonFungibleTokenInContract(t *testing.T) { requireT.NoError(err) dataBytes, err = codectypes.NewAnyWithValue(&assetnfttypes.DataBytes{Data: data}) + requireT.NoError(err) dataToCompare = &codectypes.Any{ TypeUrl: dataBytes.TypeUrl, Value: dataBytes.Value, } - requireT.NoError(err) expectedNFT1 := &nfttypes.NFT{ ClassId: classID, @@ -2518,11 +2573,11 @@ func TestWASMNonFungibleTokenInContractLegacy(t *testing.T) { dataBytes, err := codectypes.NewAnyWithValue(&assetnfttypes.DataBytes{Data: data}) // we need to do this, otherwise assertion fails because some private fields are set differently + requireT.NoError(err) dataToCompare := &codectypes.Any{ TypeUrl: dataBytes.TypeUrl, Value: dataBytes.Value, } - requireT.NoError(err) expectedClass := assetnfttypes.Class{ Id: classID, @@ -3550,6 +3605,335 @@ func TestVestingToWASMContract(t *testing.T) { requireT.NoError(err) } +// TestWASMDEXInContract verifies that smart contract is able to execute all Coreum DEX messages and queries. +func TestWASMDEXInContract(t *testing.T) { + t.Parallel() + + ctx, chain := integrationtests.NewCoreumTestingContext(t) + + admin := chain.GenAccount() + issuer := chain.GenAccount() + + requireT := require.New(t) + chain.FundAccountWithOptions(ctx, t, admin, integration.BalancesOptions{ + Messages: []sdk.Msg{ + &banktypes.MsgSend{}, + }, + Amount: sdkmath.NewInt(5_000_000_000), + }) + + clientCtx := chain.ClientContext + txf := chain.TxFactoryAuto() + bankClient := banktypes.NewQueryClient(clientCtx) + assetftClient := assetfttypes.NewQueryClient(clientCtx) + tmQueryClient := cmtservice.NewServiceClient(chain.ClientContext) + + chain.FundAccountWithOptions(ctx, t, issuer, integration.BalancesOptions{ + Messages: []sdk.Msg{ + &assetfttypes.MsgIssue{}, + &banktypes.MsgSend{}, + }, + Amount: chain.QueryAssetFTParams(ctx, t).IssueFee.Amount, + }) + + // Issue a normal fungible token + issueMsg := &assetfttypes.MsgIssue{ + Issuer: issuer.String(), + Symbol: "ABC1", + Subunit: "abc1", + Precision: 6, + InitialAmount: sdkmath.NewInt(10_000_000), + Description: "ABC1 Description", + Features: []assetfttypes.Feature{ + assetfttypes.Feature_dex_whitelisted_denoms, + assetfttypes.Feature_dex_order_cancellation, + assetfttypes.Feature_dex_unified_ref_amount_change, + }, + BurnRate: sdkmath.LegacyNewDec(0), + SendCommissionRate: sdkmath.LegacyNewDec(0), + } + + _, err := client.BroadcastTx( + ctx, + chain.ClientContext.WithFromAddress(issuer), + chain.TxFactory().WithGas(chain.GasLimitByMsgs(issueMsg)), + issueMsg, + ) + + 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", + Subunit: "abc2", + Precision: 6, + InitialAmount: issuanceAmount.String(), + Description: "ABC2 Description", + Features: []assetfttypes.Feature{ + assetfttypes.Feature_dex_whitelisted_denoms, + assetfttypes.Feature_dex_order_cancellation, + assetfttypes.Feature_dex_unified_ref_amount_change, + }, + BurnRate: burnRate, + SendCommissionRate: sendCommissionRate, + URI: "https://example.com", + URIHash: "1234567890abcdef", + } + issuerFTInstantiatePayload, err := json.Marshal(issuanceReq) + requireT.NoError(err) + + // instantiate new contract + contractAddr, _, err := chain.Wasm.DeployAndInstantiateWASMContract( + ctx, + txf, + admin, + moduleswasm.DEXWASM, + integration.InstantiateConfig{ + Amount: chain.QueryDEXParams(ctx, t).OrderReserve, + AccessType: wasmtypes.AccessTypeUnspecified, + Payload: issuerFTInstantiatePayload, + Label: "dex", + }, + ) + requireT.NoError(err) + + denom2 := assetfttypes.BuildDenom(issuanceReq.Subunit, sdk.MustAccAddressFromBech32(contractAddr)) + + // send some coins to the contract to cover needed fees + sendMsg := &banktypes.MsgSend{ + FromAddress: admin.String(), + ToAddress: contractAddr, + Amount: sdk.NewCoins(chain.NewCoin(sdkmath.NewInt(10_000_000))), + } + + _, err = client.BroadcastTx( + ctx, + chain.ClientContext.WithFromAddress(admin), + chain.TxFactory().WithGas(chain.GasLimitByMsgs(sendMsg)), + sendMsg, + ) + requireT.NoError(err) + + // send some denom1 coin to the contract + sendMsg = &banktypes.MsgSend{ + FromAddress: issuer.String(), + ToAddress: contractAddr, + Amount: sdk.NewCoins(sdk.NewCoin(denom1, sdkmath.NewInt(10_000_000))), + } + + _, err = client.BroadcastTx( + ctx, + chain.ClientContext.WithFromAddress(issuer), + chain.TxFactory().WithGas(chain.GasLimitByMsgs(sendMsg)), + sendMsg, + ) + requireT.NoError(err) + + balanceRes, err := bankClient.Balance(ctx, &banktypes.QueryBalanceRequest{ + Address: contractAddr, + Denom: denom1, + }) + requireT.NoError(err) + requireT.Equal("10000000", balanceRes.Balance.Amount.String()) + + balanceRes, err = bankClient.Balance(ctx, &banktypes.QueryBalanceRequest{ + Address: contractAddr, + Denom: denom2, + }) + requireT.NoError(err) + requireT.Equal("10000000", balanceRes.Balance.Amount.String()) + + blockRes, err := tmQueryClient.GetLatestBlock(ctx, &cmtservice.GetLatestBlockRequest{}) + requireT.NoError(err) + + // ********** Query Params ********** + + paramsPayLoad, err := json.Marshal(map[dexMethod]struct{}{ + dexMethodParams: {}, + }) + requireT.NoError(err) + queryOut, err := chain.Wasm.QueryWASMContract(ctx, contractAddr, paramsPayLoad) + requireT.NoError(err) + var wasmParamsRes dextypes.QueryParamsResponse + requireT.NoError(json.Unmarshal(queryOut, &wasmParamsRes)) + requireT.Equal( + chain.QueryDEXParams(ctx, t).OrderReserve.String(), wasmParamsRes.Params.OrderReserve.String(), + ) + requireT.Equal( + chain.QueryDEXParams(ctx, t).MaxOrdersPerDenom, wasmParamsRes.Params.MaxOrdersPerDenom, + ) + requireT.Equal( + chain.QueryDEXParams(ctx, t).PriceTickExponent, wasmParamsRes.Params.PriceTickExponent, + ) + + // ********** Place Order ********** + + orderQuantity := sdkmath.NewInt(100) + placeOrderPayload, err := json.Marshal(map[dexMethod]placeOrderBodyDEXRequest{ + dexMethodPlaceOrder: { + Order: dextypes.Order{ + Creator: contractAddr, + Type: dextypes.ORDER_TYPE_LIMIT, + ID: "id1", + BaseDenom: denom1, + QuoteDenom: denom2, + Price: lo.ToPtr(dextypes.MustNewPriceFromString("999")), + Quantity: orderQuantity, + Side: dextypes.SIDE_SELL, + GoodTil: &dextypes.GoodTil{ + GoodTilBlockHeight: uint64(blockRes.SdkBlock.Header.Height + 500), + }, + TimeInForce: dextypes.TIME_IN_FORCE_GTC, + RemainingQuantity: orderQuantity, + RemainingBalance: orderQuantity, + Reserve: wasmParamsRes.Params.OrderReserve, + }, + }, + }) + requireT.NoError(err) + + _, 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, + }) + requireT.NoError(err) + requireT.Equal(orderQuantity.String(), assetftBalanceRes.LockedInDEX.String()) + + // ********** Query Order ********** + + expectedOrder := dextypes.Order{ + Creator: contractAddr, + Type: dextypes.ORDER_TYPE_LIMIT, + ID: "id1", + BaseDenom: denom1, + QuoteDenom: denom2, + Price: lo.ToPtr(dextypes.MustNewPriceFromString("999")), + Quantity: orderQuantity, + Side: dextypes.SIDE_SELL, + GoodTil: &dextypes.GoodTil{ + GoodTilBlockHeight: uint64(blockRes.SdkBlock.Header.Height + 500), + }, + TimeInForce: dextypes.TIME_IN_FORCE_GTC, + RemainingQuantity: orderQuantity, + RemainingBalance: orderQuantity, + Reserve: chain.QueryDEXParams(ctx, t).OrderReserve, + } + + orderPayload, err := json.Marshal(map[dexMethod]OrderBodyDEXRequest{ + dexMethodOrder: { + Account: contractAddr, + OrderID: "id1", + }, + }) + requireT.NoError(err) + queryOut, err = chain.Wasm.QueryWASMContract(ctx, contractAddr, orderPayload) + requireT.NoError(err) + var wasmOrderRes dextypes.QueryOrderResponse + requireT.NoError(json.Unmarshal(queryOut, &wasmOrderRes)) + requireT.Equal(expectedOrder, wasmOrderRes.Order) + + // ********** Query Orders ********** + + ordersPayload, err := json.Marshal(map[dexMethod]OrdersBodyDEXRequest{ + dexMethodOrders: { + Creator: contractAddr, + }, + }) + requireT.NoError(err) + queryOut, err = chain.Wasm.QueryWASMContract(ctx, contractAddr, ordersPayload) + requireT.NoError(err) + var wasmOrdersRes dextypes.QueryOrdersResponse + requireT.NoError(json.Unmarshal(queryOut, &wasmOrdersRes)) + requireT.Len(wasmOrdersRes.Orders, 1) + requireT.Equal(expectedOrder, wasmOrdersRes.Orders[0]) + + // ********** Query Order Books ********** + + orderBooksPayload, err := json.Marshal(map[dexMethod]struct{}{ + dexMethodOrderBooks: {}, + }) + requireT.NoError(err) + queryOut, err = chain.Wasm.QueryWASMContract(ctx, contractAddr, orderBooksPayload) + requireT.NoError(err) + var wasmOrderBooksRes dextypes.QueryOrderBooksResponse + requireT.NoError(json.Unmarshal(queryOut, &wasmOrderBooksRes)) + requireT.Contains(wasmOrderBooksRes.OrderBooks, dextypes.OrderBookData{ + BaseDenom: denom1, + QuoteDenom: denom2, + }) + requireT.Contains(wasmOrderBooksRes.OrderBooks, dextypes.OrderBookData{ + BaseDenom: denom2, + QuoteDenom: denom1, + }) + + // ********** Query Order Book Orders ********** + + orderBookOrdersPayload, err := json.Marshal(map[dexMethod]OrderBookOrdersBodyDEXRequest{ + dexMethodOrderBookOrders: { + BaseDenom: denom1, + QuoteDenom: denom2, + Side: dextypes.SIDE_SELL, + }, + }) + requireT.NoError(err) + queryOut, err = chain.Wasm.QueryWASMContract(ctx, contractAddr, orderBookOrdersPayload) + requireT.NoError(err) + var wasmOrderBookOrdersRes dextypes.QueryOrderBookOrdersResponse + requireT.NoError(json.Unmarshal(queryOut, &wasmOrderBookOrdersRes)) + requireT.Len(wasmOrderBookOrdersRes.Orders, 1) + requireT.Equal( + expectedOrder, wasmOrderBookOrdersRes.Orders[0], + ) + + // ********** Query Account Denom Orders Count ********** + + accountDenomOrdersCountPayload, err := json.Marshal(map[dexMethod]AccountDenomOrdersCountBodyDEXRequest{ + dexMethodAccountDenomOrdersCount: { + Account: contractAddr, + Denom: denom1, + }, + }) + requireT.NoError(err) + queryOut, err = chain.Wasm.QueryWASMContract(ctx, contractAddr, accountDenomOrdersCountPayload) + requireT.NoError(err) + var wasmAccountDenomOrdersCountRes dextypes.QueryAccountDenomOrdersCountResponse + requireT.NoError(json.Unmarshal(queryOut, &wasmAccountDenomOrdersCountRes)) + requireT.Equal(uint64(1), wasmAccountDenomOrdersCountRes.Count) + + // ********** Cancel Order ********** + + cancelOrderPayload, err := json.Marshal(map[dexMethod]cancelOrderBodyDEXRequest{ + dexMethodCancelOrder: { + OrderID: "id1", + }, + }) + requireT.NoError(err) + + _, err = chain.Wasm.ExecuteWASMContract(ctx, txf, admin, contractAddr, cancelOrderPayload, sdk.Coin{}) + requireT.NoError(err) + + // ********** Cancel Orders By Denom ********** + + cancelOrdersByDenomPayload, err := json.Marshal(map[dexMethod]cancelOrdersByDenomBodyDEXRequest{ + dexMethodCancelOrdersByDenom: { + Account: contractAddr, + Denom: denom2, + }, + }) + requireT.NoError(err) + + _, err = chain.Wasm.ExecuteWASMContract(ctx, txf, admin, contractAddr, cancelOrdersByDenomPayload, sdk.Coin{}) + requireT.NoError(err) +} + func testSmartContractAccount( ctx context.Context, t *testing.T, diff --git a/proto/coreum/asset/ft/v1/query.proto b/proto/coreum/asset/ft/v1/query.proto index 464c03837..e2e410521 100644 --- a/proto/coreum/asset/ft/v1/query.proto +++ b/proto/coreum/asset/ft/v1/query.proto @@ -5,6 +5,7 @@ import "coreum/asset/ft/v1/params.proto"; import "coreum/asset/ft/v1/token.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/query/v1/query.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; @@ -24,6 +25,7 @@ service Query { // Token queries the fungible token of the module. rpc Token(QueryTokenRequest) returns (QueryTokenResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/coreum/asset/ft/v1/tokens/{denom}"; } @@ -44,6 +46,7 @@ service Query { // FrozenBalance returns frozen balance of the denom for the account. rpc FrozenBalance(QueryFrozenBalanceRequest) returns (QueryFrozenBalanceResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/coreum/asset/ft/v1/accounts/{account}/balances/frozen/{denom}"; } @@ -54,6 +57,7 @@ service Query { // WhitelistedBalance returns whitelisted balance of the denom for the account. rpc WhitelistedBalance(QueryWhitelistedBalanceRequest) returns (QueryWhitelistedBalanceResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/coreum/asset/ft/v1/accounts/{account}/balances/whitelisted/{denom}"; } diff --git a/proto/coreum/asset/ft/v1/tx.proto b/proto/coreum/asset/ft/v1/tx.proto index ef860159a..1ac663aea 100644 --- a/proto/coreum/asset/ft/v1/tx.proto +++ b/proto/coreum/asset/ft/v1/tx.proto @@ -115,7 +115,7 @@ message ExtensionIssueSettings { (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" ]; // optional json encoded data to pass to WASM on instantiation by the ft issuer - bytes issuanceMsg = 4 [ + bytes issuance_msg = 4 [ (gogoproto.casttype) = "github.com/CosmWasm/wasmd/x/wasm/types.RawContractMessage", (amino.encoding) = "inline_json" ]; diff --git a/proto/coreum/asset/nft/v1/query.proto b/proto/coreum/asset/nft/v1/query.proto index 684af7ea8..00eebda74 100644 --- a/proto/coreum/asset/nft/v1/query.proto +++ b/proto/coreum/asset/nft/v1/query.proto @@ -4,6 +4,7 @@ package coreum.asset.nft.v1; import "coreum/asset/nft/v1/nft.proto"; import "coreum/asset/nft/v1/params.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/query/v1/query.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; @@ -18,11 +19,13 @@ service Query { // Class queries the non-fungible token class of the module. rpc Class(QueryClassRequest) returns (QueryClassResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/coreum/asset/nft/v1/classes/{id}"; } // Classes queries the non-fungible token classes of the module. rpc Classes(QueryClassesRequest) returns (QueryClassesResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/coreum/asset/nft/v1/classes"; } diff --git a/proto/coreum/dex/v1/query.proto b/proto/coreum/dex/v1/query.proto index dffa23c13..b7a02f778 100644 --- a/proto/coreum/dex/v1/query.proto +++ b/proto/coreum/dex/v1/query.proto @@ -4,6 +4,7 @@ package coreum.dex.v1; import "coreum/dex/v1/order.proto"; import "coreum/dex/v1/params.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/query/v1/query.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; @@ -13,26 +14,32 @@ option go_package = "github.com/CoreumFoundation/coreum/v5/x/dex/types"; service Query { // Params queries the parameters of x/dex module. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/coreum/dex/v1/params"; } // Order queries order by creator and ID. rpc Order(QueryOrderRequest) returns (QueryOrderResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/coreum/dex/v1/orders/{creator}/{id}"; } // Orders queries creator orders. rpc Orders(QueryOrdersRequest) returns (QueryOrdersResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/coreum/dex/v1/orders/{creator}"; } // OrderBooks queries order books. rpc OrderBooks(QueryOrderBooksRequest) returns (QueryOrderBooksResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/coreum/dex/v1/order-books"; } - // OrdersBookOrders queries order book orders. - rpc OrdersBookOrders(QueryOrderBookOrdersRequest) returns (QueryOrderBookOrdersResponse) { + // OrderBookOrders queries order book orders. + rpc OrderBookOrders(QueryOrderBookOrdersRequest) returns (QueryOrderBookOrdersResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/coreum/dex/v1/order-books/{base_denom}/{quote_denom}/orders"; } // AccountDenomOrdersCount queries account denom orders count. rpc AccountDenomOrdersCount(QueryAccountDenomOrdersCountRequest) returns (QueryAccountDenomOrdersCountResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/coreum/dex/v1/accounts/{account}/denoms/{denom}/orders-count"; } } diff --git a/testutil/integration/coreum.go b/testutil/integration/coreum.go index 89fc65b33..5d57ba3b4 100644 --- a/testutil/integration/coreum.go +++ b/testutil/integration/coreum.go @@ -17,6 +17,7 @@ import ( assetfttypes "github.com/CoreumFoundation/coreum/v5/x/asset/ft/types" assetnfttypes "github.com/CoreumFoundation/coreum/v5/x/asset/nft/types" "github.com/CoreumFoundation/coreum/v5/x/deterministicgas" + dextypes "github.com/CoreumFoundation/coreum/v5/x/dex/types" ) // CoreumChain is configured coreum chain. @@ -227,3 +228,14 @@ func (c CoreumChain) QueryAssetNFTParams(ctx context.Context, t *testing.T) asse return resp.Params } + +// QueryDEXParams queries for dex module params and returns them. +func (c CoreumChain) QueryDEXParams(ctx context.Context, t *testing.T) dextypes.Params { + t.Helper() + + queryClient := dextypes.NewQueryClient(c.ClientContext) + resp, err := queryClient.Params(ctx, &dextypes.QueryParamsRequest{}) + require.NoError(t, err) + + return resp.Params +} diff --git a/x/asset/ft/keeper/test-contracts/asset-extension/Cargo.lock b/x/asset/ft/keeper/test-contracts/asset-extension/Cargo.lock index 0711e81f9..e98076df6 100644 --- a/x/asset/ft/keeper/test-contracts/asset-extension/Cargo.lock +++ b/x/asset/ft/keeper/test-contracts/asset-extension/Cargo.lock @@ -152,7 +152,7 @@ name = "asset-extension" version = "0.1.0" dependencies = [ "coreum-wasm-sdk", - "cosmwasm-schema 2.0.1", + "cosmwasm-schema", "cosmwasm-std", "cw-storage-plus", "cw2", @@ -234,17 +234,30 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "coreum-std-derive" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fee3df604ec822e6a66c0279f2d8840da010f8e07503423ba413baac03c830f" +dependencies = [ + "itertools 0.10.5", + "proc-macro2", + "prost 0.12.6", + "quote", + "syn 1.0.109", +] + [[package]] name = "coreum-wasm-sdk" version = "1.1.0" -source = "git+https://github.com/CoreumFoundation/coreum-wasm-sdk.git?branch=upgrade-cosmwasm-std#0c2f105969a2ce3711c6da2a9e6b9613d6c787d6" +source = "git+https://github.com/CoreumFoundation/coreum-wasm-sdk.git#352e54d12300d263ce135579d5d697d3e46c8431" dependencies = [ "chrono", - "cosmwasm-schema 2.1.4", + "coreum-std-derive", + "cosmwasm-schema", "cosmwasm-std", - "osmosis-std-derive", "prost 0.12.6", - "prost-types 0.12.6", + "prost-types", "schemars", "serde", "serde-cw-value", @@ -290,41 +303,19 @@ dependencies = [ "syn 2.0.79", ] -[[package]] -name = "cosmwasm-schema" -version = "2.0.1" -source = "git+https://github.com/CosmWasm/cosmwasm?rev=3f8bd842742bc94aa60f587f79dd66b782928b15#3f8bd842742bc94aa60f587f79dd66b782928b15" -dependencies = [ - "cosmwasm-schema-derive 2.0.1", - "schemars", - "serde", - "serde_json", - "thiserror", -] - [[package]] name = "cosmwasm-schema" version = "2.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f86b4d949b6041519c58993a73f4bbfba8083ba14f7001eae704865a09065845" dependencies = [ - "cosmwasm-schema-derive 2.1.4", + "cosmwasm-schema-derive", "schemars", "serde", "serde_json", "thiserror", ] -[[package]] -name = "cosmwasm-schema-derive" -version = "2.0.1" -source = "git+https://github.com/CosmWasm/cosmwasm?rev=3f8bd842742bc94aa60f587f79dd66b782928b15#3f8bd842742bc94aa60f587f79dd66b782928b15" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.79", -] - [[package]] name = "cosmwasm-schema-derive" version = "2.1.4" @@ -459,7 +450,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b04852cd38f044c0751259d5f78255d07590d136b8a86d4e09efdd7666bd6d27" dependencies = [ - "cosmwasm-schema 2.1.4", + "cosmwasm-schema", "cosmwasm-std", "cw-storage-plus", "schemars", @@ -754,18 +745,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "osmosis-std-derive" -version = "0.20.1" -source = "git+https://github.com/CoreumFoundation/osmosis-std-derive.git?branch=cosmwasm_2_0#7b837aa9fae698f8432003d44d80e19921b615ea" -dependencies = [ - "itertools 0.10.5", - "proc-macro2", - "prost-types 0.11.9", - "quote", - "syn 1.0.109", -] - [[package]] name = "p256" version = "0.13.2" @@ -857,15 +836,6 @@ dependencies = [ "syn 2.0.79", ] -[[package]] -name = "prost-types" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" -dependencies = [ - "prost 0.11.9", -] - [[package]] name = "prost-types" version = "0.12.6" diff --git a/x/asset/ft/keeper/test-contracts/asset-extension/Cargo.toml b/x/asset/ft/keeper/test-contracts/asset-extension/Cargo.toml index a54acba57..86a93d783 100644 --- a/x/asset/ft/keeper/test-contracts/asset-extension/Cargo.toml +++ b/x/asset/ft/keeper/test-contracts/asset-extension/Cargo.toml @@ -30,8 +30,8 @@ library = [] cosmwasm-std = { version = "2.1.4", features = ["cosmwasm_2_0"] } cw2 = "2.0.0" thiserror = "1.0.59" -cosmwasm-schema = {git = "https://github.com/CosmWasm/cosmwasm", package = "cosmwasm-schema", rev = "3f8bd842742bc94aa60f587f79dd66b782928b15"} -coreum-wasm-sdk = {git = "https://github.com/CoreumFoundation/coreum-wasm-sdk.git", branch = "upgrade-cosmwasm-std"} +cosmwasm-schema = "2.1.4" +coreum-wasm-sdk = { git = "https://github.com/CoreumFoundation/coreum-wasm-sdk.git" } cw-storage-plus = "2.0.0" prost = "0.11.9" serde = { version = "1.0.203", default-features = false, features = ["derive"] } diff --git a/x/asset/ft/types/query.pb.go b/x/asset/ft/types/query.pb.go index 3c6f591ba..422687570 100644 --- a/x/asset/ft/types/query.pb.go +++ b/x/asset/ft/types/query.pb.go @@ -1030,82 +1030,83 @@ func init() { func init() { proto.RegisterFile("coreum/asset/ft/v1/query.proto", fileDescriptor_e9fe336d9bdb8f05) } var fileDescriptor_e9fe336d9bdb8f05 = []byte{ - // 1189 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0xcd, 0x4f, 0x24, 0x45, - 0x14, 0xa7, 0x59, 0x18, 0xd6, 0x42, 0x34, 0x5b, 0xa0, 0x0e, 0x2d, 0xce, 0x60, 0x47, 0x59, 0x5c, - 0x97, 0x2e, 0x81, 0x65, 0x41, 0x37, 0xee, 0xea, 0xf0, 0xb1, 0x41, 0x4c, 0xc4, 0x59, 0x95, 0x8d, - 0x31, 0x21, 0x3d, 0xd3, 0x45, 0xd3, 0x81, 0xe9, 0x9a, 0x9d, 0xaa, 0x99, 0x1d, 0x24, 0x78, 0x58, - 0xff, 0x01, 0x13, 0x0f, 0x9a, 0x78, 0xf2, 0xe0, 0xc5, 0x9b, 0x17, 0xcf, 0x5e, 0x4c, 0x36, 0x5e, - 0xdc, 0x44, 0x0f, 0xc6, 0x03, 0x1a, 0xf0, 0x0f, 0x31, 0x5d, 0xf5, 0x7a, 0xa6, 0xdb, 0xe9, 0x9e, - 0x0f, 0x24, 0x26, 0x9e, 0xa6, 0x3f, 0xde, 0xef, 0xe3, 0xd5, 0x7b, 0xd5, 0xf5, 0x32, 0x28, 0x53, - 0x64, 0x15, 0x5a, 0x2d, 0x11, 0x8b, 0x73, 0x2a, 0xc8, 0x8e, 0x20, 0xb5, 0x59, 0x72, 0xaf, 0x4a, - 0x2b, 0x07, 0x66, 0xb9, 0xc2, 0x04, 0xc3, 0x58, 0xbd, 0x37, 0xe5, 0x7b, 0x73, 0x47, 0x98, 0xb5, - 0x59, 0x3d, 0x1b, 0x83, 0x29, 0x5b, 0x15, 0xab, 0xc4, 0x15, 0x48, 0x8f, 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0x08, 0xb7, 0x8a, 0xe0, 0xb9, 0x1e, 0x1c, 0x05, - 0x59, 0xcc, 0xf7, 0x84, 0x81, 0x24, 0x36, 0x64, 0x12, 0xab, 0x78, 0xf9, 0x5f, 0x24, 0xd1, 0x28, - 0xca, 0xd7, 0x1a, 0x0a, 0x1f, 0x0b, 0xf8, 0xe5, 0x44, 0x47, 0xad, 0x27, 0x98, 0x7e, 0xb5, 0xbb, - 0x60, 0xf0, 0xbd, 0x28, 0x7d, 0xcf, 0x62, 0xd2, 0xc5, 0x17, 0xc5, 0xa6, 0xf5, 0x99, 0xe0, 0x98, - 0xcb, 0x6d, 0x3e, 0x3c, 0xc9, 0x68, 0x8f, 0x4e, 0x32, 0xda, 0x9f, 0x27, 0x19, 0xed, 0xb3, 0xd3, - 0x4c, 0xdf, 0xa3, 0xd3, 0x4c, 0xdf, 0x6f, 0xa7, 0x99, 0xbe, 0x0f, 0xaf, 0x87, 0x26, 0x88, 0x65, - 0x49, 0xba, 0xc6, 0xaa, 0x9e, 0x2d, 0x67, 0x92, 0x40, 0xa5, 0xb6, 0x40, 0xea, 0x4d, 0x29, 0x39, - 0x55, 0x14, 0x52, 0xf2, 0xdf, 0x89, 0xf9, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xa8, 0x05, 0x1c, - 0x9d, 0x94, 0x11, 0x00, 0x00, + // 1204 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0xa6, 0x8d, 0x53, 0x26, 0x14, 0xd4, 0x49, 0x00, 0x67, 0x1b, 0xec, 0xb0, 0x82, 0x34, + 0x94, 0x66, 0x87, 0x24, 0x4d, 0x13, 0xa8, 0x68, 0xc1, 0xf9, 0xa8, 0x42, 0x90, 0x30, 0x2e, 0x90, + 0x0a, 0x21, 0x45, 0x1b, 0xef, 0x64, 0xb3, 0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x28, 0xa3, 0x7d, 0x71, 0x9c, 0xe9, + 0x7b, 0x74, 0x9c, 0xe9, 0xfb, 0xf5, 0x38, 0xd3, 0xf7, 0xc1, 0xb5, 0xc8, 0x40, 0xb1, 0x28, 0x49, + 0x57, 0x58, 0xd5, 0xb3, 0xe5, 0x88, 0x12, 0xa8, 0xd4, 0xe6, 0x48, 0x3d, 0x94, 0x92, 0x43, 0xc6, + 0x66, 0x4a, 0xfe, 0xb3, 0x62, 0xf6, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x52, 0x53, 0x00, 0x2f, + 0xc0, 0x11, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/asset/ft/types/tx.pb.go b/x/asset/ft/types/tx.pb.go index 1561c27ca..886ca4c17 100644 --- a/x/asset/ft/types/tx.pb.go +++ b/x/asset/ft/types/tx.pb.go @@ -101,7 +101,7 @@ type ExtensionIssueSettings struct { // funds coins that are transferred to the contract on instantiation Funds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=funds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"funds"` // optional json encoded data to pass to WASM on instantiation by the ft issuer - IssuanceMsg github_com_CosmWasm_wasmd_x_wasm_types.RawContractMessage `protobuf:"bytes,4,opt,name=issuanceMsg,proto3,casttype=github.com/CosmWasm/wasmd/x/wasm/types.RawContractMessage" json:"issuanceMsg,omitempty"` + IssuanceMsg github_com_CosmWasm_wasmd_x_wasm_types.RawContractMessage `protobuf:"bytes,4,opt,name=issuance_msg,json=issuanceMsg,proto3,casttype=github.com/CosmWasm/wasmd/x/wasm/types.RawContractMessage" json:"issuance_msg,omitempty"` } func (m *ExtensionIssueSettings) Reset() { *m = ExtensionIssueSettings{} } @@ -780,105 +780,105 @@ func init() { func init() { proto.RegisterFile("coreum/asset/ft/v1/tx.proto", fileDescriptor_e54b0962ccfc4ca0) } var fileDescriptor_e54b0962ccfc4ca0 = []byte{ - // 1559 bytes of a gzipped FileDescriptorProto + // 1562 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcd, 0x6f, 0xdb, 0x46, 0x16, 0x37, 0x23, 0xdb, 0x92, 0x46, 0x76, 0x6c, 0x33, 0x4e, 0x42, 0xdb, 0x89, 0xa4, 0x30, 0xc9, 0xae, 0xd7, 0x8b, 0x88, 0x6b, 0x67, 0x93, 0xc5, 0x1a, 0x58, 0x60, 0xe3, 0xaf, 0xc6, 0x45, 0x14, 0xa4, 0x74, 0x9c, 0xa4, 0x39, 0x54, 0x18, 0x91, 0x23, 0x7a, 0x6a, 0x71, 0x28, 0x70, 0x86, 0xfe, - 0xc8, 0xa1, 0x28, 0x7a, 0xe8, 0x21, 0x87, 0xa2, 0xbd, 0xf6, 0x50, 0xf4, 0xd6, 0xa2, 0x97, 0x1a, - 0x6d, 0xfe, 0x88, 0xf4, 0x16, 0xb4, 0x97, 0xa2, 0x05, 0xdc, 0xd6, 0x39, 0xf8, 0xd8, 0x7b, 0x4f, - 0xc5, 0x0c, 0x49, 0x89, 0x92, 0x29, 0x87, 0x71, 0x0c, 0x34, 0x17, 0x89, 0xf3, 0xde, 0x9b, 0xdf, - 0xfb, 0xcd, 0x9b, 0xf7, 0x66, 0x1e, 0x09, 0x26, 0x0c, 0xc7, 0x45, 0x9e, 0xad, 0x41, 0x4a, 0x11, - 0xd3, 0x6a, 0x4c, 0xdb, 0x98, 0xd6, 0xd8, 0x56, 0xa9, 0xe1, 0x3a, 0xcc, 0x91, 0x65, 0x5f, 0x59, - 0x12, 0xca, 0x52, 0x8d, 0x95, 0x36, 0xa6, 0xc7, 0x47, 0xa0, 0x8d, 0x89, 0xa3, 0x89, 0x5f, 0xdf, - 0x6c, 0xbc, 0x10, 0x83, 0xd1, 0x80, 0x2e, 0xb4, 0x69, 0x60, 0x90, 0x8f, 0x73, 0xe2, 0xac, 0x23, - 0xd2, 0xd2,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53, 0xeb, 0x8d, 0xba, 0x53, 0x85, - 0xf5, 0xfa, 0xf6, 0x91, 0x93, 0x64, 0x14, 0xf4, 0x99, 0x88, 0x38, 0x76, 0x78, 0x32, 0x89, 0xc1, - 0xec, 0x3f, 0x3a, 0x08, 0x8c, 0x45, 0xe2, 0xd6, 0xee, 0x52, 0x7d, 0x2c, 0x81, 0x53, 0x11, 0xe9, - 0x2b, 0xec, 0x7d, 0x3c, 0x95, 0x7f, 0x76, 0x50, 0x99, 0x88, 0xa1, 0xd2, 0xdc, 0xca, 0x20, 0x01, - 0xe7, 0xeb, 0x70, 0xb3, 0x0a, 0x8d, 0xf5, 0xd7, 0x3b, 0x01, 0x43, 0x96, 0xea, 0x77, 0x12, 0x38, - 0xe3, 0x27, 0xe0, 0xfd, 0x35, 0xcc, 0x50, 0x1d, 0x53, 0x86, 0xcc, 0x5b, 0xd8, 0xc6, 0xec, 0xaf, - 0x5f, 0x40, 0xa9, 0x63, 0x01, 0xf9, 0xc8, 0x02, 0x62, 0x08, 0xab, 0x9f, 0x49, 0x60, 0xb8, 0x4c, - 0xad, 0xbb, 0x2e, 0x24, 0xb4, 0x86, 0xdc, 0x1b, 0xa6, 0x8d, 0x8f, 0xb7, 0xa0, 0x9a, 0x59, 0x92, - 0x8a, 0x66, 0xc9, 0x64, 0x07, 0x4d, 0x25, 0x42, 0xb3, 0x8d, 0x8b, 0xfa, 0x1e, 0x18, 0x14, 0xb1, - 0x47, 0xf0, 0xc8, 0xe4, 0xe2, 0x13, 0xf5, 0x72, 0x07, 0x85, 0xd3, 0x6d, 0x5b, 0x1d, 0xba, 0x53, - 0xbf, 0xf0, 0x0b, 0x77, 0xb5, 0x61, 0xb9, 0xd0, 0x44, 0x77, 0x79, 0x83, 0x7e, 0x6f, 0xfa, 0xb8, - 0x48, 0xc8, 0x05, 0x90, 0xc3, 0x55, 0xa3, 0x82, 0x08, 0xac, 0xd6, 0x91, 0x29, 0x62, 0x94, 0xd1, - 0x01, 0xae, 0x1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17, 0xfc, 0x36, 0xab, 0x24, 0xc8, 0x3a, 0x00, 0x91, 0x2b, 0xf5, + 0x42, 0xd7, 0x8c, 0x84, 0x26, 0x09, 0xeb, 0xa3, 0xe3, 0x96, 0xec, 0x56, 0x1f, 0xed, 0x66, 0x49, + 0xb0, 0xef, 0x81, 0x81, 0xb6, 0x7b, 0xed, 0x62, 0x57, 0xe4, 0x96, 0x51, 0x12, 0xdc, 0x06, 0x18, + 0x3b, 0xe4, 0xe2, 0x39, 0x34, 0x48, 0x8c, 0x47, 0x92, 0x88, 0x2e, 0x18, 0x3f, 0xe4, 0xe0, 0x9f, + 0x7e, 0x51, 0xc8, 0x03, 0x2e, 0x09, 0x62, 0x8e, 0xf7, 0xbd, 0xcf, 0x6f, 0xe7, 0xb9, 0xbb, 0x4f, + 0x7f, 0xcb, 0xf7, 0x3c, 0xdd, 0xcb, 0x4b, 0xcf, 0xf6, 0xf2, 0xd2, 0xaf, 0x7b, 0x79, 0xe9, 0xe3, + 0xe7, 0xf9, 0x9e, 0x67, 0xcf, 0xf3, 0x3d, 0x3f, 0x3e, 0xcf, 0xf7, 0x3c, 0xbc, 0xde, 0xf6, 0x71, + 0x81, 0x23, 0x2e, 0x39, 0x1e, 0x31, 0x21, 0xc3, 0x0e, 0xd1, 0x82, 0x8f, 0x95, 0x1b, 0xd7, 0xb4, + 0xad, 0xd6, 0x17, 0x4b, 0xf1, 0xb1, 0xa1, 0xda, 0x2f, 0xbe, 0x22, 0x5e, 0xfd, 0x33, 0x00, 0x00, + 0xff, 0xff, 0x29, 0x33, 0x34, 0x8d, 0x36, 0x15, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/asset/nft/types/query.pb.go b/x/asset/nft/types/query.pb.go index 27e6eb3ea..619534a33 100644 --- a/x/asset/nft/types/query.pb.go +++ b/x/asset/nft/types/query.pb.go @@ -1162,73 +1162,74 @@ func init() { func init() { proto.RegisterFile("coreum/asset/nft/v1/query.proto", fileDescriptor_97b36b7d05006cb3) } var fileDescriptor_97b36b7d05006cb3 = []byte{ - // 1055 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0x5f, 0x6b, 0x1c, 0x55, - 0x14, 0xcf, 0xdd, 0xb8, 0x9b, 0xf4, 0x04, 0x8a, 0x9e, 0xa4, 0xed, 0x76, 0x9a, 0x6c, 0xd6, 0x49, - 0x4d, 0xd2, 0x62, 0x66, 0x4c, 0x6a, 0x62, 0x9b, 0xaa, 0xd5, 0x14, 0xb7, 0x06, 0xa4, 0xa6, 0x8b, - 0x20, 0xf8, 0xa0, 0xcc, 0xee, 0xce, 0x6e, 0x07, 0x92, 0xb9, 0xdb, 0xbd, 0xb3, 0xd1, 0x1a, 0x02, - 0x56, 0x0b, 0x22, 0x28, 0x08, 0xbe, 0x29, 0x3e, 0xf8, 0xee, 0x83, 0xcf, 0xfa, 0x05, 0xfa, 0x24, - 0x01, 0x5f, 0x04, 0x41, 0x24, 0x11, 0xfc, 0x1a, 0xb2, 0xf7, 0x9e, 0xc9, 0xce, 0x6c, 0xe6, 0xcf, - 0x6e, 0x0c, 0xf1, 0x6d, 0xe7, 0xce, 0x39, 0xe7, 0xf7, 0xe7, 0xde, 0xb9, 0xe7, 0xb0, 0x30, 0x5d, - 0xe5, 0x2d, 0xbb, 0xbd, 0x65, 0x5a, 0x42, 0xd8, 0x9e, 0xe9, 0xd6, 0x3d, 0x73, 0x7b, 0xd1, 0x7c, - 0xd0, 0xb6, 0x5b, 0x0f, 0x8d, 0x66, 0x8b, 0x7b, 0x1c, 0xc7, 0x55, 0x80, 0x21, 0x03, 0x0c, 0xb7, - 0xee, 0x19, 0xdb, 0x8b, 0xda, 0x54, 0x54, 0x56, 0xe7, 0x9d, 0xcc, 0xd1, 0x8a, 0x51, 0xaf, 0x9b, - 0x56, 0xcb, 0xda, 0x12, 0x14, 0x71, 0xb5, 0xca, 0xc5, 0x16,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 0x9c, 0x93, 0xf8, 0xe9, 0x48, 0x5b, 0x3d, 0x4e, 0x2a, 0x49, 0xbb, 0x29, 0xa5, - 0x2d, 0xe3, 0xb5, 0x7e, 0xa5, 0x05, 0x05, 0xfd, 0xc0, 0x60, 0xd4, 0xef, 0x48, 0x98, 0x70, 0xad, - 0xf5, 0xf4, 0x6c, 0xed, 0x6a, 0x3f, 0xa1, 0x44, 0xf0, 0x55, 0x49, 0xf0, 0x3a, 0xae, 0xf4, 0x4b, - 0x50, 0x76, 0x6d, 0x73, 0x47, 0x35, 0xb1, 0x5d, 0xfc, 0x89, 0xc1, 0xd3, 0xbd, 0x5d, 0x13, 0x17, - 0xd3, 0x09, 0xf4, 0x74, 0x79, 0x6d, 0x69, 0x90, 0x14, 0xe2, 0xbe, 0x2c, 0xb9, 0x9b, 0xb8, 0x30, - 0x10, 0xf7, 0xb5, 0x7b, 0x4f, 0xf6, 0x0b, 0x6c, 0x6f, 0xbf, 0xc0, 0xfe, 0xda, 0x2f, 0xb0, 0xaf, - 0x0f, 0x0a, 0x43, 0x7b, 0x07, 0x85, 0xa1, 0xdf, 0x0f, 0x0a, 0x43, 0xef, 0xbd, 0xd4, 0x70, 0xbc, - 0xfb, 0xed, 0x8a, 0x51, 0xe5, 0x5b, 0xe6, 0x6d, 0x59, 0xb2, 0xc4, 0xdb, 0x6e, 0x4d, 0x76, 0x6e, - 0x1f, 0x63, 0x7b, 0xd9, 0xfc, 0x28, 0x00, 0xe4, 0x3d, 0x6c, 0xda, 0xa2, 0x92, 0x93, 0xff, 0x0f, - 0x5c, 0xfb, 0x37, 0x00, 0x00, 0xff, 0xff, 0xd1, 0xf9, 0x26, 0x86, 0xf8, 0x10, 0x00, 0x00, + // 1070 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0xdf, 0x6b, 0x1c, 0x55, + 0x14, 0xce, 0xdd, 0xb8, 0x9b,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xa5, 0x16, 0x24, 0xf4, 0x03, 0x83, 0x51, 0xbf, 0x37, 0x61, 0xc2, 0xdb, 0xd6, 0xd5, + 0xbd, 0x95, 0xc5, 0x5e, 0x4c, 0x09, 0xe0, 0x6b, 0x02, 0xe0, 0x15, 0x5c, 0xeb, 0x15, 0xa0, 0xe8, + 0xdf, 0xfa, 0x9e, 0x6c, 0x67, 0xfb, 0xf8, 0x88, 0xc1, 0xd3, 0xdd, 0xfd, 0x13, 0x97, 0xd3, 0x01, + 0x74, 0xf5, 0x7b, 0x65, 0xa5, 0x1f, 0x17, 0xc2, 0xbe, 0x2a, 0xb0, 0xeb, 0xb8, 0xd4, 0x17, 0xf6, + 0x8d, 0xdb, 0x8f, 0x0f, 0x0a, 0xec, 0xc9, 0x41, 0x81, 0xfd, 0x79, 0x50, 0x60, 0x5f, 0x1f, 0x16, + 0x86, 0x9e, 0x1c, 0x16, 0x86, 0x7e, 0x3b, 0x2c, 0x0c, 0xbd, 0xff, 0x72, 0xc3, 0x72, 0xef, 0x78, + 0x15, 0xad, 0xea, 0xec, 0xe8, 0x37, 0x44, 0xc8, 0x92, 0xe3, 0xd9, 0x35, 0xd1, 0xc3, 0xfd, 0x1c, + 0xbb, 0xab, 0xfa, 0xc7, 0x81, 0x44, 0xee, 0xbd, 0xa6, 0xc9, 0x2b, 0x39, 0xf1, 0x4f, 0xc1, 0xe5, + 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xd9, 0x0c, 0x90, 0x0f, 0x1f, 0x11, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/dex/client/cli/query.go b/x/dex/client/cli/query.go index 0791efc04..f26cd3981 100644 --- a/x/dex/client/cli/query.go +++ b/x/dex/client/cli/query.go @@ -219,7 +219,7 @@ $ %[1]s query %s order-book-orders denom1 denom2 buy return errors.Errorf("unknown side '%s'", args[2]) } - res, err := queryClient.OrdersBookOrders(cmd.Context(), &types.QueryOrderBookOrdersRequest{ + res, err := queryClient.OrderBookOrders(cmd.Context(), &types.QueryOrderBookOrdersRequest{ BaseDenom: args[0], QuoteDenom: args[1], Side: types.Side(side), diff --git a/x/dex/keeper/grpc_query.go b/x/dex/keeper/grpc_query.go index d5966fce6..c6fba3f3b 100644 --- a/x/dex/keeper/grpc_query.go +++ b/x/dex/keeper/grpc_query.go @@ -87,8 +87,8 @@ func (qs QueryService) OrderBooks( }, nil } -// OrdersBookOrders queries order book orders. -func (qs QueryService) OrdersBookOrders( +// OrderBookOrders queries order book orders. +func (qs QueryService) OrderBookOrders( ctx context.Context, req *types.QueryOrderBookOrdersRequest, ) (*types.QueryOrderBookOrdersResponse, error) { diff --git a/x/dex/types/query.pb.go b/x/dex/types/query.pb.go index bc2df1b0b..a35e8e48b 100644 --- a/x/dex/types/query.pb.go +++ b/x/dex/types/query.pb.go @@ -661,58 +661,59 @@ func init() { func init() { proto.RegisterFile("coreum/dex/v1/query.proto", fileDescriptor_23a17d94653a2124) } var fileDescriptor_23a17d94653a2124 = []byte{ - // 803 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xcf, 0x4e, 0x13, 0x41, - 0x18, 0xef, 0x96, 0xb6, 0x86, 0xaf, 0x91, 0xe8, 0x50, 0xa4, 0xae, 0xa5, 0xc0, 0x8a, 0x40, 0x50, - 0x76, 0x6c, 0x89, 0x37, 0xd0, 0x08, 0x88, 0x89, 0x1e, 0xc4, 0x1a, 0x2f, 0x5e, 0x70, 0xdb, 0x9d, - 0xd4, 0x0d, 0x76, 0xa7, 0xec, 0x6e, 0x9b, 0x62, 0xd3, 0x98, 0xf8, 0x04, 0x46, 0x8f, 0x3e, 0x80, - 0x67, 0xdf, 0x02, 0x2f, 0x86, 0xc4, 0x8b, 0x27, 0x63, 0xc0, 0xb3, 0xcf, 0x60, 0x76, 0xe6, 0x2b, - 0xed, 0x96, 0x6d, 0xab, 0xc4, 0x83, 0xb7, 0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 0x55, 0x68, 0x42, 0x45, 0x86, - 0xa8, 0x61, 0x2a, 0x96, 0x45, 0xcf, 0x21, 0x9f, 0x14, 0xb8, 0x20, 0xc5, 0x77, 0xde, 0x07, 0x59, - 0x1a, 0x48, 0x10, 0x8c, 0xe3, 0xfa, 0x1f, 0x61, 0x51, 0xd1, 0xa6, 0x50, 0x74, 0x9b, 0xac, 0xf6, - 0x57, 0x44, 0x9b, 0x9d, 0x26, 0xd3, 0xa2, 0xcd, 0xae, 0x96, 0xd2, 0xc2, 0xf8, 0xc8, 0x67, 0x05, - 0x26, 0xfb, 0x5c, 0x6f, 0x92, 0x0f, 0x93, 0x33, 0xf8, 0x89, 0xa9, 0x2b, 0x7f, 0xb5, 0x07, 0xad, - 0xdc, 0x13, 0x56, 0xee, 0x90, 0xb5, 0x1e, 0x2b, 0xf8, 0x3a, 0x5d, 0xda, 0xc4, 0xaf, 0x16, 0x15, - 0xea, 0x5d, 0xda, 0x0c, 0xb8, 0x58, 0x16, 0x8b, 0xeb, 0x0f, 0x0f, 0x8e, 0xb2, 0xca, 0xe1, 0x51, - 0x56, 0xf9, 0x71, 0x94, 0x55, 0xde, 0x1e, 0x67, 0x23, 0x87, 0xc7, 0xd9, 0xc8, 0xb7, 0xe3, 0x6c, - 0xe4, 0x59, 0xae, 0x6c, 0x79, 0x2f, 0x6a, 0x45, 0xbd, 0xc4, 0x2b, 0x74, 0x43, 0x50, 0x6c, 0xf1, - 0x9a, 0x6d, 0x8a, 0xe6, 0xd1, 0xe6, 0xac, 0xdf, 0xa2, 0x0d, 0x41, 0xec, 0xed, 0x57, 0x99, 0x5b, - 0x4c, 0x88, 0xbf, 0x32, 0x2b, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xe1, 0xea, 0xc0, 0x6f, 0x8d, - 0x09, 0x00, 0x00, + // 825 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56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 0x2e, 0x15, 0x16, 0x5c, 0xda, 0x89, 0x58, 0x59, 0x13, 0x9b, 0x5b, 0x7f, + 0x9f, 0x5e, 0x14, 0x95, 0xf3, 0x8b, 0xa2, 0xf2, 0xf6, 0xa2, 0xa8, 0x3c, 0xbe, 0x2c, 0x26, 0xce, + 0x2f, 0x8b, 0x89, 0xd7, 0x97, 0xc5, 0xc4, 0xad, 0x52, 0xdd, 0xf2, 0xee, 0xb4, 0xaa, 0x7a, 0x8d, + 0x37, 0xe8, 0xb6, 0xa0, 0xd8, 0xe5, 0x2d, 0xdb, 0x14, 0xa3, 0xa5, 0xc7, 0xd9, 0xfe, 0x95, 0x1e, + 0x0b, 0x62, 0xef, 0xa4, 0xc9, 0xdc, 0x6a, 0x46, 0xfc, 0xd1, 0x59, 0xff, 0x10, 0x00, 0x00, 0xff, + 0xff, 0x62, 0xd8, 0x53, 0xed, 0xc8, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -735,8 +736,8 @@ type QueryClient interface { Orders(ctx context.Context, in *QueryOrdersRequest, opts ...grpc.CallOption) (*QueryOrdersResponse, error) // OrderBooks queries order books. OrderBooks(ctx context.Context, in *QueryOrderBooksRequest, opts ...grpc.CallOption) (*QueryOrderBooksResponse, error) - // OrdersBookOrders queries order book orders. - OrdersBookOrders(ctx context.Context, in *QueryOrderBookOrdersRequest, opts ...grpc.CallOption) (*QueryOrderBookOrdersResponse, error) + // OrderBookOrders queries order book orders. + OrderBookOrders(ctx context.Context, in *QueryOrderBookOrdersRequest, opts ...grpc.CallOption) (*QueryOrderBookOrdersResponse, error) // AccountDenomOrdersCount queries account denom orders count. AccountDenomOrdersCount(ctx context.Context, in *QueryAccountDenomOrdersCountRequest, opts ...grpc.CallOption) (*QueryAccountDenomOrdersCountResponse, error) } @@ -785,9 +786,9 @@ func (c *queryClient) OrderBooks(ctx context.Context, in *QueryOrderBooksRequest return out, nil } -func (c *queryClient) OrdersBookOrders(ctx context.Context, in *QueryOrderBookOrdersRequest, opts ...grpc.CallOption) (*QueryOrderBookOrdersResponse, error) { +func (c *queryClient) OrderBookOrders(ctx context.Context, in *QueryOrderBookOrdersRequest, opts ...grpc.CallOption) (*QueryOrderBookOrdersResponse, error) { out := new(QueryOrderBookOrdersResponse) - err := c.cc.Invoke(ctx, "/coreum.dex.v1.Query/OrdersBookOrders", in, out, opts...) + err := c.cc.Invoke(ctx, "/coreum.dex.v1.Query/OrderBookOrders", in, out, opts...) if err != nil { return nil, err } @@ -813,8 +814,8 @@ type QueryServer interface { Orders(context.Context, *QueryOrdersRequest) (*QueryOrdersResponse, error) // OrderBooks queries order books. OrderBooks(context.Context, *QueryOrderBooksRequest) (*QueryOrderBooksResponse, error) - // OrdersBookOrders queries order book orders. - OrdersBookOrders(context.Context, *QueryOrderBookOrdersRequest) (*QueryOrderBookOrdersResponse, error) + // OrderBookOrders queries order book orders. + OrderBookOrders(context.Context, *QueryOrderBookOrdersRequest) (*QueryOrderBookOrdersResponse, error) // AccountDenomOrdersCount queries account denom orders count. AccountDenomOrdersCount(context.Context, *QueryAccountDenomOrdersCountRequest) (*QueryAccountDenomOrdersCountResponse, error) } @@ -835,8 +836,8 @@ func (*UnimplementedQueryServer) Orders(ctx context.Context, req *QueryOrdersReq func (*UnimplementedQueryServer) OrderBooks(ctx context.Context, req *QueryOrderBooksRequest) (*QueryOrderBooksResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method OrderBooks not implemented") } -func (*UnimplementedQueryServer) OrdersBookOrders(ctx context.Context, req *QueryOrderBookOrdersRequest) (*QueryOrderBookOrdersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method OrdersBookOrders not implemented") +func (*UnimplementedQueryServer) OrderBookOrders(ctx context.Context, req *QueryOrderBookOrdersRequest) (*QueryOrderBookOrdersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OrderBookOrders not implemented") } func (*UnimplementedQueryServer) AccountDenomOrdersCount(ctx context.Context, req *QueryAccountDenomOrdersCountRequest) (*QueryAccountDenomOrdersCountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AccountDenomOrdersCount not implemented") @@ -918,20 +919,20 @@ func _Query_OrderBooks_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } -func _Query_OrdersBookOrders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Query_OrderBookOrders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryOrderBookOrdersRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).OrdersBookOrders(ctx, in) + return srv.(QueryServer).OrderBookOrders(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/coreum.dex.v1.Query/OrdersBookOrders", + FullMethod: "/coreum.dex.v1.Query/OrderBookOrders", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).OrdersBookOrders(ctx, req.(*QueryOrderBookOrdersRequest)) + return srv.(QueryServer).OrderBookOrders(ctx, req.(*QueryOrderBookOrdersRequest)) } return interceptor(ctx, in, info, handler) } @@ -975,8 +976,8 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Handler: _Query_OrderBooks_Handler, }, { - MethodName: "OrdersBookOrders", - Handler: _Query_OrdersBookOrders_Handler, + MethodName: "OrderBookOrders", + Handler: _Query_OrderBookOrders_Handler, }, { MethodName: "AccountDenomOrdersCount", diff --git a/x/dex/types/query.pb.gw.go b/x/dex/types/query.pb.gw.go index dbfe9e9a6..973fa3a4c 100644 --- a/x/dex/types/query.pb.gw.go +++ b/x/dex/types/query.pb.gw.go @@ -236,10 +236,10 @@ func local_request_Query_OrderBooks_0(ctx context.Context, marshaler runtime.Mar } var ( - filter_Query_OrdersBookOrders_0 = &utilities.DoubleArray{Encoding: map[string]int{"base_denom": 0, "quote_denom": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_Query_OrderBookOrders_0 = &utilities.DoubleArray{Encoding: map[string]int{"base_denom": 0, "quote_denom": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} ) -func request_Query_OrdersBookOrders_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +func request_Query_OrderBookOrders_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryOrderBookOrdersRequest var metadata runtime.ServerMetadata @@ -275,16 +275,16 @@ func request_Query_OrdersBookOrders_0(ctx context.Context, marshaler runtime.Mar if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_OrdersBookOrders_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_OrderBookOrders_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.OrdersBookOrders(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.OrderBookOrders(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_OrdersBookOrders_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { +func local_request_Query_OrderBookOrders_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryOrderBookOrdersRequest var metadata runtime.ServerMetadata @@ -320,11 +320,11 @@ func local_request_Query_OrdersBookOrders_0(ctx context.Context, marshaler runti if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_OrdersBookOrders_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_OrderBookOrders_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.OrdersBookOrders(ctx, &protoReq) + msg, err := server.OrderBookOrders(ctx, &protoReq) return msg, metadata, err } @@ -503,7 +503,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_OrdersBookOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_OrderBookOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -514,7 +514,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_OrdersBookOrders_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_OrderBookOrders_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -522,7 +522,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_OrdersBookOrders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_OrderBookOrders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -670,7 +670,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_OrdersBookOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_OrderBookOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) @@ -679,14 +679,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_OrdersBookOrders_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_OrderBookOrders_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Query_OrdersBookOrders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_OrderBookOrders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -722,7 +722,7 @@ var ( pattern_Query_OrderBooks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"coreum", "dex", "v1", "order-books"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_OrdersBookOrders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"coreum", "dex", "v1", "order-books", "base_denom", "quote_denom", "orders"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_OrderBookOrders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"coreum", "dex", "v1", "order-books", "base_denom", "quote_denom", "orders"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_AccountDenomOrdersCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7}, []string{"coreum", "dex", "v1", "accounts", "account", "denoms", "denom", "orders-count"}, "", runtime.AssumeColonVerbOpt(true))) ) @@ -736,7 +736,7 @@ var ( forward_Query_OrderBooks_0 = runtime.ForwardResponseMessage - forward_Query_OrdersBookOrders_0 = runtime.ForwardResponseMessage + forward_Query_OrderBookOrders_0 = runtime.ForwardResponseMessage forward_Query_AccountDenomOrdersCount_0 = runtime.ForwardResponseMessage ) diff --git a/x/wasm/handler/query.go b/x/wasm/handler/query.go index 58480da1c..50e3665ff 100644 --- a/x/wasm/handler/query.go +++ b/x/wasm/handler/query.go @@ -4,7 +4,10 @@ import ( "context" "encoding/base64" "encoding/json" + "fmt" + msgv1 "cosmossdk.io/api/cosmos/msg/v1" + queryv1 "cosmossdk.io/api/cosmos/query/v1" sdkmath "cosmossdk.io/math" nfttypes "cosmossdk.io/x/nft" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" @@ -12,9 +15,12 @@ import ( "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/gogoproto/proto" + gogoproto "github.com/cosmos/gogoproto/proto" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protodesc" + "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/types/dynamicpb" assetfttypes "github.com/CoreumFoundation/coreum/v5/x/asset/ft/types" assetnfttypes "github.com/CoreumFoundation/coreum/v5/x/asset/nft/types" @@ -154,20 +160,62 @@ type coreumQuery struct { NFT *nftQuery `json:"nft"` } +// newModuleQuerySafeAllowList returns a map of all query paths labeled with module_query_safe in the proto files to +// their response proto. +func newModuleQuerySafeAllowList() wasmkeeper.AcceptedQueries { + fds, err := gogoproto.MergedGlobalFileDescriptors() + if err != nil { + panic(err) + } + // create the files using 'AllowUnresolvable' to avoid + // unnecessary panic: https://github.com/cosmos/ibc-go/issues/6435 + protoFiles, err := protodesc.FileOptions{ + AllowUnresolvable: true, + }.NewFiles(fds) + if err != nil { + panic(err) + } + + allowList := wasmkeeper.AcceptedQueries{} + protoFiles.RangeFiles(func(fd protoreflect.FileDescriptor) bool { + for i := 0; i < fd.Services().Len(); i++ { + // Get the service descriptor + sd := fd.Services().Get(i) + + // Skip services that are annotated with the "cosmos.msg.v1.service" option. + if ext := proto.GetExtension(sd.Options(), msgv1.E_Service); ext != nil && ext.(bool) { + continue + } + + for j := 0; j < sd.Methods().Len(); j++ { + // Get the method descriptor + md := sd.Methods().Get(j) + + // Skip methods that are not annotated with the "cosmos.query.v1.module_query_safe" option. + if ext := proto.GetExtension(md.Options(), queryv1.E_ModuleQuerySafe); ext == nil || !ext.(bool) { + continue + } + + // Add the method to the whitelist + path := fmt.Sprintf("/%s/%s", sd.FullName(), md.Name()) + allowList[path] = dynamicpb.NewMessage(md.Output()) + } + } + return true + }) + + return allowList +} + // NewCoreumQueryHandler returns the coreum handler which handles queries from smart contracts. func NewCoreumQueryHandler( assetFTQueryServer assetfttypes.QueryServer, assetNFTQueryServer assetnfttypes.QueryServer, nftQueryServer nfttypes.QueryServer, gRPCQueryRouter *baseapp.GRPCQueryRouter, codec *codec.ProtoCodec, ) *wasmkeeper.QueryPlugins { - acceptList := wasmkeeper.AcceptedQueries{ - "/coreum.asset.ft.v1.Query/Token": &assetfttypes.QueryTokenResponse{}, - "/coreum.asset.ft.v1.Query/FrozenBalance": &assetfttypes.QueryFrozenBalanceResponse{}, - "/coreum.asset.ft.v1.Query/WhitelistedBalance": &assetfttypes.QueryWhitelistedBalanceResponse{}, - "/cosmos.bank.v1beta1.Query/Balance": &banktypes.QueryBalanceResponse{}, - "/coreum.asset.nft.v1.Query/Class": &assetnfttypes.QueryClassResponse{}, - "/coreum.asset.nft.v1.Query/Classes": &assetnfttypes.QueryClassesResponse{}, - "/cosmos.nft.v1beta1.Query/Owner": &nfttypes.QueryOwnerResponse{}, - } + acceptList := newModuleQuerySafeAllowList() + // TODO: "/cosmos.nft.v1beta1.Query/Owner" is not marked as module_query_safe in cosmos, but we need it + acceptList["/cosmos.nft.v1beta1.Query/Owner"] = &nfttypes.QueryOwnerResponse{} + return &wasmkeeper.QueryPlugins{ Grpc: wasmkeeper.AcceptListGrpcQuerier(acceptList, gRPCQueryRouter, codec), Custom: func(ctx sdk.Context, query json.RawMessage) ([]byte, error) { @@ -680,16 +728,16 @@ func executeQuery[T, K any]( func unmarshalData(data *codectypes.Any) (string, error) { switch data.TypeUrl { - case "/" + proto.MessageName((*assetnfttypes.DataBytes)(nil)): + case "/" + gogoproto.MessageName((*assetnfttypes.DataBytes)(nil)): var datab assetnfttypes.DataBytes - err := proto.Unmarshal(data.Value, &datab) + err := gogoproto.Unmarshal(data.Value, &datab) if err != nil { return "", errors.WithStack(err) } return base64.StdEncoding.EncodeToString(datab.Data), nil - case "/" + proto.MessageName((*assetnfttypes.DataDynamic)(nil)): + case "/" + gogoproto.MessageName((*assetnfttypes.DataDynamic)(nil)): var datadynamic assetnfttypes.DataDynamic - err := proto.Unmarshal(data.Value, &datadynamic) + err := gogoproto.Unmarshal(data.Value, &datadynamic) if err != nil { return "", errors.WithStack(err) } From 7618a7b87e507d0fb8057c6322b760d966d9e162 Mon Sep 17 00:00:00 2001 From: Masih Yeganeh Date: Wed, 30 Oct 2024 15:28:50 +0330 Subject: [PATCH 3/5] DEX whitelist test (#1016) * Test DEX messages and queries in wasm * Use module_query_safe for gRPC query accept list * Update dependencies * Fix FT bug * Fix NFT bug * Fix CI errors * Disable breakingProto * Fix linter errors * Fix naming in ExtensionIssueSettings message * Fix tests * Fix lints * Fix unchecked nils * Gave up * Fix FT test * Add whitelist test for DEX * Merge branch 'master' into masih/dex-whitelist-test --- integration-tests/modules/dex_test.go | 226 ++++++++++++++++++++++++++ 1 file changed, 226 insertions(+) diff --git a/integration-tests/modules/dex_test.go b/integration-tests/modules/dex_test.go index 83977e8d2..61ce0aea9 100644 --- a/integration-tests/modules/dex_test.go +++ b/integration-tests/modules/dex_test.go @@ -1841,6 +1841,232 @@ func TestLimitOrdersMatchingWithCommissionRate(t *testing.T) { requireT.Equal(sdkmath.NewInt(100).String(), acc2Denom1BalanceRes.Balance.Amount.String()) } +// TestLimitOrdersMatchingWithAssetFTWhitelist tests the dex modules ability to place get and match limit orders +// with asset ft with whitelisting. +func TestLimitOrdersMatchingWithAssetFTWhitelist(t *testing.T) { + t.Parallel() + ctx, chain := integrationtests.NewCoreumTestingContext(t) + + requireT := require.New(t) + bankClient := banktypes.NewQueryClient(chain.ClientContext) + assetFTClient := assetfttypes.NewQueryClient(chain.ClientContext) + dexClient := dextypes.NewQueryClient(chain.ClientContext) + + dexParamsRes, err := dexClient.Params(ctx, &dextypes.QueryParamsRequest{}) + requireT.NoError(err) + + issuer := chain.GenAccount() + chain.FundAccountWithOptions(ctx, t, issuer, integration.BalancesOptions{ + Messages: []sdk.Msg{ + &assetfttypes.MsgSetWhitelistedLimit{}, + &assetfttypes.MsgSetWhitelistedLimit{}, + &banktypes.MsgSend{}, + &assetfttypes.MsgSetWhitelistedLimit{}, + &dextypes.MsgPlaceOrder{}, + }, + Amount: dexParamsRes.Params.OrderReserve.Amount, + }) + + acc1 := chain.GenAccount() + chain.FundAccountWithOptions(ctx, t, acc1, integration.BalancesOptions{ + Messages: []sdk.Msg{ + &dextypes.MsgPlaceOrder{}, + }, + Amount: dexParamsRes.Params.OrderReserve.Amount, + }) + + acc2 := chain.GenAccount() + chain.FundAccountWithOptions(ctx, t, acc2, integration.BalancesOptions{ + Messages: []sdk.Msg{ + &dextypes.MsgPlaceOrder{}, + &dextypes.MsgPlaceOrder{}, + }, + Amount: dexParamsRes.Params.OrderReserve.Amount.MulRaw(2), + }) + + denom1 := issueFT(ctx, t, chain, issuer, sdkmath.NewIntWithDecimal(1, 6), assetfttypes.Feature_whitelisting) + denom2 := issueFT(ctx, t, chain, acc2, sdkmath.NewIntWithDecimal(1, 6)) + + // whitelist denom1 for acc1 + msgSetWhitelistedLimit := &assetfttypes.MsgSetWhitelistedLimit{ + Sender: issuer.String(), + Account: acc1.String(), + Coin: sdk.NewCoin(denom1, sdkmath.NewInt(1000000)), + } + + _, err = client.BroadcastTx( + ctx, + chain.ClientContext.WithFromAddress(issuer), + chain.TxFactory().WithGas(chain.GasLimitByMsgs(msgSetWhitelistedLimit)), + msgSetWhitelistedLimit, + ) + requireT.NoError(err) + + msgSend := &banktypes.MsgSend{ + FromAddress: issuer.String(), + ToAddress: acc1.String(), + Amount: sdk.NewCoins( + sdk.NewCoin(denom1, sdkmath.NewInt(150)), + ), + } + + _, err = client.BroadcastTx( + ctx, + chain.ClientContext.WithFromAddress(issuer), + chain.TxFactory().WithGas(chain.GasLimitByMsgs(msgSend)), + msgSend, + ) + requireT.NoError(err) + + balanceRes, err := assetFTClient.Balance(ctx, &assetfttypes.QueryBalanceRequest{ + Account: acc1.String(), + Denom: denom1, + }) + requireT.NoError(err) + requireT.Equal(sdkmath.NewInt(150).String(), balanceRes.Balance.String()) + + // place order should fail because acc2 is out of whitelisted coins + placeSellOrderMsg := &dextypes.MsgPlaceOrder{ + Sender: acc2.String(), + Type: dextypes.ORDER_TYPE_LIMIT, + ID: "id1", + BaseDenom: denom1, + QuoteDenom: denom2, + Price: lo.ToPtr(dextypes.MustNewPriceFromString("11e-2")), + Quantity: sdkmath.NewInt(300), + Side: dextypes.SIDE_BUY, + TimeInForce: dextypes.TIME_IN_FORCE_GTC, + } + + _, err = client.BroadcastTx( + ctx, + chain.ClientContext.WithFromAddress(acc2), + chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeSellOrderMsg)), + placeSellOrderMsg, + ) + requireT.ErrorContains(err, assetfttypes.ErrWhitelistedLimitExceeded.Error()) + + balanceRes, err = assetFTClient.Balance(ctx, &assetfttypes.QueryBalanceRequest{ + Account: acc2.String(), + Denom: denom1, + }) + requireT.NoError(err) + requireT.Equal(sdkmath.NewInt(0).String(), balanceRes.LockedInDEX.String()) + + msgSetWhitelistedLimit = &assetfttypes.MsgSetWhitelistedLimit{ + Sender: issuer.String(), + Account: acc2.String(), + Coin: sdk.NewCoin(denom1, sdkmath.NewInt(300)), + } + + _, err = client.BroadcastTx( + ctx, + chain.ClientContext.WithFromAddress(issuer), + chain.TxFactory().WithGas(chain.GasLimitByMsgs(msgSetWhitelistedLimit)), + msgSetWhitelistedLimit, + ) + requireT.NoError(err) + + // now placing order should succeed because the receiving amount is within the whitelist limit + placeBuyOrderMsg := &dextypes.MsgPlaceOrder{ + Sender: acc2.String(), + Type: dextypes.ORDER_TYPE_LIMIT, + ID: "id1", + BaseDenom: denom1, + QuoteDenom: denom2, + Price: lo.ToPtr(dextypes.MustNewPriceFromString("11e-2")), + Quantity: sdkmath.NewInt(300), + Side: dextypes.SIDE_BUY, + TimeInForce: dextypes.TIME_IN_FORCE_GTC, + } + + _, err = client.BroadcastTx( + ctx, + chain.ClientContext.WithFromAddress(acc2), + chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeBuyOrderMsg)), + placeBuyOrderMsg, + ) + requireT.NoError(err) + + balanceRes, err = assetFTClient.Balance(ctx, &assetfttypes.QueryBalanceRequest{ + Account: acc2.String(), + Denom: denom2, + }) + requireT.NoError(err) + requireT.Equal("33", balanceRes.LockedInDEX.String()) + + // Reducing the whitelist limit will not interfere with DEX order after order placement + msgSetWhitelistedLimit = &assetfttypes.MsgSetWhitelistedLimit{ + Sender: issuer.String(), + Account: acc2.String(), + Coin: sdk.NewCoin(denom1, sdkmath.NewInt(0)), + } + + _, err = client.BroadcastTx( + ctx, + chain.ClientContext.WithFromAddress(issuer), + chain.TxFactory().WithGas(chain.GasLimitByMsgs(msgSetWhitelistedLimit)), + msgSetWhitelistedLimit, + ) + requireT.NoError(err) + + // place sell order to match the buy + placeSellOrderMsg = &dextypes.MsgPlaceOrder{ + Sender: acc1.String(), + Type: dextypes.ORDER_TYPE_LIMIT, + ID: "id1", // same ID allowed for different user + BaseDenom: denom1, + QuoteDenom: denom2, + Price: lo.ToPtr(dextypes.MustNewPriceFromString("1e-1")), + Quantity: sdkmath.NewInt(100), + Side: dextypes.SIDE_SELL, + TimeInForce: dextypes.TIME_IN_FORCE_GTC, + } + + _, err = client.BroadcastTx( + ctx, + chain.ClientContext.WithFromAddress(acc1), + chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeSellOrderMsg)), + placeSellOrderMsg, + ) + requireT.NoError(err) + + acc1Denom2BalanceRes, err := bankClient.Balance(ctx, &banktypes.QueryBalanceRequest{ + Address: acc1.String(), + Denom: denom2, + }) + requireT.NoError(err) + requireT.Equal(sdkmath.NewInt(11).String(), acc1Denom2BalanceRes.Balance.Amount.String()) + + acc2Denom1BalanceRes, err := bankClient.Balance(ctx, &banktypes.QueryBalanceRequest{ + Address: acc2.String(), + Denom: denom1, + }) + requireT.NoError(err) + requireT.Equal(sdkmath.NewInt(100).String(), acc2Denom1BalanceRes.Balance.Amount.String()) + + // place order should succeed as issuer because admin (issuer) doesn't have whitelist limit + placeSellOrderMsg = &dextypes.MsgPlaceOrder{ + Sender: issuer.String(), + Type: dextypes.ORDER_TYPE_LIMIT, + ID: "id1", + BaseDenom: denom1, + QuoteDenom: denom2, + Price: lo.ToPtr(dextypes.MustNewPriceFromString("1e-1")), + Quantity: sdkmath.NewInt(100), + Side: dextypes.SIDE_SELL, + TimeInForce: dextypes.TIME_IN_FORCE_GTC, + } + + _, err = client.BroadcastTx( + ctx, + chain.ClientContext.WithFromAddress(issuer), + chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeSellOrderMsg)), + placeSellOrderMsg, + ) + requireT.NoError(err) +} + // TestCancelOrdersByDenom tests the dex modules ability to cancel all orders of the account and by denom. func TestCancelOrdersByDenom(t *testing.T) { t.Parallel() From daf6aeea1efa5644e33719cc4f385ff7d61db669 Mon Sep 17 00:00:00 2001 From: Dzmitry Hil Date: Mon, 4 Nov 2024 10:14:59 +0300 Subject: [PATCH 4/5] Integrate vesting accounts to the DEX fuzz test. (#1014) --- x/dex/keeper/keeper_matching_fuzz_test.go | 29 +++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/x/dex/keeper/keeper_matching_fuzz_test.go b/x/dex/keeper/keeper_matching_fuzz_test.go index 6304f178f..633962ced 100644 --- a/x/dex/keeper/keeper_matching_fuzz_test.go +++ b/x/dex/keeper/keeper_matching_fuzz_test.go @@ -12,8 +12,11 @@ import ( sdkerrors "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" "github.com/samber/lo" "github.com/stretchr/testify/require" @@ -44,7 +47,9 @@ type FuzzAppConfig struct { TimeInForceFOKPercent int GoodTilBlockHeightPercent int GoodTilBlockTimePercent int - FundOrderReservePercent int + + FundOrderReservePercent int + CreateVestingAccountPercent int InitialBlockHeight uint64 InitialBlockTime time.Time @@ -76,8 +81,8 @@ func NewFuzzApp( require.NoError(t, testApp.DEXKeeper.SetParams(sdkCtx, params)) accounts := lo.RepeatBy(cfg.AccountsCount, func(_ int) sdk.AccAddress { - acc, _ := testApp.GenAccount(sdkCtx) - return acc + // gen address but don't register it to allow the test register vesting accounts conditionally + return sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) }) issuer, _ := testApp.GenAccount(sdkCtx) @@ -337,6 +342,20 @@ func (fa *FuzzApp) FundAccountAndApplyFTFeatures( t.Logf("Whitelisting initial account's balance: %s, %s", creator.String(), whitelistBalance.String()) require.NoError(t, fa.testApp.AssetFTKeeper.SetWhitelistedBalance(sdkCtx, fa.issuer, creator, whitelistBalance)) } + if randBoolWithPercent(orderRnd, fa.cfg.CreateVestingAccountPercent) && + // acc doesn't exist so we can create vesting account + fa.testApp.AccountKeeper.GetAccount(sdkCtx, creator) == nil { + t.Logf("Creating vesting account: %s", creator.String()) + // create acc with permanently vesting locked coins + baseVestingAccount, err := vestingtypes.NewDelayedVestingAccount( + authtypes.NewBaseAccountWithAddress(creator), + sdk.NewCoins(fundCoin), + math.MaxInt64, + ) + require.NoError(t, err) + account := fa.testApp.App.AccountKeeper.NewAccount(sdkCtx, baseVestingAccount) + fa.testApp.AccountKeeper.SetAccount(sdkCtx, account) + } t.Logf("Funding account: %s, %s", creator.String(), fundCoin.String()) require.NoError(t, fa.testApp.BankKeeper.SendCoins(sdkCtx, fa.issuer, creator, sdk.NewCoins(fundCoin))) } @@ -588,7 +607,9 @@ func FuzzPlaceCancelOrder(f *testing.F) { TimeInForceFOKPercent: 4, GoodTilBlockHeightPercent: 10, GoodTilBlockTimePercent: 10, - FundOrderReservePercent: 80, + + FundOrderReservePercent: 80, + CreateVestingAccountPercent: 25, // 25% of accounts will be vesting accounts InitialBlockHeight: 1, InitialBlockTime: time.Date(2023, 1, 2, 3, 4, 5, 6, time.UTC), From c5b82a869bf2088926b93653073bdcf6dca984d7 Mon Sep 17 00:00:00 2001 From: Dzmitry Hil Date: Mon, 4 Nov 2024 12:29:29 +0300 Subject: [PATCH 5/5] Update DEX related deterministic messages gas and make the MsgPlaceOrder nondeterministic. (#1013) * Update DEX related deterministic messages gas and make the MsgPlaceOrder nondeterministic. * Use non deterministic gas for DEX IBC tests. --- build/go.mod | 2 +- build/go.sum | 4 +- integration-tests/ibc/dex_test.go | 8 +- integration-tests/modules/dex_test.go | 199 +++++++++----------------- integration-tests/stress/dex_test.go | 36 +++-- x/deterministicgas/config.go | 11 +- x/deterministicgas/config_test.go | 4 +- x/deterministicgas/spec/README.md | 6 +- x/deterministicgas/types/gas.go | 22 +-- x/dex/types/price.go | 4 +- 10 files changed, 111 insertions(+), 185 deletions(-) diff --git a/build/go.mod b/build/go.mod index af6fe3ff5..2e46f741f 100644 --- a/build/go.mod +++ b/build/go.mod @@ -28,7 +28,7 @@ replace ( require ( github.com/CoreumFoundation/coreum-tools v0.4.1-0.20240321120602-0a9c50facc68 github.com/CoreumFoundation/coreum/v5 v5.0.0-20241022051641-b49ec5faa621 - github.com/CoreumFoundation/crust v0.0.0-20241023120411-b54970b4922c + github.com/CoreumFoundation/crust v0.0.0-20241029185440-e352dde6f2b2 github.com/iancoleman/strcase v0.3.0 github.com/pkg/errors v0.9.1 github.com/samber/lo v1.39.0 diff --git a/build/go.sum b/build/go.sum index fb47bf3c4..0dfdd31d6 100644 --- a/build/go.sum +++ b/build/go.sum @@ -231,8 +231,8 @@ github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbi github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/CoreumFoundation/coreum-tools v0.4.1-0.20240321120602-0a9c50facc68 h1:Tb9avuSQW3smVGrUnDh/Y+ML4eK802UsvJNZHsBgOGg= github.com/CoreumFoundation/coreum-tools v0.4.1-0.20240321120602-0a9c50facc68/go.mod h1:VD93vCHkxYaT/RhOesXTFgd/GQDW54tr0BqGi5JU1c0= -github.com/CoreumFoundation/crust v0.0.0-20241023120411-b54970b4922c h1:vtNl0+pQ8p6rogxWD4yx+Qp4r9IK8qwyo32Qki21ltg= -github.com/CoreumFoundation/crust v0.0.0-20241023120411-b54970b4922c/go.mod h1:95ZdELt65yNef7qty4vvRBcBgkgw0L0+td2tNa/JKTM= +github.com/CoreumFoundation/crust v0.0.0-20241029185440-e352dde6f2b2 h1:YCaird/0FrYgMAajomVBJ/aClatBcorVi1vAmYNjH2w= +github.com/CoreumFoundation/crust v0.0.0-20241029185440-e352dde6f2b2/go.mod h1:95ZdELt65yNef7qty4vvRBcBgkgw0L0+td2tNa/JKTM= github.com/CosmWasm/wasmd v0.53.0 h1:kdaoAi20bIb4VCsxw9pRaT2g5PpIp82Wqrr9DRVN9ao= github.com/CosmWasm/wasmd v0.53.0/go.mod h1:FJl/aWjdpGof3usAMFQpDe07Rkx77PUzp0cygFMOvtw= github.com/CosmWasm/wasmvm/v2 v2.1.2 h1:GkJ5bAsRlLHfIQVg/FY1VHwLyBwlCjAhDea0B8L+e20= diff --git a/integration-tests/ibc/dex_test.go b/integration-tests/ibc/dex_test.go index 617177ad1..3c1076910 100644 --- a/integration-tests/ibc/dex_test.go +++ b/integration-tests/ibc/dex_test.go @@ -60,11 +60,9 @@ func TestIBCDexLimitOrdersMatching(t *testing.T) { coreumChain.FundAccountWithOptions(ctx, t, coreumSender, integration.BalancesOptions{ Messages: []sdk.Msg{ &ibctransfertypes.MsgTransfer{}, - &dextypes.MsgPlaceOrder{}, - &dextypes.MsgPlaceOrder{}, &ibctransfertypes.MsgTransfer{}, }, - Amount: dexParamsRes.Params.OrderReserve.Amount.MulRaw(2), + Amount: dexParamsRes.Params.OrderReserve.Amount.MulRaw(2).AddRaw(200_000), }) denom1 := issueFT(ctx, t, coreumChain, coreumIssuer, sdkmath.NewIntWithDecimal(1, 6), assetfttypes.Feature_ibc) @@ -115,7 +113,7 @@ func TestIBCDexLimitOrdersMatching(t *testing.T) { _, err = client.BroadcastTx( ctx, coreumChain.ClientContext.WithFromAddress(coreumSender), - coreumChain.TxFactory().WithGas(coreumChain.GasLimitByMsgs(placeSellOrderMsg)), + coreumChain.TxFactoryAuto(), placeSellOrderMsg, ) requireT.ErrorContains(err, cosmoserrors.ErrInsufficientFunds.Error()) @@ -157,7 +155,7 @@ func TestIBCDexLimitOrdersMatching(t *testing.T) { _, err = client.BroadcastTx( ctx, coreumChain.ClientContext.WithFromAddress(coreumSender), - coreumChain.TxFactory().WithGas(coreumChain.GasLimitByMsgs(placeSellOrderMsg)), + coreumChain.TxFactoryAuto(), placeSellOrderMsg, ) requireT.NoError(err) diff --git a/integration-tests/modules/dex_test.go b/integration-tests/modules/dex_test.go index 61ce0aea9..982066786 100644 --- a/integration-tests/modules/dex_test.go +++ b/integration-tests/modules/dex_test.go @@ -45,18 +45,12 @@ func TestLimitOrdersMatching(t *testing.T) { acc1 := chain.GenAccount() chain.FundAccountWithOptions(ctx, t, acc1, integration.BalancesOptions{ - Messages: []sdk.Msg{ - &dextypes.MsgPlaceOrder{}, - }, - Amount: dexParamsRes.Params.OrderReserve.Amount, + Amount: dexParamsRes.Params.OrderReserve.Amount.Add(sdkmath.NewInt(100_000)), }) acc2 := chain.GenAccount() chain.FundAccountWithOptions(ctx, t, acc2, integration.BalancesOptions{ - Messages: []sdk.Msg{ - &dextypes.MsgPlaceOrder{}, - }, - Amount: dexParamsRes.Params.OrderReserve.Amount, + Amount: dexParamsRes.Params.OrderReserve.Amount.Add(sdkmath.NewInt(100_000)), }) denom1 := issueFT(ctx, t, chain, acc1, sdkmath.NewIntWithDecimal(1, 6)) @@ -74,15 +68,13 @@ func TestLimitOrdersMatching(t *testing.T) { TimeInForce: dextypes.TIME_IN_FORCE_GTC, } - txResult, err := client.BroadcastTx( + _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc1), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeSellOrderMsg)), + chain.TxFactoryAuto(), placeSellOrderMsg, ) requireT.NoError(err) - // validate the deterministic gas - requireT.Equal(chain.GasLimitByMsgs(placeSellOrderMsg), uint64(txResult.GasUsed)) sellOrderRes, err := dexClient.Order(ctx, &dextypes.QueryOrderRequest{ Creator: placeSellOrderMsg.Sender, @@ -121,7 +113,7 @@ func TestLimitOrdersMatching(t *testing.T) { _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc2), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeBuyOrderMsg)), + chain.TxFactoryAuto(), placeBuyOrderMsg, ) requireT.NoError(err) @@ -185,18 +177,12 @@ func TestMarketOrdersMatching(t *testing.T) { acc1 := chain.GenAccount() chain.FundAccountWithOptions(ctx, t, acc1, integration.BalancesOptions{ - Messages: []sdk.Msg{ - &dextypes.MsgPlaceOrder{}, - }, - Amount: dexParamsRes.Params.OrderReserve.Amount, + Amount: dexParamsRes.Params.OrderReserve.Amount.Add(sdkmath.NewInt(100_000)), }) acc2 := chain.GenAccount() chain.FundAccountWithOptions(ctx, t, acc2, integration.BalancesOptions{ - Messages: []sdk.Msg{ - &dextypes.MsgPlaceOrder{}, - }, - Amount: dexParamsRes.Params.OrderReserve.Amount, + Amount: dexParamsRes.Params.OrderReserve.Amount.Add(sdkmath.NewInt(100_000)), }) denom1 := issueFT(ctx, t, chain, acc1, sdkmath.NewIntWithDecimal(1, 6)) @@ -217,7 +203,7 @@ func TestMarketOrdersMatching(t *testing.T) { _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc1), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeSellOrderMsg)), + chain.TxFactoryAuto(), placeSellOrderMsg, ) requireT.NoError(err) @@ -236,7 +222,7 @@ func TestMarketOrdersMatching(t *testing.T) { _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc2), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeBuyOrderMsg)), + chain.TxFactoryAuto(), placeBuyOrderMsg, ) requireT.NoError(err) @@ -246,12 +232,12 @@ func TestMarketOrdersMatching(t *testing.T) { }) requireT.NoError(err) requireT.Equal( - sdk.NewCoins( - sdk.NewCoin(denom1, sdkmath.NewInt(999900)), - sdk.NewCoin(denom2, sdkmath.NewInt(10)), - dexParamsRes.Params.OrderReserve, - ).String(), - acc1BalancesRes.Balances.String(), + sdkmath.NewInt(999900).String(), + acc1BalancesRes.Balances.AmountOf(denom1).String(), + ) + requireT.Equal( + sdkmath.NewInt(10).String(), + acc1BalancesRes.Balances.AmountOf(denom2).String(), ) acc2BalancesRes, err := bankClient.AllBalances(ctx, &banktypes.QueryAllBalancesRequest{ @@ -259,12 +245,12 @@ func TestMarketOrdersMatching(t *testing.T) { }) requireT.NoError(err) requireT.Equal( - sdk.NewCoins( - sdk.NewCoin(denom1, sdkmath.NewInt(100)), - sdk.NewCoin(denom2, sdkmath.NewInt(999990)), - dexParamsRes.Params.OrderReserve, - ).String(), - acc2BalancesRes.Balances.String(), + sdkmath.NewInt(100).String(), + acc2BalancesRes.Balances.AmountOf(denom1).String(), + ) + requireT.Equal( + sdkmath.NewInt(999990).String(), + acc2BalancesRes.Balances.AmountOf(denom2).String(), ) } @@ -291,10 +277,9 @@ func TestOrderCancellation(t *testing.T) { acc1 := chain.GenAccount() chain.FundAccountWithOptions(ctx, t, acc1, integration.BalancesOptions{ Messages: []sdk.Msg{ - &dextypes.MsgPlaceOrder{}, &dextypes.MsgCancelOrder{}, }, - Amount: dexParamsRes.Params.OrderReserve.Amount, + Amount: dexParamsRes.Params.OrderReserve.Amount.Add(sdkmath.NewInt(100_000)), }) denom1 := issueFT(ctx, t, chain, issuer, sdkmath.NewIntWithDecimal(1, 6)) @@ -343,7 +328,7 @@ func TestOrderCancellation(t *testing.T) { _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc1), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeSellOrderMsg)), + chain.TxFactoryAuto(), placeSellOrderMsg, ) requireT.NoError(err) @@ -449,10 +434,7 @@ func TestOrderTilBlockHeight(t *testing.T) { acc1 := chain.GenAccount() chain.FundAccountWithOptions(ctx, t, acc1, integration.BalancesOptions{ - Messages: []sdk.Msg{ - &dextypes.MsgPlaceOrder{}, - }, - Amount: dexParamsRes.Params.OrderReserve.Amount, + Amount: dexParamsRes.Params.OrderReserve.Amount.Add(sdkmath.NewInt(100_000)), }) denom1 := issueFT(ctx, t, chain, acc1, sdkmath.NewIntWithDecimal(1, 6)) @@ -478,7 +460,7 @@ func TestOrderTilBlockHeight(t *testing.T) { _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc1), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeSellOrderMsg)), + chain.TxFactoryAuto(), placeSellOrderMsg, ) requireT.NoError(err) @@ -522,10 +504,7 @@ func TestOrderTilBlockTime(t *testing.T) { acc1 := chain.GenAccount() chain.FundAccountWithOptions(ctx, t, acc1, integration.BalancesOptions{ - Messages: []sdk.Msg{ - &dextypes.MsgPlaceOrder{}, - }, - Amount: dexParamsRes.Params.OrderReserve.Amount, + Amount: dexParamsRes.Params.OrderReserve.Amount.Add(sdkmath.NewInt(100_000)), }) denom1 := issueFT(ctx, t, chain, acc1, sdkmath.NewIntWithDecimal(1, 6)) @@ -551,7 +530,7 @@ func TestOrderTilBlockTime(t *testing.T) { _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc1), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeSellOrderMsg)), + chain.TxFactoryAuto(), placeSellOrderMsg, ) requireT.NoError(err) @@ -623,13 +602,12 @@ func TestOrderBooksAndOrdersQueries(t *testing.T) { } acc1OrderPlaceMsgs := ordersToPlaceMsgs(acc1Orders) chain.FundAccountWithOptions(ctx, t, acc1, integration.BalancesOptions{ - Messages: acc1OrderPlaceMsgs, - Amount: dexParamsRes.Params.OrderReserve.Amount, + Amount: dexParamsRes.Params.OrderReserve.Amount.Add(sdkmath.NewInt(100_000)), }) _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc1), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(acc1OrderPlaceMsgs...)), + chain.TxFactoryAuto(), acc1OrderPlaceMsgs..., ) requireT.NoError(err) @@ -670,13 +648,12 @@ func TestOrderBooksAndOrdersQueries(t *testing.T) { } acc2OrderPlaceMsgs := ordersToPlaceMsgs(acc2Orders) chain.FundAccountWithOptions(ctx, t, acc2, integration.BalancesOptions{ - Messages: acc2OrderPlaceMsgs, - Amount: dexParamsRes.Params.OrderReserve.Amount.MulRaw(int64(len(acc2OrderPlaceMsgs))), + Amount: dexParamsRes.Params.OrderReserve.Amount.MulRaw(int64(len(acc2OrderPlaceMsgs))).AddRaw(100_000), }) _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc2), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(acc2OrderPlaceMsgs...)), + chain.TxFactoryAuto(), acc2OrderPlaceMsgs..., ) requireT.NoError(err) @@ -795,19 +772,12 @@ func TestLimitOrdersMatchingWithAssetFTFreeze(t *testing.T) { acc1 := chain.GenAccount() chain.FundAccountWithOptions(ctx, t, acc1, integration.BalancesOptions{ - Messages: []sdk.Msg{ - &dextypes.MsgPlaceOrder{}, - &dextypes.MsgPlaceOrder{}, - }, - Amount: dexParamsRes.Params.OrderReserve.Amount.MulRaw(2), + Amount: dexParamsRes.Params.OrderReserve.Amount.MulRaw(2).Add(sdkmath.NewInt(100_000).MulRaw(2)), }) acc2 := chain.GenAccount() chain.FundAccountWithOptions(ctx, t, acc2, integration.BalancesOptions{ - Messages: []sdk.Msg{ - &dextypes.MsgPlaceOrder{}, - }, - Amount: dexParamsRes.Params.OrderReserve.Amount, + Amount: dexParamsRes.Params.OrderReserve.Amount.Add(sdkmath.NewInt(100_000)), }) denom1 := issueFT(ctx, t, chain, issuer, sdkmath.NewIntWithDecimal(1, 6), assetfttypes.Feature_freezing) @@ -866,7 +836,7 @@ func TestLimitOrdersMatchingWithAssetFTFreeze(t *testing.T) { _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc1), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeSellOrderMsg)), + chain.TxFactoryAuto(), placeSellOrderMsg, ) requireT.ErrorContains(err, assetfttypes.ErrDEXLockFailed.Error()) @@ -916,7 +886,7 @@ func TestLimitOrdersMatchingWithAssetFTFreeze(t *testing.T) { _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc1), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeSellOrderMsg)), + chain.TxFactoryAuto(), placeSellOrderMsg, ) requireT.NoError(err) @@ -968,7 +938,7 @@ func TestLimitOrdersMatchingWithAssetFTFreeze(t *testing.T) { _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc2), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeBuyOrderMsg)), + chain.TxFactoryAuto(), placeBuyOrderMsg, ) requireT.NoError(err) @@ -1014,19 +984,12 @@ func TestLimitOrdersMatchingWithAssetFTGloballyFreeze(t *testing.T) { acc1 := chain.GenAccount() chain.FundAccountWithOptions(ctx, t, acc1, integration.BalancesOptions{ - Messages: []sdk.Msg{ - &dextypes.MsgPlaceOrder{}, - &dextypes.MsgPlaceOrder{}, - }, - Amount: dexParamsRes.Params.OrderReserve.Amount.MulRaw(2), + Amount: dexParamsRes.Params.OrderReserve.Amount.MulRaw(2).Add(sdkmath.NewInt(100_000).MulRaw(2)), }) acc2 := chain.GenAccount() chain.FundAccountWithOptions(ctx, t, acc2, integration.BalancesOptions{ - Messages: []sdk.Msg{ - &dextypes.MsgPlaceOrder{}, - }, - Amount: dexParamsRes.Params.OrderReserve.Amount, + Amount: dexParamsRes.Params.OrderReserve.Amount.Add(sdkmath.NewInt(100_000)), }) denom1 := issueFT(ctx, t, chain, issuer, sdkmath.NewIntWithDecimal(1, 6), assetfttypes.Feature_freezing) @@ -1084,7 +1047,7 @@ func TestLimitOrdersMatchingWithAssetFTGloballyFreeze(t *testing.T) { _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc1), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeSellOrderMsg)), + chain.TxFactoryAuto(), placeSellOrderMsg, ) requireT.ErrorContains(err, assetfttypes.ErrDEXLockFailed.Error()) @@ -1133,7 +1096,7 @@ func TestLimitOrdersMatchingWithAssetFTGloballyFreeze(t *testing.T) { _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc1), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeSellOrderMsg)), + chain.TxFactoryAuto(), placeSellOrderMsg, ) requireT.NoError(err) @@ -1184,7 +1147,7 @@ func TestLimitOrdersMatchingWithAssetFTGloballyFreeze(t *testing.T) { _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc2), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeBuyOrderMsg)), + chain.TxFactoryAuto(), placeBuyOrderMsg, ) requireT.NoError(err) @@ -1231,11 +1194,9 @@ func TestLimitOrdersMatchingWithAssetClawback(t *testing.T) { acc1 := chain.GenAccount() chain.FundAccountWithOptions(ctx, t, acc1, integration.BalancesOptions{ Messages: []sdk.Msg{ - &dextypes.MsgPlaceOrder{}, - &dextypes.MsgPlaceOrder{}, &dextypes.MsgCancelOrder{}, }, - Amount: dexParamsRes.Params.OrderReserve.Amount.MulRaw(2), + Amount: dexParamsRes.Params.OrderReserve.Amount.MulRaw(2).Add(sdkmath.NewInt(100_000).MulRaw(2)), }) denom1 := issueFT(ctx, t, chain, issuer, sdkmath.NewIntWithDecimal(1, 6), assetfttypes.Feature_clawback) @@ -1294,7 +1255,7 @@ func TestLimitOrdersMatchingWithAssetClawback(t *testing.T) { _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc1), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeSellOrderMsg)), + chain.TxFactoryAuto(), placeSellOrderMsg, ) requireT.ErrorContains(err, cosmoserrors.ErrInsufficientFunds.Error()) @@ -1346,7 +1307,7 @@ func TestLimitOrdersMatchingWithAssetClawback(t *testing.T) { _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc1), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeSellOrderMsg)), + chain.TxFactoryAuto(), placeSellOrderMsg, ) requireT.NoError(err) @@ -1441,15 +1402,14 @@ func TestLimitOrdersMatchingWithStaking(t *testing.T) { customStakingParams, err := customParamsClient.StakingParams(ctx, &customparamstypes.QueryStakingParamsRequest{}) require.NoError(t, err) - delegateAmount := sdkmath.NewInt(1000) + delegateAmount := sdkmath.NewInt(1_000_000) acc := chain.GenAccount() chain.FundAccountWithOptions(ctx, t, acc, integration.BalancesOptions{ Messages: []sdk.Msg{ &stakingtypes.MsgDelegate{}, - &dextypes.MsgPlaceOrder{}, }, - Amount: delegateAmount.Add(dexParamsRes.Params.OrderReserve.Amount), + Amount: delegateAmount.Add(dexParamsRes.Params.OrderReserve.Amount).Add(sdkmath.NewInt(100_000)), }) denomToStake := chain.ChainSettings.Denom @@ -1497,22 +1457,19 @@ func TestLimitOrdersMatchingWithStaking(t *testing.T) { _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeSellOrderMsg)), + chain.TxFactoryAuto(), placeSellOrderMsg, ) requireT.ErrorContains(err, assetfttypes.ErrDEXLockFailed.Error()) chain.FundAccountWithOptions(ctx, t, acc, integration.BalancesOptions{ - Messages: []sdk.Msg{ - &dextypes.MsgPlaceOrder{}, // fund one more time since we paid for the failed message - }, - Amount: delegateAmount, + Amount: delegateAmount.Add(sdkmath.NewInt(100_000)), }) _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeSellOrderMsg)), + chain.TxFactoryAuto(), placeSellOrderMsg, ) requireT.NoError(err) @@ -1522,9 +1479,8 @@ func TestLimitOrdersMatchingWithStaking(t *testing.T) { Denom: denomToStake, }) requireT.NoError(err) - requireT.Equal( - delegateAmount.Add(dexParamsRes.Params.OrderReserve.Amount).String(), - balanceRes.Balance.String(), + requireT.True( + delegateAmount.Add(dexParamsRes.Params.OrderReserve.Amount).LTE(balanceRes.Balance), ) requireT.Equal( delegateAmount.Add(dexParamsRes.Params.OrderReserve.Amount).String(), @@ -1547,18 +1503,12 @@ func TestLimitOrdersMatchingWithBurnRate(t *testing.T) { acc1 := chain.GenAccount() chain.FundAccountWithOptions(ctx, t, acc1, integration.BalancesOptions{ - Messages: []sdk.Msg{ - &dextypes.MsgPlaceOrder{}, - }, - Amount: dexParamsRes.Params.OrderReserve.Amount, + Amount: dexParamsRes.Params.OrderReserve.Amount.Add(sdkmath.NewInt(100_000)), }) acc2 := chain.GenAccount() chain.FundAccountWithOptions(ctx, t, acc2, integration.BalancesOptions{ - Messages: []sdk.Msg{ - &dextypes.MsgPlaceOrder{}, - }, - Amount: dexParamsRes.Params.OrderReserve.Amount, + Amount: dexParamsRes.Params.OrderReserve.Amount.Add(sdkmath.NewInt(100_000)), }) chain.FundAccountWithOptions(ctx, t, acc1, integration.BalancesOptions{ @@ -1608,7 +1558,7 @@ func TestLimitOrdersMatchingWithBurnRate(t *testing.T) { _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc1), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeSellOrderMsg)), + chain.TxFactoryAuto(), placeSellOrderMsg, ) requireT.NoError(err) @@ -1658,7 +1608,7 @@ func TestLimitOrdersMatchingWithBurnRate(t *testing.T) { _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc2), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeBuyOrderMsg)), + chain.TxFactoryAuto(), placeBuyOrderMsg, ) requireT.NoError(err) @@ -1702,18 +1652,12 @@ func TestLimitOrdersMatchingWithCommissionRate(t *testing.T) { acc1 := chain.GenAccount() chain.FundAccountWithOptions(ctx, t, acc1, integration.BalancesOptions{ - Messages: []sdk.Msg{ - &dextypes.MsgPlaceOrder{}, - }, - Amount: dexParamsRes.Params.OrderReserve.Amount, + Amount: dexParamsRes.Params.OrderReserve.Amount.Add(sdkmath.NewInt(100_000)), }) acc2 := chain.GenAccount() chain.FundAccountWithOptions(ctx, t, acc2, integration.BalancesOptions{ - Messages: []sdk.Msg{ - &dextypes.MsgPlaceOrder{}, - }, - Amount: dexParamsRes.Params.OrderReserve.Amount, + Amount: dexParamsRes.Params.OrderReserve.Amount.Add(sdkmath.NewInt(100_000)), }) chain.FundAccountWithOptions(ctx, t, acc1, integration.BalancesOptions{ @@ -1763,7 +1707,7 @@ func TestLimitOrdersMatchingWithCommissionRate(t *testing.T) { _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc1), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeSellOrderMsg)), + chain.TxFactoryAuto(), placeSellOrderMsg, ) requireT.NoError(err) @@ -1813,7 +1757,7 @@ func TestLimitOrdersMatchingWithCommissionRate(t *testing.T) { _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc2), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeBuyOrderMsg)), + chain.TxFactoryAuto(), placeBuyOrderMsg, ) requireT.NoError(err) @@ -1862,26 +1806,18 @@ func TestLimitOrdersMatchingWithAssetFTWhitelist(t *testing.T) { &assetfttypes.MsgSetWhitelistedLimit{}, &banktypes.MsgSend{}, &assetfttypes.MsgSetWhitelistedLimit{}, - &dextypes.MsgPlaceOrder{}, }, - Amount: dexParamsRes.Params.OrderReserve.Amount, + Amount: dexParamsRes.Params.OrderReserve.Amount.Add(sdkmath.NewInt(100_000)), }) acc1 := chain.GenAccount() chain.FundAccountWithOptions(ctx, t, acc1, integration.BalancesOptions{ - Messages: []sdk.Msg{ - &dextypes.MsgPlaceOrder{}, - }, - Amount: dexParamsRes.Params.OrderReserve.Amount, + Amount: dexParamsRes.Params.OrderReserve.Amount.Add(sdkmath.NewInt(100_000)), }) acc2 := chain.GenAccount() chain.FundAccountWithOptions(ctx, t, acc2, integration.BalancesOptions{ - Messages: []sdk.Msg{ - &dextypes.MsgPlaceOrder{}, - &dextypes.MsgPlaceOrder{}, - }, - Amount: dexParamsRes.Params.OrderReserve.Amount.MulRaw(2), + Amount: dexParamsRes.Params.OrderReserve.Amount.MulRaw(2).Add(sdkmath.NewInt(100_000).MulRaw(2)), }) denom1 := issueFT(ctx, t, chain, issuer, sdkmath.NewIntWithDecimal(1, 6), assetfttypes.Feature_whitelisting) @@ -1941,7 +1877,7 @@ func TestLimitOrdersMatchingWithAssetFTWhitelist(t *testing.T) { _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc2), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeSellOrderMsg)), + chain.TxFactoryAuto(), placeSellOrderMsg, ) requireT.ErrorContains(err, assetfttypes.ErrWhitelistedLimitExceeded.Error()) @@ -1983,7 +1919,7 @@ func TestLimitOrdersMatchingWithAssetFTWhitelist(t *testing.T) { _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc2), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeBuyOrderMsg)), + chain.TxFactoryAuto(), placeBuyOrderMsg, ) requireT.NoError(err) @@ -2026,7 +1962,7 @@ func TestLimitOrdersMatchingWithAssetFTWhitelist(t *testing.T) { _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc1), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeSellOrderMsg)), + chain.TxFactoryAuto(), placeSellOrderMsg, ) requireT.NoError(err) @@ -2061,7 +1997,7 @@ func TestLimitOrdersMatchingWithAssetFTWhitelist(t *testing.T) { _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(issuer), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeSellOrderMsg)), + chain.TxFactoryAuto(), placeSellOrderMsg, ) requireT.NoError(err) @@ -2117,8 +2053,7 @@ func TestCancelOrdersByDenom(t *testing.T) { } }) chain.FundAccountWithOptions(ctx, t, acc1, integration.BalancesOptions{ - Messages: placeMsgs, - Amount: dexParamsRes.Params.OrderReserve.Amount.MulRaw(int64(len(placeMsgs))), + Amount: dexParamsRes.Params.OrderReserve.Amount.MulRaw(int64(len(placeMsgs))).AddRaw(100_000 * int64(ordersCount)), }) // send required tokens to acc1 diff --git a/integration-tests/stress/dex_test.go b/integration-tests/stress/dex_test.go index 3971b2a0d..8d6e57924 100644 --- a/integration-tests/stress/dex_test.go +++ b/integration-tests/stress/dex_test.go @@ -5,7 +5,6 @@ import ( "time" sdkmath "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/samber/lo" @@ -13,9 +12,7 @@ import ( integrationtests "github.com/CoreumFoundation/coreum/v5/integration-tests" "github.com/CoreumFoundation/coreum/v5/pkg/client" - "github.com/CoreumFoundation/coreum/v5/testutil/event" "github.com/CoreumFoundation/coreum/v5/testutil/integration" - deterministicgastypes "github.com/CoreumFoundation/coreum/v5/x/deterministicgas/types" dextypes "github.com/CoreumFoundation/coreum/v5/x/dex/types" ) @@ -27,6 +24,7 @@ func TestLimitOrdersStressMatching(t *testing.T) { preCreatedOrdersCreator := "devcore1fnrehr95flfgnzjcatv7a8hpernwufpd5zjm2v" baseDenom := "dexsu-" + preCreatedOrdersCreator // created VIA the genesis quoteDenom := chain.ChainSettings.Denom + ordersCount := 2_000 requireT := require.New(t) dexClient := dextypes.NewQueryClient(chain.ClientContext) @@ -41,7 +39,7 @@ func TestLimitOrdersStressMatching(t *testing.T) { }, }) requireT.NoError(err) - requireT.Len(creatorOrdersRes.Orders, 10_000) + requireT.Len(creatorOrdersRes.Orders, ordersCount) sellTotal := sdkmath.ZeroInt() for _, order := range creatorOrdersRes.Orders { @@ -59,10 +57,8 @@ func TestLimitOrdersStressMatching(t *testing.T) { acc1 := chain.GenAccount() buyTotal := sellTotal + chain.FundAccountWithOptions(ctx, t, acc1, integration.BalancesOptions{ - Messages: []sdk.Msg{ - &dextypes.MsgPlaceOrder{}, - }, Amount: dexParamsRes.Params.OrderReserve.Amount.Add(buyTotal), }) @@ -84,12 +80,28 @@ func TestLimitOrdersStressMatching(t *testing.T) { Side: dextypes.SIDE_BUY, TimeInForce: dextypes.TIME_IN_FORCE_GTC, } + + _, requiredGas, err := client.CalculateGas( + ctx, + chain.ClientContext.WithFromAddress(acc1), + chain.TxFactory(), + placeOrderMsg, + ) + requireT.NoError(err) + t.Logf("Estimated gas: %d", requiredGas) + usedGas := uint64(float64(requiredGas) * 1.05) + t.Logf("Used gas: %d", usedGas) + + chain.FundAccountWithOptions(ctx, t, acc1, integration.BalancesOptions{ + NondeterministicMessagesGas: usedGas, + }) + t.Logf("Placing order to match %d orders", len(creatorOrdersRes.Orders)) now := time.Now() - txRes, err := client.BroadcastTx( + _, err = client.BroadcastTx( ctx, chain.ClientContext.WithFromAddress(acc1), - chain.TxFactory().WithGas(chain.GasLimitByMsgs(placeOrderMsg)), + chain.TxFactory().WithGas(usedGas), placeOrderMsg, ) requireT.NoError(err) @@ -112,10 +124,4 @@ func TestLimitOrdersStressMatching(t *testing.T) { }) requireT.NoError(err) requireT.Equal(buyTotal.String(), baseDenomBalanceRes.Balance.Amount.String()) - - gasEvts, err := event.FindTypedEvents[*deterministicgastypes.EventGas](txRes.Events) - requireT.NoError(err) - requireT.Len(gasEvts, 1) - - t.Logf("RealGas: %d, deterministicGas: %d", gasEvts[0].RealGas, gasEvts[0].DeterministicGas) } diff --git a/x/deterministicgas/config.go b/x/deterministicgas/config.go index bfd3fd404..90004c42c 100644 --- a/x/deterministicgas/config.go +++ b/x/deterministicgas/config.go @@ -47,7 +47,7 @@ const ( NFTMintBaseGas = 39_000 NFTUpdateBaseGas = 40_000 GrantBaseGas = 25000 - DEXUpdateWhitelistedDenomBaseGas = 50_000 + DEXUpdateWhitelistedDenomBaseGas = 10_000 DEXWhitelistedPerDenomGas = 10_000 ) @@ -97,7 +97,7 @@ func DefaultConfig() Config { // TODO(v5): Once we add a new token upgrade MsgUpgradeTokenV2 we should remove this one and re-estimate gas. MsgToMsgURL(&assetfttypes.MsgUpgradeTokenV1{}): constantGasFunc(25_000), MsgToMsgURL(&assetfttypes.MsgUpdateDEXUnifiedRefAmount{}): constantGasFunc(10_000), - MsgToMsgURL(&assetfttypes.MsgUpdateDEXWhitelistedDenoms{}): bankUpdateDEXWhitelistedDenomsGasFunc( + MsgToMsgURL(&assetfttypes.MsgUpdateDEXWhitelistedDenoms{}): updateDEXWhitelistedDenomsGasFunc( DEXUpdateWhitelistedDenomBaseGas, DEXWhitelistedPerDenomGas, ), @@ -116,9 +116,7 @@ func DefaultConfig() Config { MsgToMsgURL(&assetnfttypes.MsgRemoveFromClassWhitelist{}): constantGasFunc(3_500), // dex - // TODO (dex): update with new values once we finish the DEX - MsgToMsgURL(&dextypes.MsgPlaceOrder{}): constantGasFunc(120_000), - MsgToMsgURL(&dextypes.MsgCancelOrder{}): constantGasFunc(15_000), + MsgToMsgURL(&dextypes.MsgCancelOrder{}): constantGasFunc(35_000), // authz MsgToMsgURL(&authz.MsgGrant{}): authzMsgGrantGasFunc(GrantBaseGas, storeConfig.WriteCostPerByte), @@ -237,6 +235,7 @@ func DefaultConfig() Config { // dex &dextypes.MsgUpdateParams{}, + &dextypes.MsgPlaceOrder{}, &dextypes.MsgCancelOrdersByDenom{}, // distribution @@ -490,7 +489,7 @@ func bankMultiSendMsgGasFunc(bankMultiSendPerOperationGas uint64) gasByMsgFunc { } } -func bankUpdateDEXWhitelistedDenomsGasFunc( +func updateDEXWhitelistedDenomsGasFunc( dexUpdateWhitelistedDenomBaseGas, dexWhitelistedPerDenomGas uint64, ) gasByMsgFunc { diff --git a/x/deterministicgas/config_test.go b/x/deterministicgas/config_test.go index 9ebc06d2e..90177fd74 100644 --- a/x/deterministicgas/config_test.go +++ b/x/deterministicgas/config_test.go @@ -107,8 +107,8 @@ func TestDeterministicGas_DeterministicMessages(t *testing.T) { // To make sure we do not increase/decrease deterministic and extension types accidentally, // we assert length to be equal to exact number, so each change requires // explicit adjustment of tests. - assert.Equal(t, 83, nondeterministicMsgCount) - assert.Equal(t, 71, deterministicMsgCount) + assert.Equal(t, 84, nondeterministicMsgCount) + assert.Equal(t, 70, deterministicMsgCount) assert.Equal(t, 14, extensionMsgCount) assert.Equal(t, 140, nonExtensionMsgCount) } diff --git a/x/deterministicgas/spec/README.md b/x/deterministicgas/spec/README.md index ca332016e..aa6dc8827 100644 --- a/x/deterministicgas/spec/README.md +++ b/x/deterministicgas/spec/README.md @@ -118,8 +118,7 @@ It should also be mentioned that this rule applies for all the messages inside ` | `/coreum.asset.nft.v1.MsgRemoveFromClassWhitelist` | 3500 | | `/coreum.asset.nft.v1.MsgRemoveFromWhitelist` | 3500 | | `/coreum.asset.nft.v1.MsgUnfreeze` | 5000 | -| `/coreum.dex.v1.MsgCancelOrder` | 15000 | -| `/coreum.dex.v1.MsgPlaceOrder` | 120000 | +| `/coreum.dex.v1.MsgCancelOrder` | 35000 | | `/cosmos.authz.v1beta1.MsgRevoke` | 8000 | | `/cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPool` | 39000 | | `/cosmos.distribution.v1beta1.MsgFundCommunityPool` | 17000 | @@ -207,7 +206,7 @@ and the formula for them is `DeterministicGasForMsg = DEXUpdateWhitelistedDenomBaseGas + DEXWhitelistedPerDenomGas * NumberOfDenom` `DEXWhitelistedPerDenomGas` is currently equal to `10000`. -`DEXUpdateWhitelistedDenomBaseGas` is currently equal to `50000`. +`DEXUpdateWhitelistedDenomBaseGas` is currently equal to `10000`. ### Nondeterministic messages @@ -217,6 +216,7 @@ and the formula for them is | `/coreum.asset.nft.v1.MsgUpdateParams` | | `/coreum.customparams.v1.MsgUpdateStakingParams` | | `/coreum.dex.v1.MsgCancelOrdersByDenom` | +| `/coreum.dex.v1.MsgPlaceOrder` | | `/coreum.dex.v1.MsgUpdateParams` | | `/coreum.feemodel.v1.MsgUpdateParams` | | `/cosmos.auth.v1beta1.MsgUpdateParams` | diff --git a/x/deterministicgas/types/gas.go b/x/deterministicgas/types/gas.go index ea4ac33c7..99da562e4 100644 --- a/x/deterministicgas/types/gas.go +++ b/x/deterministicgas/types/gas.go @@ -23,15 +23,13 @@ import ( testutilconstant "github.com/CoreumFoundation/coreum/v5/testutil/constant" assetfttypes "github.com/CoreumFoundation/coreum/v5/x/asset/ft/types" "github.com/CoreumFoundation/coreum/v5/x/deterministicgas" - dextypes "github.com/CoreumFoundation/coreum/v5/x/dex/types" ) const ( - defaultFuseGasMultiplier = uint64(10) - dexOrderPlacementFuseGasMultiplier = uint64(5_000) - simFuseGasMultiplier = 1000 - expectedMaxGasFactor = 5 - untrackedMaxGasForQueries = uint64(5_000) + fuseGasMultiplier = 10 + simFuseGasMultiplier = 1000 + expectedMaxGasFactor = 5 + untrackedMaxGasForQueries = uint64(5_000) ) // NewDeterministicMsgServer returns wrapped message server charging deterministic amount of gas for @@ -169,15 +167,7 @@ func (s deterministicMsgServer) ctxForDeterministicGas( // We pass much higher amount of gas to handler to be sure that it succeeds. // We want to avoid passing infinite gas meter to always have a limit in case of mistake. - var gasMultiplier uint64 - // use custom fuse gas multiplier for some messages - switch msg.(type) { - case *dextypes.MsgPlaceOrder: - gasMultiplier = dexOrderPlacementFuseGasMultiplier - default: - gasMultiplier = defaultFuseGasMultiplier - } - + gasMultiplier := uint64(fuseGasMultiplier) if ctx.ChainID() == testutilconstant.SimAppChainID { // simulation fuse gas multiplier is different since during the simulation the modules uses the assetft denom // for the cases which are possible for the simulation only and require more gas @@ -254,7 +244,7 @@ func hasExtensionCall(ctx sdk.Context, msg sdk.Msg, assetFTKeeper AssetFTKeeper) for _, coin := range coins { // we should not count the used for this query, otherwise it will mess up the gas // requirements of the message with deterministic gas. - ctxWithUntrackedGas := ctx.WithGasMeter(storetypes.NewGasMeter(defaultFuseGasMultiplier * untrackedMaxGasForQueries)) + ctxWithUntrackedGas := ctx.WithGasMeter(storetypes.NewGasMeter(fuseGasMultiplier * untrackedMaxGasForQueries)) def, err := assetFTKeeper.GetDefinition(ctxWithUntrackedGas, coin.Denom) if assetfttypes.ErrInvalidDenom.Is(err) || assetfttypes.ErrTokenNotFound.Is(err) { // if the token is not defined in asset ft module, we assume this is different diff --git a/x/dex/types/price.go b/x/dex/types/price.go index e3298bcfc..ac08c125c 100644 --- a/x/dex/types/price.go +++ b/x/dex/types/price.go @@ -35,9 +35,7 @@ const ( orderedBytesPriceSize = store.Int8OrderedBytesSize + store.Uint64OrderedBytesSize ) -var ( - priceRegex = regexp.MustCompile(`^(([1-9])|([1-9]\d*[1-9]))(e-?[1-9]\d*)?$`) -) +var priceRegex = regexp.MustCompile(`^(([1-9])|([1-9]\d*[1-9]))(e-?[1-9]\d*)?$`) // Price is the price type. type Price struct {