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

feat: cw dex bindings #34

Merged
merged 17 commits into from
Mar 20, 2024
15 changes: 14 additions & 1 deletion Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ incremental = false
overflow-checks = true

[workspace.dependencies]
neutron-sdk = { git = "https://github.com/neutron-org/neutron-sdk", branch = "main" }
neutron-sdk = { git = "https://github.com/neutron-org/neutron-sdk.git", rev = "0e491bcd50805f7e2a3de599553d8bc3a52971ec" }
#neutron-sdk = { path = "../neutron-sdk/packages/neutron-sdk/" }
prost = "0.12.1"
prost-types = "0.12.1"
cosmos-sdk-proto = { version = "0.20.0", default-features = false }
Expand Down
14 changes: 14 additions & 0 deletions artifacts/checksums.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
5b9df1c997336ced609f927a954a4dbcc7ebb0a8f030d9cfc10279a12516e74a before_send_hook_test-x86_64.wasm
155def36317e9f8c635021fbba3ad58f9552ac20951068a2260e6b95e635247e client_updater-x86_64.wasm
e830c4b64db92f9c611a668b93ab2c0a2743d488a3dae4d3c95a6b60d9687ece dex-x86_64.wasm
d5cc6e7378af10fc683136e9c1b122c68c7883afa9fbef80ce483758dc2c1d5d dex_stargate-x86_64.wasm
cd5eaf31c5a335059bd61e5c14bcf5037953073401aabb340e85b97b5c49be74 echo-x86_64.wasm
7b7e7f579e22aa9abe3c2c15f25de156c7066251d984b3398677c744c76793e5 ibc_transfer-x86_64.wasm
ae1893daad4438ebf5313d217c6677a62a697204959cadce233f2ad2aa9a4167 msg_receiver-x86_64.wasm
94860b2bcfe806162f0dacda4b9c7f661cdcfb287a8245eaae8fb18f26e7b126 neutron_price_feed_mock-x86_64.wasm
3b40c66c118e2aec169f0f97c33d89a6dfc2385460563800d5f82c4c0ffdd55b neutron_interchain_queries-x86_64.wasm
ad06889a15ddc02d98b7ee094553ab1794688a10175d199973d8f48429451822 neutron_interchain_txs-x86_64.wasm
446cfe34708cecbd6b41bcf4069a3c92166fad979e1625d822667c3bd621707a neutron_validators_test-x86_64.wasm
51cb4fa9df1ba7a0023aab00d8f0af128f9464fa778de7d46d409d9eb097709f reflect-x86_64.wasm
02c11ac4905ce906ceb4ed70a88f892e0d7efc6a54a8dfc5a1ec8313ff187ad6 stargate_querier-x86_64.wasm
627f1b9fa7dfe105e427e1590caf817e072c27dfc1e211b2a60d4f9b64b4699f tokenfactory-x86_64.wasm
14 changes: 14 additions & 0 deletions artifacts/checksums_intermediate.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
93de0d82a62839b6a40da84d4779680c9024fd8d327958d89f52f637776db9b0 before_send_hook_test.wasm
8283af745174fb1da5c57be2daf0d5196e82050147f69a00a97e394d8fae4cbf client_updater.wasm
68a040403ea054a332504fece09d0a667deb558367da3559b77ca00367778b35 dex.wasm
3164eff573ca6ba33da2c9cea60f05ebcc95d5b074c13aac9ee7d74d0e52ce31 dex_stargate.wasm
3f96305646e197cffda27778ce652af3ccdeaa2b1335c189bb9ffd173c091dd7 echo.wasm
9d6512f2a92a7344e4e4a971a7d384d96d6d3005529cde69efe4c8bd366d93b6 ibc_transfer.wasm
fa4c789f63b19599ae8b7f9eca2d65e78ff06acb4c54ff7c92cae99e89f491bc msg_receiver.wasm
d688c20c12961e5cf036c36a08e77842a29c1a96d170c3847b4c8bf5744216d1 neutron_price_feed_mock.wasm
9f885d9ac15b3f40eb032229fead1d5e046c08df116af98990e5a3d5d843eb44 neutron_interchain_queries.wasm
cdac75fd7efebd4450b1ded16b9839e1b5b0646831e337545343aa01da03c60b neutron_interchain_txs.wasm
2ddbbb885c191e7e9a0714971c8b1d48bc788e60fb4e2f56a625035152b51d9d neutron_validators_test.wasm
0e7a5f816d41d9ed27bbb42e298f87637962e80571f2b68ab9b4ba23854510f4 reflect.wasm
1e003a775e6ee818206912117dd7b57ffa759b2b8d18cd66837b8f7856994201 stargate_querier.wasm
964135cb32e0c4e079f1a3bd037a04434e1cc225232d96999350b7401f089faf tokenfactory.wasm
6 changes: 6 additions & 0 deletions contracts/dex/.cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[alias]
wasm = "build --release --target wasm32-unknown-unknown"
wasm-debug = "build --target wasm32-unknown-unknown"
unit-test = "test --lib --features backtraces"
integration-test = "test --test integration"
schema = "run --example schema"
43 changes: 43 additions & 0 deletions contracts/dex/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[package]
name = "dex"
version = "0.1.0"
edition = "2021"


exclude = [
# Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication.
"contract.wasm",
"hash.txt",
]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[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]
# for quicker tests, cargo test --lib
# for more explicit tests, cargo test --features=backtraces
backtraces = ["cosmwasm-std/backtraces"]
library = []

[dependencies]
cosmwasm-std = "1.3.1"
cw2 = "1.1.0"
schemars = "0.8.10"
serde = { version = "1.0.180", default-features = false, features = ["derive"] }
neutron-sdk = { workspace = true }

[dev-dependencies]
cosmwasm-schema = { version = "1.3.1", default-features = false }
3 changes: 3 additions & 0 deletions contracts/dex/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Dex

This contract is used for tests in the main neutron repository.
32 changes: 32 additions & 0 deletions contracts/dex/examples/schema.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright 2022 Neutron
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

use std::env::current_dir;
use std::fs::create_dir_all;

use cosmwasm_schema::{export_schema, remove_schemas, schema_for};
use dex::contract::InstantiateMsg;
use neutron_sdk::bindings::dex::msg::DexMsg;
use neutron_sdk::bindings::dex::query::DexQuery;

fn main() {
let mut out_dir = current_dir().unwrap();
out_dir.push("schema");
create_dir_all(&out_dir).unwrap();
remove_schemas(&out_dir).unwrap();

export_schema(&schema_for!(InstantiateMsg), &out_dir);
export_schema(&schema_for!(DexMsg), &out_dir);
export_schema(&schema_for!(DexQuery), &out_dir);
}
Loading
Loading