Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Wasm asset NFT / native NFT integration #428

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ import (
assetft "github.com/CoreumFoundation/coreum/x/asset/ft"
assetftkeeper "github.com/CoreumFoundation/coreum/x/asset/ft/keeper"
assetfttypes "github.com/CoreumFoundation/coreum/x/asset/ft/types"
assetftwasm "github.com/CoreumFoundation/coreum/x/asset/ft/wasm"
assetnft "github.com/CoreumFoundation/coreum/x/asset/nft"
assetnftkeeper "github.com/CoreumFoundation/coreum/x/asset/nft/keeper"
assetnfttypes "github.com/CoreumFoundation/coreum/x/asset/nft/types"
Expand All @@ -102,7 +101,7 @@ import (
feemodeltypes "github.com/CoreumFoundation/coreum/x/feemodel/types"
"github.com/CoreumFoundation/coreum/x/nft"
nftkeeper "github.com/CoreumFoundation/coreum/x/nft/keeper"
wasmtypes "github.com/CoreumFoundation/coreum/x/wasm/types"
wasmcustomhandler "github.com/CoreumFoundation/coreum/x/wasm/handler"
"github.com/CoreumFoundation/coreum/x/wbank"
wbankkeeper "github.com/CoreumFoundation/coreum/x/wbank/keeper"
"github.com/CoreumFoundation/coreum/x/wnft"
Expand Down Expand Up @@ -387,8 +386,12 @@ func New(
}

wasmOpts := []wasm.Option{
wasmkeeper.WithMessageEncoders(wasmtypes.NewCustomEncoder(assetftwasm.MsgHandler)),
wasmkeeper.WithQueryPlugins(wasmtypes.NewCustomQuerier(assetftwasm.QueryHandler(assetftkeeper.NewQueryService(app.AssetFTKeeper)))),
wasmkeeper.WithMessageEncoders(wasmcustomhandler.NewCoreumMsgHandler()),
wasmkeeper.WithQueryPlugins(wasmcustomhandler.NewCoreumQueryHandler(
assetftkeeper.NewQueryService(app.AssetFTKeeper),
assetnftkeeper.NewQueryService(app.AssetNFTKeeper),
app.NFTKeeper,
)),
}
if cast.ToBool(appOpts.Get("telemetry.enabled")) {
wasmOpts = append(wasmOpts, wasmkeeper.WithVMCacheMetrics(prometheus.DefaultRegisterer))
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/modules/testdata/wasm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ For the tests simplification we use the prebuilt wasm artifacts.
* Open the folder with the contract to rebuild
* Execute the command:
```
docker run --rm -v "$(pwd)":/code \
docker run --rm -v "$(pwd)"/../sdk:/sdk -v "$(pwd)":/code \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.12.6
Expand Down
10 changes: 10 additions & 0 deletions integration-tests/modules/testdata/wasm/ft/Cargo.lock

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

5 changes: 3 additions & 2 deletions integration-tests/modules/testdata/wasm/ft/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ authors = ["Coreum"]
edition = "2018"

exclude = [
"issue_fungible_token.wasm",
"checksums.txt",
"ft.wasm",
"checksums.txt",
]

[lib]
Expand Down Expand Up @@ -35,6 +35,7 @@ cw2 = "0.13.2"
schemars = "0.8.8"
serde = { version = "1.0.137", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.31" }
coreum-wasm-sdk = { path = "../sdk" }

[dev-dependencies]
cosmwasm-schema = "1.0.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
38b890e7e7edc8cf42c6a291223442bea9f5029d6b96a5e79ef79128b2ec135e ft.wasm
7b826892662a7144732810c1b7746f42b11370a319576dfceac766cb381155af fungible_token.wasm
f6b679a50dad2098b16c51a1637e0ca2736294f8f5665305094cd338e2576886 ft.wasm
Binary file modified integration-tests/modules/testdata/wasm/ft/artifacts/ft.wasm
Binary file not shown.
Binary file not shown.
Loading