Skip to content

Commit

Permalink
Test DEX messages and queries in wasm (#1012)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
masihyeganeh authored Oct 29, 2024
1 parent daf0635 commit 11a451e
Show file tree
Hide file tree
Showing 44 changed files with 2,658 additions and 757 deletions.
2 changes: 1 addition & 1 deletion build/coreum/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
3 changes: 3 additions & 0 deletions build/coreum/generate-proto-breaking.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//nolint:unused
package coreum

import (
Expand All @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |



Expand Down Expand Up @@ -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 |

<!-- end services -->
Expand Down
4 changes: 2 additions & 2 deletions docs/static/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@
},
"/coreum/dex/v1/order-books/{base_denom}/{quote_denom}/orders": {
"get": {
"operationId": "GithubComCoreumFoundationCoreumV5XDexTypesOrdersBookOrders",
"operationId": "GithubComCoreumFoundationCoreumV5XDexTypesOrderBookOrders",
"parameters": [
{
"name": "base_denom",
Expand Down Expand Up @@ -1221,7 +1221,7 @@
}
}
},
"summary": "OrdersBookOrders queries order book orders.",
"summary": "OrderBookOrders queries order book orders.",
"tags": [
"Query"
]
Expand Down
71 changes: 20 additions & 51 deletions integration-tests/contracts/modules/authz-nft-trade/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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"
69 changes: 19 additions & 50 deletions integration-tests/contracts/modules/authz-stargate/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Loading

0 comments on commit 11a451e

Please sign in to comment.