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
29 changes: 21 additions & 8 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ 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", branch = "feat/cw-dex-bindings" }
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 @@
cf31690dfd2478f42f55cea30fa3a9874f06cd328f736df3fdf687b5387e44fa before_send_hook_test-x86_64.wasm
d5e983d67abaac10be8b2e63391af00a2cae828f4b095e3f86b1330d2304c44b client_updater-x86_64.wasm
3b290fbf64137be653ff1452ec3a101f360f10cff521b569c3fcc54a1455a46e dex-x86_64.wasm
e85798953e4b1ddd5561ab75c8330646043259bd5eb5cdadee6214e05f37ac2a dex_stargate-x86_64.wasm
45f13bb2a934f5c95c634dd12da9d95d0aeef498c08b81c0de1009fb90d65306 echo-x86_64.wasm
ef21b5544bd40a188198c6e2c88477c8d223562e7ded42e3773e3c62b07154ac ibc_transfer-x86_64.wasm
6ebaf70045ce390df28db83a65be6a1dfac46626d7242268d7d95f82c70d2855 msg_receiver-x86_64.wasm
0e59719cf88bc458011630af1b6b724f1e3c74eb440e92a117d1525088d4793f neutron_price_feed_mock-x86_64.wasm
11cee5c2a11bff1a0e41a0f3cfe3061adb909670bb29dd45daed9831ba34c133 neutron_interchain_queries-x86_64.wasm
5442356c8780004821e4690eb8547b4fdbcd9134ad4eb94cc5e9e2decb65fd82 neutron_interchain_txs-x86_64.wasm
b2f6dde6d73b39d6d9ab778632af600e172ecf44dc02159095325e92e18663ae neutron_validators_test-x86_64.wasm
4884f1ce16c7fd854d4e9900dc5ff6c67c7b18588eab6de4a162a116f7735af7 reflect-x86_64.wasm
c4c6e59c08048d5c1275d2a35a84a5b91862b827012704415ed5aa56363a362e stargate_querier-x86_64.wasm
d146050aca63e1a52932675a67dfd4aa9a23948383fbad275cc7ffb0ef1b2145 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 @@
732392426c1160ea1899955ee7ea263db5d5023fd601115c2039dfa9df648738 before_send_hook_test.wasm
52b18e18dd1782d46e425acfc82d0a88de5153834fbeec5e9db83703e2e05153 client_updater.wasm
01ab3c76b0f34dba1f52d8bb3a827deed26b295138f9ee01733842f408d1b909 dex.wasm
ca2ec2b77a90c2b2a76fb9cc59256e571ffe76ae3c9f6ee72838715153e89fd2 dex_stargate.wasm
212e7034418b28abacbf393438f0c509cbad294be51153a38a8288c95b67a67a echo.wasm
bfa8799864fba19455f1a11301d4312e22c17bd4019826e8ba5f9dd4e9a456d3 ibc_transfer.wasm
42ac2bd34a8a4e7c9db0a28592354e9eb000d5c0d644e160b9064f20d8873240 msg_receiver.wasm
4d2ec7085a1dd6e8a4eab15a15580b7343ddde273c1a6471622c632573361343 neutron_price_feed_mock.wasm
a35efe4e5ddcbddccfcf0e13385cd7aa9b95da642a67441bb9b1301041bd8ea2 neutron_interchain_queries.wasm
8763335f18eff836ee0797ada8d5362eaddcd72ee2cafaebe71dfef7d4595aed neutron_interchain_txs.wasm
4aa23ebc76c3fe48c451b19b4a8076476ead1dd74dc964ca67b30efb09857e72 neutron_validators_test.wasm
d4c10fb536cb64ca91be931efa24682e85e6ff3c0a58d440390a9e820bd0d049 reflect.wasm
a782e7867ec0dddac3d7684f5e9e106dbff475ff1cf9c355626acc8cf9018928 stargate_querier.wasm
dbdde027d2071120270f1f53bd87fdd7eff844b34b98facbcd8c7172e4c7d502 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