diff --git a/Cargo.lock b/Cargo.lock index e3aadb1..f07cdb5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13,18 +13,158 @@ dependencies = [ "version_check", ] +[[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.86" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +[[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 0.10.7", + "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 0.10.7", + "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 = "astroport" -version = "4.0.3" -source = "git+https://github.com/astroport-fi/astroport-core#a0a71af801be3f72c64b81f798e1b0805cf0f594" +version = "5.2.0" +source = "git+https://github.com/astroport-fi/astroport-core#4d3be0ee470ca27ae7da2feba1dcf95b73bba799" dependencies = [ "astroport-circular-buffer", + "cosmos-sdk-proto 0.19.0", "cosmwasm-schema 1.5.5", "cosmwasm-std 1.5.2", "cw-asset", @@ -32,13 +172,14 @@ dependencies = [ "cw-utils", "cw20", "itertools 0.12.1", + "prost 0.11.9", "uint", ] [[package]] name = "astroport-circular-buffer" version = "0.2.0" -source = "git+https://github.com/astroport-fi/astroport-core#a0a71af801be3f72c64b81f798e1b0805cf0f594" +source = "git+https://github.com/astroport-fi/astroport-core#4d3be0ee470ca27ae7da2feba1dcf95b73bba799" dependencies = [ "cosmwasm-schema 1.5.5", "cosmwasm-std 1.5.2", @@ -76,6 +217,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "base64ct" version = "1.6.0" @@ -88,12 +235,18 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" +[[package]] +name = "bech32" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" + [[package]] name = "before-send-hook-test" version = "0.1.0" dependencies = [ - "cosmwasm-schema 2.0.4", - "cosmwasm-std 2.0.4", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", "cw-storage-plus 2.0.0", "schemars", "serde", @@ -125,9 +278,9 @@ checksum = "ab9008b6bb9fc80b5277f2fe481c09e828743d9151203e804583eb4c9e15b31d" [[package]] name = "bnum" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56953345e39537a3e18bdaeba4cb0c58a78c1f61f361dc0fa7c5c7340ae87c5f" +checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" [[package]] name = "byteorder" @@ -163,8 +316,8 @@ dependencies = [ name = "client_updater" version = "0.1.0" dependencies = [ - "cosmwasm-schema 2.0.4", - "cosmwasm-std 2.0.4", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", "cw-storage-plus 2.0.0", "cw2 2.0.0", "neutron-sdk", @@ -200,6 +353,12 @@ dependencies = [ "tendermint-proto 0.34.1", ] +[[package]] +name = "cosmwasm-core" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d075f6bb1483a6ce83b5cbc73a3a1207e0316ac1e34ed1f2a4d9fc3a0f07bf6" + [[package]] name = "cosmwasm-crypto" version = "1.5.2" @@ -208,7 +367,7 @@ checksum = "8ed6aa9f904de106fa16443ad14ec2abe75e94ba003bb61c681c0e43d4c58d2a" dependencies = [ "digest 0.10.7", "ecdsa", - "ed25519-zebra", + "ed25519-zebra 3.1.0", "k256", "rand_core 0.6.4", "thiserror", @@ -216,14 +375,24 @@ dependencies = [ [[package]] name = "cosmwasm-crypto" -version = "2.0.4" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7a339f6b59ff7ad4ae05a70512a4f3c19bf8fcc845d46bfef90f4ec0810f72c" +checksum = "88ced5a6dd2801a383d3e14e5ae5caa7fdfeff1bd9f22b30e810e0aded8a5869" dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "cosmwasm-core", "digest 0.10.7", - "ed25519-zebra", + "ecdsa", + "ed25519-zebra 4.0.3", "k256", + "num-traits", + "p256", "rand_core 0.6.4", + "rayon", + "sha2 0.10.8", "thiserror", ] @@ -238,11 +407,13 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.0.4" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d3bfea6af94a83880fb05478135ed0c256d9a2fcde58c595a10d64dcb9c925d" +checksum = "35bd1873f84d9b17edf8a90ffe10a89a649b82feacc00e36788b81d2c3cbf03c" dependencies = [ - "syn 1.0.109", + "proc-macro2", + "quote", + "syn 2.0.66", ] [[package]] @@ -260,11 +431,11 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.0.4" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "101d0739564bd34cba9b84bf73665f0822487ae3b29b2dd59930608ed3aafd43" +checksum = "27984b137eb2ac561f97f6bdb02004a98eb6f2ba263062c140b8e231ee1826b7" dependencies = [ - "cosmwasm-schema-derive 2.0.4", + "cosmwasm-schema-derive 2.1.0", "schemars", "serde", "serde_json", @@ -284,13 +455,13 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.0.4" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4be75f60158478da2c5d319ed59295bca1687ad50c18215a0485aa91a995ea" +checksum = "f4ef0d201f611bdb6c9124207032423eb956f1fc8ab3e3ee7253a9c08a5f5809" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.66", ] [[package]] @@ -299,8 +470,8 @@ version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad011ae7447188e26e4a7dbca2fcd0fc186aa21ae5c86df0503ea44c78f9e469" dependencies = [ - "base64", - "bech32", + "base64 0.21.7", + "bech32 0.9.1", "bnum 0.8.1", "cosmwasm-crypto 1.5.2", "cosmwasm-derive 1.5.5", @@ -317,18 +488,19 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.0.4" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded932165de44cd0717979c34fc3b84d8e8066b8dde4f5bd78f96a643b090f90" +checksum = "2522fb5c9a0409712bb1d036128bccf3564e6b2ac82f942ae4cf3c8df3e26fa8" dependencies = [ - "base64", - "bech32", - "bnum 0.10.0", - "cosmwasm-crypto 2.0.4", - "cosmwasm-derive 2.0.4", - "derivative", - "forward_ref", + "base64 0.22.1", + "bech32 0.11.0", + "bnum 0.11.0", + "cosmwasm-core", + "cosmwasm-crypto 2.1.0", + "cosmwasm-derive 2.1.0", + "derive_more", "hex", + "rand_core 0.6.4", "schemars", "serde", "serde-json-wasm 1.0.1", @@ -346,6 +518,31 @@ 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 = "crunchy" version = "0.2.2" @@ -387,6 +584,33 @@ dependencies = [ "zeroize", ] +[[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 0.10.7", + "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.66", +] + [[package]] name = "cw-address-like" version = "1.0.4" @@ -427,7 +651,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f13360e9007f51998d42b1bc6b7fa0141f74feae61ed5fd1e5b0a89eec7b5de1" dependencies = [ - "cosmwasm-std 2.0.4", + "cosmwasm-std 2.1.0", "schemars", "serde", ] @@ -468,8 +692,8 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b04852cd38f044c0751259d5f78255d07590d136b8a86d4e09efdd7666bd6d27" dependencies = [ - "cosmwasm-schema 2.0.4", - "cosmwasm-std 2.0.4", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", "cw-storage-plus 2.0.0", "schemars", "semver", @@ -520,12 +744,33 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_more" +version = "1.0.0-beta.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7abbfc297053be59290e3152f8cbcd52c8642e0728b69ee187d991d4c1af08d" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0-beta.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", + "unicode-xid", +] + [[package]] name = "dex" version = "0.1.0" dependencies = [ - "cosmwasm-schema 2.0.4", - "cosmwasm-std 2.0.4", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", "cw2 2.0.0", "neutron-sdk", "schemars", @@ -533,12 +778,12 @@ dependencies = [ ] [[package]] -name = "dex_stargate" +name = "dex_grpc" version = "0.1.0" dependencies = [ "cosmos-sdk-proto 0.20.0", - "cosmwasm-schema 2.0.4", - "cosmwasm-std 2.0.4", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", "cw2 2.0.0", "neutron-sdk", "prost 0.12.6", @@ -592,20 +837,29 @@ dependencies = [ name = "echo" version = "0.1.0" dependencies = [ - "cosmwasm-schema 2.0.4", - "cosmwasm-std 2.0.4", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", "schemars", "serde", ] +[[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 = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" dependencies = [ - "curve25519-dalek", - "hashbrown", + "curve25519-dalek 3.2.0", + "hashbrown 0.12.3", "hex", "rand_core 0.6.4", "serde", @@ -613,6 +867,21 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ed25519-zebra" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" +dependencies = [ + "curve25519-dalek 4.1.3", + "ed25519", + "hashbrown 0.14.5", + "hex", + "rand_core 0.6.4", + "sha2 0.10.8", + "zeroize", +] + [[package]] name = "either" version = "1.12.0" @@ -648,6 +917,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + [[package]] name = "flex-error" version = "0.4.4" @@ -696,13 +971,46 @@ dependencies = [ "subtle", ] +[[package]] +name = "grpc_querier" +version = "0.1.0" +dependencies = [ + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", + "cw2 2.0.0", + "neutron-sdk", + "prost 0.12.6", + "schemars", + "serde", + "serde-json-wasm 1.0.1", +] + [[package]] name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash", + "ahash 0.7.8", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.11", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash 0.8.11", + "allocator-api2", ] [[package]] @@ -730,8 +1038,8 @@ dependencies = [ name = "ibc_transfer" version = "0.1.0" dependencies = [ - "cosmwasm-schema 2.0.4", - "cosmwasm-std 2.0.4", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", "cw-storage-plus 2.0.0", "cw2 2.0.0", "neutron-sdk", @@ -788,8 +1096,8 @@ checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" name = "marketmap" version = "0.1.0" dependencies = [ - "cosmwasm-schema 2.0.4", - "cosmwasm-std 2.0.4", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", "cw2 2.0.0", "neutron-sdk", "schemars", @@ -800,8 +1108,8 @@ dependencies = [ name = "msg_receiver" version = "0.1.0" dependencies = [ - "cosmwasm-schema 2.0.4", - "cosmwasm-std 2.0.4", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", "cw-storage-plus 2.0.0", "cw2 2.0.0", "neutron-sdk", @@ -813,8 +1121,8 @@ dependencies = [ name = "neutron-price-feed-mock" version = "0.1.0" dependencies = [ - "cosmwasm-schema 2.0.4", - "cosmwasm-std 2.0.4", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", "cw-storage-plus 2.0.0", "cw2 2.0.0", "thiserror", @@ -823,13 +1131,13 @@ dependencies = [ [[package]] name = "neutron-sdk" version = "0.11.0" -source = "git+https://github.com/neutron-org/neutron-sdk?branch=feat/remove-stargate#7187b4bae4888c7fb1b57da4b16f364cc3bfea92" +source = "git+https://github.com/neutron-org/neutron-sdk?branch=feat/remove-stargate#06a572fc1ef7c3cca331a48d2073304c84753944" dependencies = [ - "bech32", + "bech32 0.9.1", "chrono", "cosmos-sdk-proto 0.20.0", - "cosmwasm-schema 2.0.4", - "cosmwasm-std 2.0.4", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", "neutron-std-derive", "prost 0.12.6", "prost-types 0.12.6", @@ -847,7 +1155,7 @@ dependencies = [ [[package]] name = "neutron-std-derive" version = "0.20.1" -source = "git+https://github.com/neutron-org/neutron-sdk?branch=feat/remove-stargate#7187b4bae4888c7fb1b57da4b16f364cc3bfea92" +source = "git+https://github.com/neutron-org/neutron-sdk?branch=feat/remove-stargate#06a572fc1ef7c3cca331a48d2073304c84753944" dependencies = [ "itertools 0.10.5", "proc-macro2", @@ -860,10 +1168,10 @@ dependencies = [ name = "neutron_interchain_queries" version = "0.1.0" dependencies = [ - "base64", + "base64 0.21.7", "cosmos-sdk-proto 0.20.0", - "cosmwasm-schema 2.0.4", - "cosmwasm-std 2.0.4", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", "cw-storage-plus 2.0.0", "cw2 2.0.0", "neutron-sdk", @@ -878,8 +1186,8 @@ name = "neutron_interchain_txs" version = "0.1.0" dependencies = [ "cosmos-sdk-proto 0.20.0", - "cosmwasm-schema 2.0.4", - "cosmwasm-std 2.0.4", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", "cw-storage-plus 2.0.0", "cw2 2.0.0", "neutron-sdk", @@ -895,8 +1203,8 @@ name = "neutron_validators_test" version = "0.1.0" dependencies = [ "cosmos-sdk-proto 0.20.0", - "cosmwasm-schema 2.0.4", - "cosmwasm-std 2.0.4", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", "cw-storage-plus 2.0.0", "cw2 2.0.0", "neutron-sdk", @@ -905,6 +1213,16 @@ dependencies = [ "serde-json-wasm 1.0.1", ] +[[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-conv" version = "0.1.0" @@ -922,6 +1240,15 @@ dependencies = [ "syn 1.0.109", ] +[[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" @@ -947,8 +1274,8 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" name = "oracle" version = "0.1.0" dependencies = [ - "cosmwasm-schema 2.0.4", - "cosmwasm-std 2.0.4", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", "cw2 2.0.0", "neutron-sdk", "schemars", @@ -956,32 +1283,15 @@ dependencies = [ ] [[package]] -name = "osmosis-std" -version = "0.19.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "798fade51443a0e07eb25b59a11b320b9e8f03e6e8fbe14c520258f04742fe13" -dependencies = [ - "chrono", - "cosmwasm-std 1.5.2", - "osmosis-std-derive", - "prost 0.11.9", - "prost-types 0.11.9", - "schemars", - "serde", - "serde-cw-value", -] - -[[package]] -name = "osmosis-std-derive" -version = "0.16.2" +name = "p256" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f47f0b2f22adb341bb59e5a3a1b464dde033181954bd055b9ae86d6511ba465b" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" dependencies = [ - "itertools 0.10.5", - "proc-macro2", - "prost-types 0.11.9", - "quote", - "syn 1.0.109", + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2 0.10.8", ] [[package]] @@ -1006,6 +1316,21 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[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.85" @@ -1108,6 +1433,26 @@ 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 0.6.4", +] + +[[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 0.6.4", +] + [[package]] name = "rand_core" version = "0.5.1" @@ -1123,12 +1468,32 @@ 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 = "reflect" version = "0.1.0" dependencies = [ - "cosmwasm-schema 2.0.4", - "cosmwasm-std 2.0.4", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", "cw2 2.0.0", "neutron-sdk", "schemars", @@ -1145,6 +1510,15 @@ dependencies = [ "subtle", ] +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + [[package]] name = "rustversion" version = "1.0.17" @@ -1333,22 +1707,6 @@ dependencies = [ "der", ] -[[package]] -name = "stargate_querier" -version = "0.1.0" -dependencies = [ - "cosmos-sdk-proto 0.19.0", - "cosmwasm-schema 2.0.4", - "cosmwasm-std 2.0.4", - "cw2 2.0.0", - "neutron-sdk", - "osmosis-std", - "prost 0.11.9", - "schemars", - "serde", - "serde-json-wasm 1.0.1", -] - [[package]] name = "static_assertions" version = "1.1.0" @@ -1503,8 +1861,8 @@ dependencies = [ name = "tokenfactory" version = "0.1.0" dependencies = [ - "cosmwasm-schema 2.0.4", - "cosmwasm-std 2.0.4", + "cosmwasm-schema 2.1.0", + "cosmwasm-std 2.1.0", "neutron-sdk", "schemars", "serde", @@ -1534,6 +1892,12 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + [[package]] name = "version_check" version = "0.9.4" @@ -1546,8 +1910,42 @@ 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 = [ + "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.66", +] + [[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.66", +] diff --git a/README.md b/README.md index f05eebf..ae8f2e7 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,11 @@ The following contracts are maintained here: | Contract | Reference | Description | |--------------------------------------------------|-------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Neutron Interchain Queries Example Contract | https://github.com/neutron-org/neutron-contracts/tree/main/contracts/neutron-interchain-queries | The contract shows how to properly work with [Interchain Queries Module](https://github.com/neutron-org/neutron/tree/master/x/interchainqueries) using [Interchain Queries SDK package](https://github.com/neutron-org/neutron-contracts/tree/main/packages/neutron-sdk/src/interchain_queries) via CosmWasm smart-contract. | -| Neutron Interchain Transactions Example Contract | https://github.com/neutron-org/neutron-contracts/tree/main/contracts/neutron_interchain_txs | The contract shows how to properly work with [Neutron Interchain Transactions Module](https://github.com/neutron-org/neutron/tree/master/x/interchaintxs) using [Interchain Transactions SDK package](https://github.com/neutron-org/neutron-contracts/tree/main/packages/neutron-sdk/src/interchain_txs) via CosmWasm smart-contract. | -| Neutron IBC Transfer Example Contract | https://github.com/neutron-org/neutron-contracts/tree/main/contracts/ibc_transfer | The contract shows how to properly work with [Neutron Sudo Package](https://github.com/neutron-org/neutron-contracts/tree/main/packages/neutron_sudo) to handle a callback from IBC transfer. | -| Neutron dex module + Stargate Example Contract | https://github.com/neutron-org/neutron-contracts/tree/main/contracts/dex_stargate | The contract shows a way to use [Neutron SDK's Stargate package](https://github.com/neutron-org/neutron-sdk/tree/main/packages/neutron-sdk/src/stargate) to interact with Neutron dex module via stargate | -| Reflect | https://github.com/neutron-org/neutron-contracts/tree/main/contracts/reflect | This contract is used for tests in the main neutron repository. | +| Neutron Interchain Queries Example Contract | | The contract shows how to properly work with [Interchain Queries Module](https://github.com/neutron-org/neutron/tree/master/x/interchainqueries) using [Interchain Queries SDK package](https://github.com/neutron-org/neutron-contracts/tree/main/packages/neutron-sdk/src/interchain_queries) via CosmWasm smart-contract. | +| Neutron Interchain Transactions Example Contract | | The contract shows how to properly work with [Neutron Interchain Transactions Module](https://github.com/neutron-org/neutron/tree/master/x/interchaintxs) using [Interchain Transactions SDK package](https://github.com/neutron-org/neutron-contracts/tree/main/packages/neutron-sdk/src/interchain_txs) via CosmWasm smart-contract. | +| Neutron IBC Transfer Example Contract | | The contract shows how to properly work with [Neutron Sudo Package](https://github.com/neutron-org/neutron-contracts/tree/main/packages/neutron_sudo) to handle a callback from IBC transfer. | +| Neutron dex module + Grpc Example Contract | | The contract shows a way to use [Neutron SDK's Grpc package](https://github.com/neutron-org/neutron-sdk/tree/main/packages/neutron-sdk/src/grpc) to interact with Neutron dex module via grpc | +| Reflect | | This contract is used for tests in the main neutron repository. | ## Development @@ -24,7 +24,7 @@ The following contracts are maintained here: - `wasm32-unknown-unknown` target - Docker -1. Install `rustup` via https://rustup.rs/ +1. Install `rustup` via 2. Run the following: diff --git a/contracts/balance-tracker/Cargo.toml b/contracts/balance-tracker/Cargo.toml index 1297d80..10287d4 100644 --- a/contracts/balance-tracker/Cargo.toml +++ b/contracts/balance-tracker/Cargo.toml @@ -27,4 +27,4 @@ cosmwasm-std = "1.5" cw-storage-plus = "1.2" cosmwasm-schema = "1.5" thiserror = "1" -astroport = { git = "https://github.com/astroport-fi/astroport-core", version = "4" } +astroport = { git = "https://github.com/astroport-fi/astroport-core", version = "5" } diff --git a/contracts/balance-tracker/src/query.rs b/contracts/balance-tracker/src/query.rs index fba34a1..d36cc15 100644 --- a/contracts/balance-tracker/src/query.rs +++ b/contracts/balance-tracker/src/query.rs @@ -9,34 +9,33 @@ use crate::state::{BALANCES, CONFIG, TOTAL_SUPPLY_HISTORY}; #[cfg_attr(not(feature = "library"), entry_point)] pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult { match msg { - QueryMsg::BalanceAt { address, timestamp } => { - to_json_binary(&balance_at(deps, env, address, timestamp)?) - } - QueryMsg::TotalSupplyAt { timestamp } => { - to_json_binary(&total_supply_at(deps, env, timestamp)?) + QueryMsg::BalanceAt { address, unit } => { + to_json_binary(&balance_at(deps, env, address, unit)?) } + QueryMsg::TotalSupplyAt { unit } => to_json_binary(&total_supply_at(deps, env, unit)?), QueryMsg::Config {} => { let config = CONFIG.load(deps.storage)?; to_json_binary(&ConfigResponse { tracked_denom: config.d, token_factory_module: config.m, + track_over_seconds: true, }) } } } -fn balance_at(deps: Deps, env: Env, address: String, timestamp: Option) -> StdResult { +fn balance_at(deps: Deps, env: Env, address: String, unit: Option) -> StdResult { let block_time = env.block.time.seconds(); - match timestamp.unwrap_or(block_time) { + match unit.unwrap_or(block_time) { timestamp if timestamp == block_time => BALANCES.may_load(deps.storage, &address), timestamp => BALANCES.may_load_at_height(deps.storage, &address, timestamp), } .map(|balance| balance.unwrap_or_default()) } -fn total_supply_at(deps: Deps, env: Env, timestamp: Option) -> StdResult { +fn total_supply_at(deps: Deps, env: Env, unit: Option) -> StdResult { let block_time = env.block.time.seconds(); - match timestamp.unwrap_or(block_time) { + match unit.unwrap_or(block_time) { timestamp if timestamp == block_time => TOTAL_SUPPLY_HISTORY.may_load(deps.storage), timestamp => TOTAL_SUPPLY_HISTORY.may_load_at_height(deps.storage, timestamp), } diff --git a/contracts/before-send-hook/schema/instantiate_msg.json b/contracts/before-send-hook/schema/instantiate_msg.json index 44588cf..1352613 100644 --- a/contracts/before-send-hook/schema/instantiate_msg.json +++ b/contracts/before-send-hook/schema/instantiate_msg.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "InstantiateMsg", - "type": "object" + "type": "object", + "additionalProperties": false } diff --git a/contracts/before-send-hook/schema/migrate_msg.json b/contracts/before-send-hook/schema/migrate_msg.json index 87b18ea..7fbe8c5 100644 --- a/contracts/before-send-hook/schema/migrate_msg.json +++ b/contracts/before-send-hook/schema/migrate_msg.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "MigrateMsg", - "type": "object" + "type": "object", + "additionalProperties": false } diff --git a/contracts/before-send-hook/schema/query_msg.json b/contracts/before-send-hook/schema/query_msg.json index 77f598c..35b4989 100644 --- a/contracts/before-send-hook/schema/query_msg.json +++ b/contracts/before-send-hook/schema/query_msg.json @@ -9,7 +9,8 @@ ], "properties": { "sudo_result_block_before": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -21,7 +22,8 @@ ], "properties": { "sudo_result_track_before": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false diff --git a/contracts/client_updater/schema/execute_msg.json b/contracts/client_updater/schema/execute_msg.json index f78a903..ade18ff 100644 --- a/contracts/client_updater/schema/execute_msg.json +++ b/contracts/client_updater/schema/execute_msg.json @@ -29,7 +29,8 @@ "title": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false diff --git a/contracts/client_updater/schema/instantiate_msg.json b/contracts/client_updater/schema/instantiate_msg.json index 44588cf..1352613 100644 --- a/contracts/client_updater/schema/instantiate_msg.json +++ b/contracts/client_updater/schema/instantiate_msg.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "InstantiateMsg", - "type": "object" + "type": "object", + "additionalProperties": false } diff --git a/contracts/dex/schema/dex_msg.json b/contracts/dex/schema/dex_msg.json index ad925fb..b8c612f 100644 --- a/contracts/dex/schema/dex_msg.json +++ b/contracts/dex/schema/dex_msg.json @@ -72,7 +72,8 @@ "description": "Denom for the opposing side of the deposit", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -131,7 +132,8 @@ "description": "Denom for the opposing side of the deposit", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -212,7 +214,8 @@ "description": "Token being “bought”", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -234,7 +237,8 @@ "description": "TrancheKey for the target limit order", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -256,7 +260,8 @@ "description": "TrancheKey for the target limit order", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -309,7 +314,8 @@ "$ref": "#/definitions/MultiHopRoute" } } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -325,7 +331,8 @@ "disable_swap": { "type": "boolean" } - } + }, + "additionalProperties": false }, "LimitOrderType": { "oneOf": [ @@ -378,7 +385,8 @@ "type": "string" } } - } + }, + "additionalProperties": false }, "PrecDec": { "type": "object", @@ -389,7 +397,8 @@ "i": { "type": "string" } - } + }, + "additionalProperties": false }, "Uint128": { "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", diff --git a/contracts/dex/schema/dex_query.json b/contracts/dex/schema/dex_query.json index f1dae18..bc0a5c0 100644 --- a/contracts/dex/schema/dex_query.json +++ b/contracts/dex/schema/dex_query.json @@ -10,7 +10,8 @@ ], "properties": { "params": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -35,7 +36,8 @@ "tranche_key": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -60,7 +62,8 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -91,7 +94,8 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -125,7 +129,8 @@ "tranche_key": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -160,7 +165,8 @@ "token_in": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -195,7 +201,8 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -230,7 +237,8 @@ "token_in": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -264,7 +272,8 @@ "tranche_key": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -289,7 +298,8 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -324,7 +334,8 @@ "token_in": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -360,7 +371,8 @@ "token_in": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -404,7 +416,8 @@ "$ref": "#/definitions/MultiHopRoute" } } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -468,7 +481,8 @@ "token_out": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -500,7 +514,8 @@ "type": "integer", "format": "int64" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -523,7 +538,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -546,7 +562,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -571,7 +588,8 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -637,7 +655,8 @@ "type": "string" } } - } + }, + "additionalProperties": false }, "PageRequest": { "type": "object", @@ -677,7 +696,8 @@ "description": "reverse is set to true if results are to be returned in the descending order.", "type": "boolean" } - } + }, + "additionalProperties": false }, "PrecDec": { "type": "object", @@ -688,7 +708,8 @@ "i": { "type": "string" } - } + }, + "additionalProperties": false } } } diff --git a/contracts/dex/schema/instantiate_msg.json b/contracts/dex/schema/instantiate_msg.json index 44588cf..1352613 100644 --- a/contracts/dex/schema/instantiate_msg.json +++ b/contracts/dex/schema/instantiate_msg.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "InstantiateMsg", - "type": "object" + "type": "object", + "additionalProperties": false } diff --git a/contracts/dex_stargate/.cargo/config b/contracts/dex_grpc/.cargo/config similarity index 100% rename from contracts/dex_stargate/.cargo/config rename to contracts/dex_grpc/.cargo/config diff --git a/contracts/dex_stargate/Cargo.toml b/contracts/dex_grpc/Cargo.toml similarity index 92% rename from contracts/dex_stargate/Cargo.toml rename to contracts/dex_grpc/Cargo.toml index 093fabc..90fc9d6 100644 --- a/contracts/dex_stargate/Cargo.toml +++ b/contracts/dex_grpc/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "dex_stargate" +name = "dex_grpc" version = "0.1.0" edition = "2021" @@ -32,7 +32,7 @@ library = [] [dependencies] neutron-sdk = { workspace = true } -cosmwasm-std = { workspace = true, features = ["stargate"] } +cosmwasm-std = { workspace = true } cw2 = { workspace = true } schemars = { workspace = true } serde = { version = "1.0.188", default-features = false, features = ["derive"] } diff --git a/contracts/dex_stargate/README.md b/contracts/dex_grpc/README.md similarity index 81% rename from contracts/dex_stargate/README.md rename to contracts/dex_grpc/README.md index 2a5d5da..9097799 100644 --- a/contracts/dex_stargate/README.md +++ b/contracts/dex_grpc/README.md @@ -1,3 +1,3 @@ -# Dex Stargate +# Dex Grpc This contract is used for tests in the main neutron repository. diff --git a/contracts/dex_stargate/examples/schema.rs b/contracts/dex_grpc/examples/schema.rs similarity index 94% rename from contracts/dex_stargate/examples/schema.rs rename to contracts/dex_grpc/examples/schema.rs index 55953d2..25b582a 100644 --- a/contracts/dex_stargate/examples/schema.rs +++ b/contracts/dex_grpc/examples/schema.rs @@ -16,7 +16,7 @@ use std::env::current_dir; use std::fs::create_dir_all; use cosmwasm_schema::{export_schema, remove_schemas, schema_for}; -use dex_stargate::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use dex_grpc::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; fn main() { let mut out_dir = current_dir().unwrap(); diff --git a/contracts/dex_stargate/schema/execute_msg.json b/contracts/dex_grpc/schema/execute_msg.json similarity index 94% rename from contracts/dex_stargate/schema/execute_msg.json rename to contracts/dex_grpc/schema/execute_msg.json index de4796b..415e13e 100644 --- a/contracts/dex_stargate/schema/execute_msg.json +++ b/contracts/dex_grpc/schema/execute_msg.json @@ -63,7 +63,8 @@ "token_b": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -115,7 +116,8 @@ "token_b": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -175,7 +177,8 @@ "token_out": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -195,7 +198,8 @@ "tranche_key": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -215,7 +219,8 @@ "tranche_key": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -254,7 +259,8 @@ "$ref": "#/definitions/MultiHopRoute" } } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -274,7 +280,8 @@ "fail_tx_on_bel": { "type": "boolean" } - } + }, + "additionalProperties": false }, "MultiHopRoute": { "type": "object", @@ -288,7 +295,8 @@ "type": "string" } } - } + }, + "additionalProperties": false }, "Timestamp": { "type": "object", @@ -307,7 +315,8 @@ "type": "integer", "format": "int64" } - } + }, + "additionalProperties": false } } } diff --git a/contracts/stargate_querier/schema/instantiate_msg.json b/contracts/dex_grpc/schema/instantiate_msg.json similarity index 63% rename from contracts/stargate_querier/schema/instantiate_msg.json rename to contracts/dex_grpc/schema/instantiate_msg.json index 44588cf..1352613 100644 --- a/contracts/stargate_querier/schema/instantiate_msg.json +++ b/contracts/dex_grpc/schema/instantiate_msg.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "InstantiateMsg", - "type": "object" + "type": "object", + "additionalProperties": false } diff --git a/contracts/dex_stargate/schema/query_msg.json b/contracts/dex_grpc/schema/query_msg.json similarity index 93% rename from contracts/dex_stargate/schema/query_msg.json rename to contracts/dex_grpc/schema/query_msg.json index 32b92a8..425765a 100644 --- a/contracts/dex_stargate/schema/query_msg.json +++ b/contracts/dex_grpc/schema/query_msg.json @@ -9,7 +9,8 @@ ], "properties": { "params": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -37,7 +38,8 @@ "tranche_key": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -61,7 +63,8 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -91,7 +94,8 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -124,7 +128,8 @@ "tranche_key": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -158,7 +163,8 @@ "token_in": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -192,7 +198,8 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -226,7 +233,8 @@ "token_in": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -259,7 +267,8 @@ "tranche_key": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -283,7 +292,8 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -317,7 +327,8 @@ "token_in": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -352,7 +363,8 @@ "token_in": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -395,7 +407,8 @@ "$ref": "#/definitions/MultiHopRoute" } } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -455,7 +468,8 @@ "token_out": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -486,7 +500,8 @@ "type": "integer", "format": "int64" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -508,7 +523,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -530,7 +546,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -554,7 +571,8 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -573,7 +591,8 @@ "type": "string" } } - } + }, + "additionalProperties": false }, "PageRequest": { "description": "PageRequest is to be embedded in gRPC request messages for efficient pagination. Ex:\n\nmessage SomeRequest { Foo some_parameter = 1; PageRequest pagination = 2; }", @@ -615,7 +634,8 @@ "description": "reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43", "type": "boolean" } - } + }, + "additionalProperties": false }, "Timestamp": { "type": "object", @@ -634,7 +654,8 @@ "type": "integer", "format": "int64" } - } + }, + "additionalProperties": false } } } diff --git a/contracts/dex_stargate/src/contract.rs b/contracts/dex_grpc/src/contract.rs similarity index 84% rename from contracts/dex_stargate/src/contract.rs rename to contracts/dex_grpc/src/contract.rs index 04abda6..42b444f 100644 --- a/contracts/dex_stargate/src/contract.rs +++ b/contracts/dex_grpc/src/contract.rs @@ -1,13 +1,11 @@ use crate::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; use cosmwasm_std::{ entry_point, to_json_binary, Binary, CosmosMsg, Deps, DepsMut, Env, MessageInfo, Response, - StdError, StdResult, + StdResult, }; use cw2::set_contract_version; -use neutron_sdk::{bindings::msg::NeutronMsg, sudo::msg::SudoMsg}; -use std::convert::TryInto; - use neutron_sdk::proto_types::neutron::dex; +use neutron_sdk::sudo::msg::SudoMsg; const CONTRACT_NAME: &str = concat!("crates.io:neutron-contracts__", env!("CARGO_PKG_NAME")); const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); @@ -140,30 +138,30 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { deps.api .debug(format!("WASMDEBUG: query: received msg: {:?}", msg).as_str()); - let dexQuerier = dex::DexQuerier::new(&deps.querier); + let dex_querier = dex::DexQuerier::new(&deps.querier); match msg { - QueryMsg::Params {} => Ok(to_json_binary(&dexQuerier.params()?)?), + QueryMsg::Params {} => Ok(to_json_binary(&dex_querier.params()?)?), QueryMsg::GetLimitOrderTrancheUser { address, tranche_key, calc_withdrawable_shares, - } => Ok(to_json_binary(&dexQuerier.limit_order_tranche_user( + } => Ok(to_json_binary(&dex_querier.limit_order_tranche_user( address, tranche_key, calc_withdrawable_shares, )?)?), QueryMsg::AllLimitOrderTrancheUser { pagination } => Ok(to_json_binary( - &dexQuerier.limit_order_tranche_user_all(pagination)?, + &dex_querier.limit_order_tranche_user_all(pagination)?, )?), QueryMsg::AllLimitOrderTrancheUserByAddress { address, pagination, } => Ok(to_json_binary( - &dexQuerier.limit_order_tranche_user_all_by_address(address, pagination)?, + &dex_querier.limit_order_tranche_user_all_by_address(address, pagination)?, )?), QueryMsg::GetLimitOrderTranche { @@ -171,7 +169,7 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { tick_index, token_in, tranche_key, - } => Ok(to_json_binary(&dexQuerier.limit_order_tranche( + } => Ok(to_json_binary(&dex_querier.limit_order_tranche( pair_id, tick_index, token_in, @@ -183,14 +181,14 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { token_in, pagination, } => Ok(to_json_binary( - &dexQuerier.limit_order_tranche_all(pair_id, token_in, pagination)?, + &dex_querier.limit_order_tranche_all(pair_id, token_in, pagination)?, )?), QueryMsg::AllUserDeposits { address, include_pool_data, pagination, - } => Ok(to_json_binary(&dexQuerier.user_deposits_all( + } => Ok(to_json_binary(&dex_querier.user_deposits_all( address, pagination, include_pool_data, @@ -201,7 +199,7 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { token_in, pagination, } => Ok(to_json_binary( - &dexQuerier.tick_liquidity_all(pair_id, token_in, pagination)?, + &dex_querier.tick_liquidity_all(pair_id, token_in, pagination)?, )?), QueryMsg::GetInactiveLimitOrderTranche { @@ -209,7 +207,7 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { token_in, tick_index, tranche_key, - } => Ok(to_json_binary(&dexQuerier.inactive_limit_order_tranche( + } => Ok(to_json_binary(&dex_querier.inactive_limit_order_tranche( pair_id, token_in, tick_index, @@ -217,7 +215,7 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { )?)?), QueryMsg::AllInactiveLimitOrderTranche { pagination } => Ok(to_json_binary( - &dexQuerier.inactive_limit_order_tranche_all(pagination)?, + &dex_querier.inactive_limit_order_tranche_all(pagination)?, )?), QueryMsg::AllPoolReserves { @@ -225,7 +223,7 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { token_in, pagination, } => Ok(to_json_binary( - &dexQuerier.pool_reserves_all(pair_id, token_in, pagination)?, + &dex_querier.pool_reserves_all(pair_id, token_in, pagination)?, )?), QueryMsg::GetPoolReserves { @@ -234,7 +232,7 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { tick_index, fee, } => Ok(to_json_binary( - &dexQuerier.pool_reserves(pair_id, token_in, tick_index, fee)?, + &dex_querier.pool_reserves(pair_id, token_in, tick_index, fee)?, )?), QueryMsg::EstimateMultiHopSwap { @@ -244,7 +242,7 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { amount_in, exit_limit_price, pick_best_route, - } => Ok(to_json_binary(&dexQuerier.estimate_multi_hop_swap( + } => Ok(to_json_binary(&dex_querier.estimate_multi_hop_swap( creator, receiver, routes, @@ -263,7 +261,7 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { order_type, expiration_time, max_amount_out, - } => Ok(to_json_binary(&dexQuerier.estimate_place_limit_order( + } => Ok(to_json_binary(&dex_querier.estimate_place_limit_order( creator, receiver, token_in, @@ -279,14 +277,16 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { pair_id, tick_index, fee, - } => Ok(to_json_binary(&dexQuerier.pool(pair_id, tick_index, fee)?)?), + } => Ok(to_json_binary( + &dex_querier.pool(pair_id, tick_index, fee)?, + )?), - QueryMsg::PoolById { pool_id } => Ok(to_json_binary(&dexQuerier.pool_by_id(pool_id)?)?), + QueryMsg::PoolById { pool_id } => Ok(to_json_binary(&dex_querier.pool_by_id(pool_id)?)?), - QueryMsg::GetPoolMetadata { id } => Ok(to_json_binary(&dexQuerier.pool_metadata(id)?)?), + QueryMsg::GetPoolMetadata { id } => Ok(to_json_binary(&dex_querier.pool_metadata(id)?)?), QueryMsg::AllPoolMetadata { pagination } => { - Ok(to_json_binary(&dexQuerier.pool_metadata_all(pagination)?)?) + Ok(to_json_binary(&dex_querier.pool_metadata_all(pagination)?)?) } } } diff --git a/contracts/dex_stargate/src/lib.rs b/contracts/dex_grpc/src/lib.rs similarity index 100% rename from contracts/dex_stargate/src/lib.rs rename to contracts/dex_grpc/src/lib.rs diff --git a/contracts/dex_stargate/src/msg.rs b/contracts/dex_grpc/src/msg.rs similarity index 100% rename from contracts/dex_stargate/src/msg.rs rename to contracts/dex_grpc/src/msg.rs diff --git a/contracts/echo/schema/execute_msg.json b/contracts/echo/schema/execute_msg.json index 7748c24..5b8a8c9 100644 --- a/contracts/echo/schema/execute_msg.json +++ b/contracts/echo/schema/execute_msg.json @@ -17,7 +17,8 @@ "msg": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false diff --git a/contracts/echo/schema/instantiate_msg.json b/contracts/echo/schema/instantiate_msg.json index 44588cf..1352613 100644 --- a/contracts/echo/schema/instantiate_msg.json +++ b/contracts/echo/schema/instantiate_msg.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "InstantiateMsg", - "type": "object" + "type": "object", + "additionalProperties": false } diff --git a/contracts/stargate_querier/.cargo/config b/contracts/grpc_querier/.cargo/config similarity index 79% rename from contracts/stargate_querier/.cargo/config rename to contracts/grpc_querier/.cargo/config index 406f9aa..91d6153 100644 --- a/contracts/stargate_querier/.cargo/config +++ b/contracts/grpc_querier/.cargo/config @@ -3,4 +3,4 @@ wasm = "build --release --target wasm32-unknown-unknown" wasm-debug = "build --target wasm32-unknown-unknown" unit-test = "test --lib" integration-test = "test --test integration" -schema = "run --example stargate_querier-schema" +schema = "run --example grpc_querier-schema" diff --git a/contracts/stargate_querier/Cargo.toml b/contracts/grpc_querier/Cargo.toml similarity index 78% rename from contracts/stargate_querier/Cargo.toml rename to contracts/grpc_querier/Cargo.toml index 8f1b1d1..a0f76f1 100644 --- a/contracts/stargate_querier/Cargo.toml +++ b/contracts/grpc_querier/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "stargate_querier" +name = "grpc_querier" version = "0.1.0" edition = "2021" @@ -26,11 +26,7 @@ schemars = { workspace = true } serde = { workspace = true } serde-json-wasm = { workspace = true } neutron-sdk = { workspace = true } - -# These dependencies are slightly outdated because of osmosis-std -osmosis-std = "0.19.2" -prost = "=0.11" -cosmos-sdk-proto = { version = "0.19.0", default-features = false } +prost = { workspace = true } [dev-dependencies] cosmwasm-schema = { workspace = true } diff --git a/contracts/grpc_querier/README.md b/contracts/grpc_querier/README.md new file mode 100644 index 0000000..d1be598 --- /dev/null +++ b/contracts/grpc_querier/README.md @@ -0,0 +1,5 @@ +# Description + +Simple contract for integration tests. + +Makes all kinds of grpc queries allowed for Neutron chain. diff --git a/contracts/stargate_querier/examples/stargate_querier-schema.rs b/contracts/grpc_querier/examples/grpc_querier-schema.rs similarity index 94% rename from contracts/stargate_querier/examples/stargate_querier-schema.rs rename to contracts/grpc_querier/examples/grpc_querier-schema.rs index 1f1a8dd..9fda562 100644 --- a/contracts/stargate_querier/examples/stargate_querier-schema.rs +++ b/contracts/grpc_querier/examples/grpc_querier-schema.rs @@ -17,7 +17,7 @@ use std::fs::create_dir_all; use cosmwasm_schema::{export_schema, remove_schemas, schema_for}; -use stargate_querier::msg::{ExecuteMsg, InstantiateMsg}; +use grpc_querier::msg::{ExecuteMsg, InstantiateMsg}; fn main() { let mut out_dir = current_dir().unwrap(); diff --git a/contracts/stargate_querier/schema/execute_msg.json b/contracts/grpc_querier/schema/execute_msg.json similarity index 62% rename from contracts/stargate_querier/schema/execute_msg.json rename to contracts/grpc_querier/schema/execute_msg.json index 9dcea53..d7e49d1 100644 --- a/contracts/stargate_querier/schema/execute_msg.json +++ b/contracts/grpc_querier/schema/execute_msg.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "ExecuteMsg", - "type": "object" + "type": "object", + "additionalProperties": false } diff --git a/contracts/dex_stargate/schema/instantiate_msg.json b/contracts/grpc_querier/schema/instantiate_msg.json similarity index 63% rename from contracts/dex_stargate/schema/instantiate_msg.json rename to contracts/grpc_querier/schema/instantiate_msg.json index 44588cf..1352613 100644 --- a/contracts/dex_stargate/schema/instantiate_msg.json +++ b/contracts/grpc_querier/schema/instantiate_msg.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "InstantiateMsg", - "type": "object" + "type": "object", + "additionalProperties": false } diff --git a/contracts/grpc_querier/src/contract.rs b/contracts/grpc_querier/src/contract.rs new file mode 100644 index 0000000..adee891 --- /dev/null +++ b/contracts/grpc_querier/src/contract.rs @@ -0,0 +1,198 @@ +use crate::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use cosmwasm_std::{ + entry_point, to_json_binary, Binary, ContractResult, Deps, DepsMut, Empty, Env, MessageInfo, + QueryRequest, Response, StdError, StdResult, SystemResult, +}; +use std::str::from_utf8; + +use crate::grpc; +use cw2::set_contract_version; +use neutron_sdk::proto_types::{ + cosmos::{auth, bank}, + ibc::{ + applications::transfer, + core::{client, connection}, + }, + neutron::{feeburner, interchainqueries, interchaintxs}, + osmosis::tokenfactory, +}; +use prost::Message; +use serde_json_wasm::to_vec; + +const CONTRACT_NAME: &str = concat!("crates.io:neutron-contracts__", env!("CARGO_PKG_NAME")); +const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); + +#[entry_point] +pub fn instantiate( + deps: DepsMut, + _env: Env, + _info: MessageInfo, + _msg: InstantiateMsg, +) -> StdResult { + deps.api.debug("WASMDEBUG: instantiate"); + set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?; + Ok(Response::default()) +} + +#[entry_point] +pub fn execute(_: DepsMut, _: Env, _: MessageInfo, _msg: ExecuteMsg) -> StdResult { + Ok(Response::default()) +} + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn query(deps: Deps, _: Env, msg: QueryMsg) -> StdResult { + deps.api + .debug(format!("WASMDEBUG: query: received msg: {:?}", msg).as_str()); + + let bank_querier = bank::v1beta1::BankQuerier::new(&deps.querier); + let auth_querier = auth::v1beta1::AuthQuerier::new(&deps.querier); + let transfer_querier = transfer::v1::TransferQuerier::new(&deps.querier); + let client_querier = client::v1::ClientQuerier::new(&deps.querier); + let connection_querier = connection::v1::ConnectionQuerier::new(&deps.querier); + let tokenfactory_querier = tokenfactory::v1beta1::TokenfactoryQuerier::new(&deps.querier); + let interchaintxs_querier = interchaintxs::v1::InterchaintxsQuerier::new(&deps.querier); + let interchainqueries_querier = interchainqueries::InterchainqueriesQuerier::new(&deps.querier); + let feeburner_querier = feeburner::FeeburnerQuerier::new(&deps.querier); + + match msg { + QueryMsg::BankBalance { address, denom } => { + Ok(to_json_binary(&bank_querier.balance(address, denom)?)?) + } + + QueryMsg::BankDenomMetadata { denom } => { + Ok(to_json_binary(&bank_querier.denom_metadata(denom)?)?) + } + + QueryMsg::BankParams {} => Ok(to_json_binary(&bank_querier.params()?)?), + + QueryMsg::BankSupplyOf { denom } => Ok(to_json_binary(&bank_querier.supply_of(denom)?)?), + + QueryMsg::AuthAccount { address } => Ok(to_json_binary(&auth_querier.account(address)?)?), + + QueryMsg::TransferDenomTrace { hash } => { + Ok(to_json_binary(&transfer_querier.denom_trace(hash)?)?) + } + + QueryMsg::IbcClientState { client_id } => { + Ok(to_json_binary(&client_querier.client_state(client_id)?)?) + } + + QueryMsg::IbcConsensusState { + client_id, + revision_number, + revision_height, + latest_height, + } => Ok(to_json_binary(&client_querier.consensus_state( + client_id, + revision_number, + revision_height, + latest_height, + )?)?), + + QueryMsg::IbcConnection { connection_id } => Ok(to_json_binary( + &connection_querier.connection(connection_id)?, + )?), + + QueryMsg::TokenfactoryParams {} => Ok(to_json_binary(&tokenfactory_querier.params()?)?), + + QueryMsg::TokenfactoryDenomAuthorityMetadata { creator, subdenom } => Ok(to_json_binary( + &tokenfactory_querier.denom_authority_metadata(creator, subdenom)?, + )?), + + QueryMsg::TokenfactoryDenomsFromCreator { creator } => Ok(to_json_binary( + &tokenfactory_querier.denoms_from_creator(creator)?, + )?), + + QueryMsg::ContractmanagerAddressFailures { address } => { + query_contractmanager_query_address_failures(deps, address) + } + + QueryMsg::ContractmanagerFailures { address } => { + query_contractmanager_query_failures(deps, address) + } + + QueryMsg::InterchaintxsParams {} => Ok(to_json_binary(&interchaintxs_querier.params()?)?), + + QueryMsg::InterchainqueriesParams {} => { + Ok(to_json_binary(&interchainqueries_querier.params()?)?) + } + + QueryMsg::FeeburnerParams {} => Ok(to_json_binary(&feeburner_querier.params()?)?), + + QueryMsg::FeeburnerTotalBurnedNeutronsAmount {} => { + // WARN: should not work since we did not allowlist it + // exists here only for testing purposes + Ok(to_json_binary( + &feeburner_querier.total_burned_neutrons_amount()?, + )?) + } + } +} + +// Can be refactored after https://hadronlabs.atlassian.net/browse/NTRN-359 is done +fn query_contractmanager_query_address_failures(deps: Deps, address: String) -> StdResult { + let msg = grpc::contractmanager::QueryAddressFailuresRequest { address }; + let mut bytes = Vec::new(); + Message::encode(&msg, &mut bytes).map_err(|_| StdError::generic_err("cannot encode proto"))?; + + let resp = make_stargate_query( + deps, + "/neutron.contractmanager.Query/AddressFailures".to_string(), + bytes, + )?; + + to_json_binary(&resp) +} + +// Can be refactored after https://hadronlabs.atlassian.net/browse/NTRN-359 is done +fn query_contractmanager_query_failures(deps: Deps, address: String) -> StdResult { + let msg = grpc::contractmanager::QueryFailuresRequest { + address, + pagination: None, + }; + let mut bytes = Vec::new(); + Message::encode(&msg, &mut bytes).map_err(|_| StdError::generic_err("cannot encode proto"))?; + + let resp = make_stargate_query( + deps, + "/neutron.contractmanager.Query/Failures".to_string(), + bytes, + )?; + + to_json_binary(&resp) +} + +// Can be removed after https://hadronlabs.atlassian.net/browse/NTRN-359 is done +pub fn make_stargate_query( + deps: Deps, + path: String, + encoded_query_data: Vec, +) -> StdResult { + #[allow(deprecated)] + let raw = to_vec::>(&QueryRequest::Stargate { + path, + data: encoded_query_data.into(), + }) + .map_err(|serialize_err| { + StdError::generic_err(format!("Serializing QueryRequest: {}", serialize_err)) + })?; + match deps.querier.raw_query(&raw) { + SystemResult::Err(system_err) => Err(StdError::generic_err(format!( + "Querier system error: {}", + system_err + ))), + SystemResult::Ok(ContractResult::Err(contract_err)) => Err(StdError::generic_err(format!( + "Querier contract error: {}", + contract_err + ))), + // response(value) is base64 encoded bytes + SystemResult::Ok(ContractResult::Ok(value)) => { + let str = value.to_base64(); + deps.api + .debug(format!("WASMDEBUG: make_stargate_query: {:?}", str).as_str()); + from_utf8(value.as_slice()) + .map(|s| s.to_string()) + .map_err(|_e| StdError::generic_err("Unable to encode from utf8")) + } + } +} diff --git a/contracts/grpc_querier/src/grpc.rs b/contracts/grpc_querier/src/grpc.rs new file mode 100644 index 0000000..647311e --- /dev/null +++ b/contracts/grpc_querier/src/grpc.rs @@ -0,0 +1,17 @@ +pub mod contractmanager { + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct QueryAddressFailuresRequest { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + } + + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct QueryFailuresRequest { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + ::neutron_sdk::proto_types::cosmos::base::query::v1beta1::PageRequest, + >, + } +} diff --git a/contracts/stargate_querier/src/lib.rs b/contracts/grpc_querier/src/lib.rs similarity index 95% rename from contracts/stargate_querier/src/lib.rs rename to contracts/grpc_querier/src/lib.rs index fab37e5..98ab7aa 100644 --- a/contracts/stargate_querier/src/lib.rs +++ b/contracts/grpc_querier/src/lib.rs @@ -15,6 +15,5 @@ #![warn(clippy::unwrap_used, clippy::expect_used)] pub mod contract; +mod grpc; pub mod msg; -mod stargate; -pub mod state; diff --git a/contracts/stargate_querier/src/msg.rs b/contracts/grpc_querier/src/msg.rs similarity index 94% rename from contracts/stargate_querier/src/msg.rs rename to contracts/grpc_querier/src/msg.rs index 61b0022..0cecf8e 100644 --- a/contracts/stargate_querier/src/msg.rs +++ b/contracts/grpc_querier/src/msg.rs @@ -42,7 +42,8 @@ pub enum QueryMsg { }, TokenfactoryParams {}, TokenfactoryDenomAuthorityMetadata { - denom: String, + creator: String, + subdenom: String, }, TokenfactoryDenomsFromCreator { creator: String, @@ -53,7 +54,7 @@ pub enum QueryMsg { ContractmanagerFailures { address: String, }, - InterchaintxParams {}, + InterchaintxsParams {}, InterchainqueriesParams {}, FeeburnerParams {}, FeeburnerTotalBurnedNeutronsAmount {}, diff --git a/contracts/stargate_querier/src/state.rs b/contracts/grpc_querier/src/state.rs similarity index 100% rename from contracts/stargate_querier/src/state.rs rename to contracts/grpc_querier/src/state.rs diff --git a/contracts/ibc_transfer/schema/execute_msg.json b/contracts/ibc_transfer/schema/execute_msg.json index 97a22b7..a2b8c9e 100644 --- a/contracts/ibc_transfer/schema/execute_msg.json +++ b/contracts/ibc_transfer/schema/execute_msg.json @@ -37,7 +37,8 @@ "to": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -69,7 +70,8 @@ "timeout_fee": { "$ref": "#/definitions/Uint128" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -91,7 +93,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -112,7 +115,8 @@ "state": { "$ref": "#/definitions/IntegrationTestsSudoFailureMock" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -125,7 +129,8 @@ ], "properties": { "integration_tests_unset_sudo_failure_mock": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false diff --git a/contracts/ibc_transfer/schema/instantiate_msg.json b/contracts/ibc_transfer/schema/instantiate_msg.json index 44588cf..1352613 100644 --- a/contracts/ibc_transfer/schema/instantiate_msg.json +++ b/contracts/ibc_transfer/schema/instantiate_msg.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "InstantiateMsg", - "type": "object" + "type": "object", + "additionalProperties": false } diff --git a/contracts/marketmap/schema/instantiate_msg.json b/contracts/marketmap/schema/instantiate_msg.json index 44588cf..1352613 100644 --- a/contracts/marketmap/schema/instantiate_msg.json +++ b/contracts/marketmap/schema/instantiate_msg.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "InstantiateMsg", - "type": "object" + "type": "object", + "additionalProperties": false } diff --git a/contracts/marketmap/schema/market_map_query.json b/contracts/marketmap/schema/market_map_query.json index 7165aeb..35df8e8 100644 --- a/contracts/marketmap/schema/market_map_query.json +++ b/contracts/marketmap/schema/market_map_query.json @@ -10,7 +10,8 @@ ], "properties": { "params": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -22,7 +23,8 @@ ], "properties": { "last_updated": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -34,7 +36,8 @@ ], "properties": { "market_map": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -54,7 +57,8 @@ "currency_pair": { "$ref": "#/definitions/CurrencyPair" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -74,7 +78,8 @@ "Quote": { "type": "string" } - } + }, + "additionalProperties": false } } } diff --git a/contracts/msg_receiver/schema/execute_msg.json b/contracts/msg_receiver/schema/execute_msg.json index f069039..5826d6a 100644 --- a/contracts/msg_receiver/schema/execute_msg.json +++ b/contracts/msg_receiver/schema/execute_msg.json @@ -21,7 +21,8 @@ "return_err": { "type": "boolean" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -33,7 +34,8 @@ ], "properties": { "call_staking": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false diff --git a/contracts/msg_receiver/schema/instantiate_msg.json b/contracts/msg_receiver/schema/instantiate_msg.json index 44588cf..1352613 100644 --- a/contracts/msg_receiver/schema/instantiate_msg.json +++ b/contracts/msg_receiver/schema/instantiate_msg.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "InstantiateMsg", - "type": "object" + "type": "object", + "additionalProperties": false } diff --git a/contracts/neutron_interchain_queries/schema/execute_msg.json b/contracts/neutron_interchain_queries/schema/execute_msg.json index cc7022e..2b7f86e 100644 --- a/contracts/neutron_interchain_queries/schema/execute_msg.json +++ b/contracts/neutron_interchain_queries/schema/execute_msg.json @@ -34,7 +34,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -67,7 +68,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -93,7 +95,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -126,7 +129,8 @@ "type": "string" } } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -161,7 +165,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -203,7 +208,8 @@ "type": "string" } } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -241,7 +247,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -278,7 +285,8 @@ "type": "string" } } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -315,7 +323,8 @@ "type": "string" } } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -348,7 +357,8 @@ "type": "string" } } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -393,7 +403,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -415,7 +426,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -436,7 +448,8 @@ "connection_id": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -457,7 +470,8 @@ "connection_id": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -478,7 +492,8 @@ "connection_id": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -491,7 +506,8 @@ ], "properties": { "integration_tests_set_query_mock": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -504,7 +520,8 @@ ], "properties": { "integration_tests_unset_query_mock": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -535,7 +552,8 @@ "description": "*path** is a path to the storage (storage prefix) where you want to read value by key (usually name of cosmos-packages module: 'staking', 'bank', etc.)", "type": "string" } - } + }, + "additionalProperties": false } } } diff --git a/contracts/neutron_interchain_queries/schema/instantiate_msg.json b/contracts/neutron_interchain_queries/schema/instantiate_msg.json index 44588cf..1352613 100644 --- a/contracts/neutron_interchain_queries/schema/instantiate_msg.json +++ b/contracts/neutron_interchain_queries/schema/instantiate_msg.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "InstantiateMsg", - "type": "object" + "type": "object", + "additionalProperties": false } diff --git a/contracts/neutron_interchain_queries/schema/query_msg.json b/contracts/neutron_interchain_queries/schema/query_msg.json index 8deb564..939d527 100644 --- a/contracts/neutron_interchain_queries/schema/query_msg.json +++ b/contracts/neutron_interchain_queries/schema/query_msg.json @@ -19,7 +19,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -41,7 +42,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -63,7 +65,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -85,7 +88,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -107,7 +111,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -129,7 +134,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -151,7 +157,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -173,7 +180,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -195,7 +203,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -217,7 +226,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -237,7 +247,8 @@ "recipient": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -259,7 +270,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -271,7 +283,8 @@ ], "properties": { "get_transfers_number": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false diff --git a/contracts/neutron_interchain_txs/schema/execute_msg.json b/contracts/neutron_interchain_txs/schema/execute_msg.json index 4817dcc..6841b02 100644 --- a/contracts/neutron_interchain_txs/schema/execute_msg.json +++ b/contracts/neutron_interchain_txs/schema/execute_msg.json @@ -21,7 +21,8 @@ "interchain_account_id": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -53,7 +54,8 @@ "timeout_fee": { "$ref": "#/definitions/Uint128" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -93,7 +95,8 @@ "validator": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -133,7 +136,8 @@ "validator": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -173,7 +177,8 @@ "validator": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -185,7 +190,8 @@ ], "properties": { "clean_ack_results": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -207,7 +213,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -228,7 +235,8 @@ "state": { "$ref": "#/definitions/IntegrationTestsSudoFailureMock" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -241,7 +249,8 @@ ], "properties": { "integration_tests_set_sudo_submsg_failure_mock": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -254,7 +263,8 @@ ], "properties": { "integration_tests_set_sudo_submsg_reply_failure_mock": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -267,7 +277,8 @@ ], "properties": { "integration_tests_unset_sudo_failure_mock": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -280,7 +291,8 @@ ], "properties": { "integration_tests_sudo_submsg": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false diff --git a/contracts/neutron_interchain_txs/schema/instantiate_msg.json b/contracts/neutron_interchain_txs/schema/instantiate_msg.json index 44588cf..1352613 100644 --- a/contracts/neutron_interchain_txs/schema/instantiate_msg.json +++ b/contracts/neutron_interchain_txs/schema/instantiate_msg.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "InstantiateMsg", - "type": "object" + "type": "object", + "additionalProperties": false } diff --git a/contracts/neutron_interchain_txs/schema/migrate_msg.json b/contracts/neutron_interchain_txs/schema/migrate_msg.json index 87b18ea..7fbe8c5 100644 --- a/contracts/neutron_interchain_txs/schema/migrate_msg.json +++ b/contracts/neutron_interchain_txs/schema/migrate_msg.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "MigrateMsg", - "type": "object" + "type": "object", + "additionalProperties": false } diff --git a/contracts/neutron_interchain_txs/schema/query_interchain_account_address_response.json b/contracts/neutron_interchain_txs/schema/query_interchain_account_address_response.json index acc40bc..d1314a5 100644 --- a/contracts/neutron_interchain_txs/schema/query_interchain_account_address_response.json +++ b/contracts/neutron_interchain_txs/schema/query_interchain_account_address_response.json @@ -10,5 +10,6 @@ "description": "*interchain_account_address** is a interchain account address on the remote chain", "type": "string" } - } + }, + "additionalProperties": false } diff --git a/contracts/neutron_interchain_txs/schema/query_msg.json b/contracts/neutron_interchain_txs/schema/query_msg.json index c0c6eff..dab456e 100644 --- a/contracts/neutron_interchain_txs/schema/query_msg.json +++ b/contracts/neutron_interchain_txs/schema/query_msg.json @@ -22,7 +22,8 @@ "interchain_account_id": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -42,7 +43,8 @@ "interchain_account_id": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -68,7 +70,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -80,7 +83,8 @@ ], "properties": { "acknowledgement_results": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -92,7 +96,8 @@ ], "properties": { "errors_queue": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false diff --git a/contracts/neutron_interchain_txs/schema/sudo_msg.json b/contracts/neutron_interchain_txs/schema/sudo_msg.json index 92582ab..de8ad10 100644 --- a/contracts/neutron_interchain_txs/schema/sudo_msg.json +++ b/contracts/neutron_interchain_txs/schema/sudo_msg.json @@ -21,7 +21,8 @@ "request": { "$ref": "#/definitions/RequestPacket" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -45,7 +46,8 @@ "request": { "$ref": "#/definitions/RequestPacket" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -65,7 +67,8 @@ "request": { "$ref": "#/definitions/RequestPacket" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -97,7 +100,8 @@ "port_id": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -127,7 +131,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -149,7 +154,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -177,7 +183,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false }, "RequestPacket": { "type": "object", @@ -242,7 +249,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false }, "RequestPacketTimeoutHeight": { "type": "object", @@ -263,7 +271,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } } } diff --git a/contracts/neutron_validator_test/schema/execute_msg.json b/contracts/neutron_validator_test/schema/execute_msg.json index a38c6d8..eb131e0 100644 --- a/contracts/neutron_validator_test/schema/execute_msg.json +++ b/contracts/neutron_validator_test/schema/execute_msg.json @@ -21,7 +21,8 @@ "interchain_account_id": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -61,7 +62,8 @@ "validator": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -101,7 +103,8 @@ "validator": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -113,7 +116,8 @@ ], "properties": { "clean_ack_results": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -125,7 +129,8 @@ ], "properties": { "clean_recipient_txs": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -157,7 +162,8 @@ "timeout_fee": { "$ref": "#/definitions/Uint128" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -191,7 +197,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -229,7 +236,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -251,7 +259,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false diff --git a/contracts/neutron_validator_test/schema/instantiate_msg.json b/contracts/neutron_validator_test/schema/instantiate_msg.json index 44588cf..1352613 100644 --- a/contracts/neutron_validator_test/schema/instantiate_msg.json +++ b/contracts/neutron_validator_test/schema/instantiate_msg.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "InstantiateMsg", - "type": "object" + "type": "object", + "additionalProperties": false } diff --git a/contracts/neutron_validator_test/schema/query_interchain_account_address_response.json b/contracts/neutron_validator_test/schema/query_interchain_account_address_response.json index acc40bc..d1314a5 100644 --- a/contracts/neutron_validator_test/schema/query_interchain_account_address_response.json +++ b/contracts/neutron_validator_test/schema/query_interchain_account_address_response.json @@ -10,5 +10,6 @@ "description": "*interchain_account_address** is a interchain account address on the remote chain", "type": "string" } - } + }, + "additionalProperties": false } diff --git a/contracts/neutron_validator_test/schema/query_msg.json b/contracts/neutron_validator_test/schema/query_msg.json index a533a1b..dbcb377 100644 --- a/contracts/neutron_validator_test/schema/query_msg.json +++ b/contracts/neutron_validator_test/schema/query_msg.json @@ -22,7 +22,8 @@ "interchain_account_id": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -42,7 +43,8 @@ "interchain_account_id": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -68,7 +70,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -80,7 +83,8 @@ ], "properties": { "last_ack_seq_id": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -102,7 +106,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -122,7 +127,8 @@ "recipient": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false diff --git a/contracts/neutron_validator_test/schema/sudo_msg.json b/contracts/neutron_validator_test/schema/sudo_msg.json index 92582ab..de8ad10 100644 --- a/contracts/neutron_validator_test/schema/sudo_msg.json +++ b/contracts/neutron_validator_test/schema/sudo_msg.json @@ -21,7 +21,8 @@ "request": { "$ref": "#/definitions/RequestPacket" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -45,7 +46,8 @@ "request": { "$ref": "#/definitions/RequestPacket" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -65,7 +67,8 @@ "request": { "$ref": "#/definitions/RequestPacket" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -97,7 +100,8 @@ "port_id": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -127,7 +131,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -149,7 +154,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -177,7 +183,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false }, "RequestPacket": { "type": "object", @@ -242,7 +249,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false }, "RequestPacketTimeoutHeight": { "type": "object", @@ -263,7 +271,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } } } diff --git a/contracts/oracle/schema/instantiate_msg.json b/contracts/oracle/schema/instantiate_msg.json index 44588cf..1352613 100644 --- a/contracts/oracle/schema/instantiate_msg.json +++ b/contracts/oracle/schema/instantiate_msg.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "InstantiateMsg", - "type": "object" + "type": "object", + "additionalProperties": false } diff --git a/contracts/oracle/schema/oracle_query.json b/contracts/oracle/schema/oracle_query.json index fd1d550..c337977 100644 --- a/contracts/oracle/schema/oracle_query.json +++ b/contracts/oracle/schema/oracle_query.json @@ -9,7 +9,8 @@ ], "properties": { "get_all_currency_pairs": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -29,7 +30,8 @@ "currency_pair": { "$ref": "#/definitions/CurrencyPair" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -52,7 +54,8 @@ "type": "string" } } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -72,7 +75,8 @@ "Quote": { "type": "string" } - } + }, + "additionalProperties": false } } } diff --git a/contracts/reflect/schema/execute_msg.json b/contracts/reflect/schema/execute_msg.json index 11859e1..ac3033f 100644 --- a/contracts/reflect/schema/execute_msg.json +++ b/contracts/reflect/schema/execute_msg.json @@ -21,7 +21,8 @@ "to": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -44,7 +45,8 @@ "$ref": "#/definitions/CosmosMsg_for_NeutronMsg" } } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -222,7 +224,8 @@ "value": { "$ref": "#/definitions/Binary" } - } + }, + "additionalProperties": false }, "BankMsg": { "description": "The message types of the bank module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto", @@ -250,7 +253,8 @@ "to_address": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -274,7 +278,8 @@ "$ref": "#/definitions/Coin" } } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -302,7 +307,8 @@ "description": "*title** is a text title of proposal. Non unique.", "type": "string" } - } + }, + "additionalProperties": false }, "ClearAdminProposal": { "description": "Deprecated. SudoContractProposal defines the struct for clear admin proposal.", @@ -326,7 +332,8 @@ "description": "*title** is a text title of proposal.", "type": "string" } - } + }, + "additionalProperties": false }, "ClientUpdateProposal": { "description": "ClientUpdateProposal defines the struct for client update proposal.", @@ -355,7 +362,8 @@ "description": "*title** is a text title of proposal.", "type": "string" } - } + }, + "additionalProperties": false }, "Coin": { "type": "object", @@ -370,7 +378,8 @@ "denom": { "type": "string" } - } + }, + "additionalProperties": false }, "CosmosMsg_for_NeutronMsg": { "oneOf": [ @@ -443,7 +452,8 @@ "value": { "$ref": "#/definitions/Binary" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -526,7 +536,8 @@ "format": "uint32", "minimum": 0.0 } - } + }, + "additionalProperties": false }, "DepositOption": { "type": "object", @@ -537,7 +548,8 @@ "disable_swap": { "type": "boolean" } - } + }, + "additionalProperties": false }, "DexMsg": { "oneOf": [ @@ -611,7 +623,8 @@ "description": "Denom for the opposing side of the deposit", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -670,7 +683,8 @@ "description": "Denom for the opposing side of the deposit", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -751,7 +765,8 @@ "description": "Token being “bought”", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -773,7 +788,8 @@ "description": "TrancheKey for the target limit order", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -795,7 +811,8 @@ "description": "TrancheKey for the target limit order", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -848,7 +865,8 @@ "$ref": "#/definitions/MultiHopRoute" } } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -875,7 +893,8 @@ "description": "The `withdraw_address`", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -897,7 +916,8 @@ "description": "The `validator_address`", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -922,7 +942,8 @@ "$ref": "#/definitions/Coin" } } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -959,7 +980,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -989,7 +1011,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1026,7 +1049,8 @@ "$ref": "#/definitions/Coin" } } - } + }, + "additionalProperties": false }, "IbcMsg": { "description": "These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts (contracts that directly speak the IBC protocol via 6 entry points)", @@ -1078,7 +1102,8 @@ "description": "address on the remote chain to receive these tokens", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1112,7 +1137,8 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1133,7 +1159,8 @@ "channel_id": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1164,7 +1191,8 @@ } ] } - } + }, + "additionalProperties": false }, "IbcTimeoutBlock": { "description": "IBCTimeoutHeight Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients. Ordering is (revision_number, timeout_height)", @@ -1186,7 +1214,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false }, "KVKey": { "description": "Describes a KV key for which you want to get value from the storage on remote chain", @@ -1208,7 +1237,8 @@ "description": "*path** is a path to the storage (storage prefix) where you want to read value by key (usually name of cosmos-packages module: 'staking', 'bank', etc.)", "type": "string" } - } + }, + "additionalProperties": false }, "LimitOrderType": { "oneOf": [ @@ -1265,7 +1295,8 @@ "description": "*msg** is a contract call message", "type": "string" } - } + }, + "additionalProperties": false }, "MultiHopRoute": { "type": "object", @@ -1279,7 +1310,8 @@ "type": "string" } } - } + }, + "additionalProperties": false }, "NeutronMsg": { "description": "A number of Custom messages that can call into the Neutron bindings.", @@ -1316,7 +1348,8 @@ "$ref": "#/definitions/Coin" } } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1372,7 +1405,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1419,7 +1453,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1469,7 +1504,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1493,7 +1529,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1548,7 +1585,8 @@ "token": { "$ref": "#/definitions/Coin" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1569,7 +1607,8 @@ "admin_proposal": { "$ref": "#/definitions/AdminProposal" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1590,7 +1629,8 @@ "subdenom": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1615,7 +1655,8 @@ "new_admin_address": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1644,7 +1685,8 @@ "mint_to_address": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1674,7 +1716,8 @@ "denom": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1699,7 +1742,8 @@ "denom": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1732,7 +1776,8 @@ "transfer_to_address": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1792,7 +1837,8 @@ "description": "**uri_hash** is a sha256 hash of a document pointed by URI. It's used to verify that the document didn't change. Optional.", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1829,7 +1875,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1850,7 +1897,8 @@ "name": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1873,7 +1921,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -1914,7 +1963,8 @@ "description": "*value** is a new value for given parameter. Non unique.", "type": "string" } - } + }, + "additionalProperties": false }, "ParamChangeProposal": { "description": "ParamChangeProposal defines the struct for single parameter change proposal.", @@ -1940,7 +1990,8 @@ "description": "*title** is a text title of proposal. Non unique.", "type": "string" } - } + }, + "additionalProperties": false }, "PinCodesProposal": { "description": "Deprecated. PinCodesProposal defines the struct for pin contract codes proposal.", @@ -1969,7 +2020,8 @@ "description": "*title** is a text title of proposal.", "type": "string" } - } + }, + "additionalProperties": false }, "Plan": { "description": "Plan defines the struct for planned upgrade.", @@ -1993,7 +2045,8 @@ "description": "*name** is a name for the upgrade", "type": "string" } - } + }, + "additionalProperties": false }, "PrecDec": { "type": "object", @@ -2004,7 +2057,8 @@ "i": { "type": "string" } - } + }, + "additionalProperties": false }, "ProposalExecuteMessage": { "description": "ProposalExecuteMessage defines the struct for sdk47 compatible admin proposal.", @@ -2017,7 +2071,8 @@ "description": "*message** is a json representing an sdk message passed to admin module to execute.", "type": "string" } - } + }, + "additionalProperties": false }, "ProtobufAny": { "description": "Type for wrapping any protobuf message", @@ -2039,7 +2094,8 @@ } ] } - } + }, + "additionalProperties": false }, "RequestPacketTimeoutHeight": { "type": "object", @@ -2060,7 +2116,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false }, "SoftwareUpgradeProposal": { "description": "Deprecated. SoftwareUpgradeProposal defines the struct for software upgrade proposal.", @@ -2088,7 +2145,8 @@ "description": "*title** is a text title of proposal. Non unique.", "type": "string" } - } + }, + "additionalProperties": false }, "StakingMsg": { "description": "The message types of the staking module.\n\nSee https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto", @@ -2113,7 +2171,8 @@ "validator": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -2138,7 +2197,8 @@ "validator": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -2167,7 +2227,8 @@ "src_validator": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -2205,7 +2266,8 @@ "description": "*title** is a text title of proposal.", "type": "string" } - } + }, + "additionalProperties": false }, "Timestamp": { "description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```", @@ -2250,7 +2312,8 @@ "description": "*title** is a text title of proposal.", "type": "string" } - } + }, + "additionalProperties": false }, "UpdateAdminProposal": { "description": "Deprecated. UpdateAdminProposal defines the struct for update admin proposal.", @@ -2279,7 +2342,8 @@ "description": "*title** is a text title of proposal.", "type": "string" } - } + }, + "additionalProperties": false }, "UpgradeProposal": { "description": "UpgradeProposal defines the struct for IBC upgrade proposal.", @@ -2316,7 +2380,8 @@ } ] } - } + }, + "additionalProperties": false }, "VoteOption": { "type": "string", @@ -2362,7 +2427,8 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -2412,7 +2478,8 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -2466,7 +2533,8 @@ "salt": { "$ref": "#/definitions/Binary" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -2503,7 +2571,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -2528,7 +2597,8 @@ "contract_addr": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -2549,7 +2619,8 @@ "contract_addr": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -2569,7 +2640,8 @@ "weight": { "$ref": "#/definitions/Decimal" } - } + }, + "additionalProperties": false } } } diff --git a/contracts/reflect/schema/instantiate_msg.json b/contracts/reflect/schema/instantiate_msg.json index 44588cf..1352613 100644 --- a/contracts/reflect/schema/instantiate_msg.json +++ b/contracts/reflect/schema/instantiate_msg.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "InstantiateMsg", - "type": "object" + "type": "object", + "additionalProperties": false } diff --git a/contracts/reflect/schema/query_msg.json b/contracts/reflect/schema/query_msg.json index 76128e6..bc4cdcc 100644 --- a/contracts/reflect/schema/query_msg.json +++ b/contracts/reflect/schema/query_msg.json @@ -34,7 +34,8 @@ "denom": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -59,7 +60,8 @@ "denom": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -80,7 +82,8 @@ "address": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -101,7 +104,8 @@ "denom": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -126,7 +130,8 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -155,7 +160,8 @@ "delegator_address": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -180,7 +186,8 @@ "validator_address": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -201,7 +208,8 @@ "delegator_address": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -222,7 +230,8 @@ "delegator_address": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -230,7 +239,7 @@ ] }, "GrpcQuery": { - "description": "Queries the chain using a grpc query. This allows to query information that is not exposed in our API. The chain needs to allowlist the supported queries. The drawback of this query is that you have to handle the protobuf encoding and decoding yourself.\n\nThe returned data is protobuf encoded. The protobuf type depends on the query.\n\nTo find the path, as well as the request and response types, you can query the chain's gRPC endpoint using a tool like [grpcurl](https://github.com/fullstorydev/grpcurl).", + "description": "Queries the chain using a grpc query. This allows to query information that is not exposed in our API. The chain needs to allowlist the supported queries. The drawback of this query is that you have to handle the protobuf encoding and decoding yourself.\n\nThe returned data is protobuf encoded. The protobuf type depends on the query. Because of this, using it with the [`query`](crate::QuerierWrapper::query) function will result in a deserialization error. Use [`raw_query`](crate::Querier::raw_query) or [`query_grpc`](crate::QuerierWrapper::query_grpc) instead.\n\nTo find the path, as well as the request and response types, you can query the chain's gRPC endpoint using a tool like [grpcurl](https://github.com/fullstorydev/grpcurl).", "type": "object", "required": [ "data", @@ -249,7 +258,8 @@ "description": "The fully qualified endpoint path used for routing. It follows the format `/service_path/method_name`, eg. \"/cosmos.authz.v1beta1.Query/Grants\"", "type": "string" } - } + }, + "additionalProperties": false }, "IbcQuery": { "description": "These are queries to the various IBC modules to see the state of the contract's IBC connection. These will return errors if the contract is not \"ibc enabled\"", @@ -262,7 +272,8 @@ ], "properties": { "port_id": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -283,7 +294,8 @@ "null" ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -310,7 +322,8 @@ "null" ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -336,7 +349,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -364,7 +378,8 @@ "owner_address": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -376,7 +391,8 @@ ], "properties": { "registered_interchain_queries": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -398,7 +414,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -410,7 +427,8 @@ ], "properties": { "min_ibc_fee": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -434,7 +452,8 @@ "subdenom": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -454,7 +473,8 @@ "subdenom": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -487,7 +507,8 @@ "reverse": { "type": "boolean" } - } + }, + "additionalProperties": false }, "QueryRequest_for_InterchainQueries": { "oneOf": [ @@ -566,7 +587,8 @@ "description": "this is the fully qualified service path used for routing, eg. \"/cosmos_sdk.x.bank.v1.Query/QueryBalance\"", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -619,7 +641,8 @@ ], "properties": { "bonded_denom": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -640,7 +663,8 @@ "delegator": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -665,7 +689,8 @@ "validator": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -678,7 +703,8 @@ ], "properties": { "all_validators": { - "type": "object" + "type": "object", + "additionalProperties": false } }, "additionalProperties": false @@ -700,7 +726,8 @@ "description": "The validator's address (e.g. (e.g. cosmosvaloper1...))", "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -734,7 +761,8 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -764,7 +792,8 @@ } ] } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -785,7 +814,8 @@ "contract_addr": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -808,7 +838,8 @@ "format": "uint64", "minimum": 0.0 } - } + }, + "additionalProperties": false } }, "additionalProperties": false diff --git a/contracts/stargate_querier/README.md b/contracts/stargate_querier/README.md deleted file mode 100644 index 62142d7..0000000 --- a/contracts/stargate_querier/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Description - -Simple contract for integration tests. - -Makes all kinds of stargate queries allowed for Neutron chain. diff --git a/contracts/stargate_querier/src/contract.rs b/contracts/stargate_querier/src/contract.rs deleted file mode 100644 index d996ad5..0000000 --- a/contracts/stargate_querier/src/contract.rs +++ /dev/null @@ -1,346 +0,0 @@ -use crate::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; -use cosmos_sdk_proto::{ - cosmos::{auth, bank}, - ibc, -}; -use cosmwasm_std::{ - entry_point, to_json_binary, Binary, ContractResult, Deps, DepsMut, Empty, Env, MessageInfo, - QueryRequest, Response, StdError, StdResult, SystemResult, -}; -use std::str::from_utf8; - -use crate::stargate; -use cw2::set_contract_version; -use neutron_sdk::bindings::msg::NeutronMsg; -use neutron_sdk::NeutronResult; -use prost::Message; -use serde_json_wasm::to_vec; - -const CONTRACT_NAME: &str = concat!("crates.io:neutron-contracts__", env!("CARGO_PKG_NAME")); -const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); - -#[entry_point] -pub fn instantiate( - deps: DepsMut, - _env: Env, - _info: MessageInfo, - _msg: InstantiateMsg, -) -> StdResult { - deps.api.debug("WASMDEBUG: instantiate"); - set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?; - Ok(Response::default()) -} - -#[entry_point] -pub fn execute( - _: DepsMut, - _: Env, - _: MessageInfo, - _msg: ExecuteMsg, -) -> StdResult> { - Ok(Response::default()) -} - -#[cfg_attr(not(feature = "library"), entry_point)] -pub fn query(deps: Deps, _: Env, msg: QueryMsg) -> NeutronResult { - deps.api - .debug(format!("WASMDEBUG: execute: received msg: {:?}", msg).as_str()); - match msg { - QueryMsg::BankBalance { address, denom } => query_bank_balance(deps, address, denom), - QueryMsg::BankDenomMetadata { denom } => query_bank_denom_metadata(deps, denom), - QueryMsg::BankParams {} => query_bank_params(deps), - QueryMsg::BankSupplyOf { denom } => query_bank_supply_of(deps, denom), - QueryMsg::AuthAccount { address } => query_auth_account(deps, address), - QueryMsg::TransferDenomTrace { hash } => query_transfer_denom_trace(deps, hash), - QueryMsg::IbcClientState { client_id } => query_ibc_client_state(deps, client_id), - QueryMsg::IbcConsensusState { - client_id, - revision_number, - revision_height, - latest_height, - } => query_ibc_consensus_state( - deps, - client_id, - revision_number, - revision_height, - latest_height, - ), - QueryMsg::IbcConnection { connection_id } => query_ibc_connection(deps, connection_id), - QueryMsg::TokenfactoryParams {} => query_tokenfactory_params(deps), - QueryMsg::TokenfactoryDenomAuthorityMetadata { denom } => { - query_tokenfactory_denom_authority_metadata(deps, denom) - } - QueryMsg::TokenfactoryDenomsFromCreator { creator } => { - query_tokenfactory_denoms_from_creator(deps, creator) - } - QueryMsg::ContractmanagerAddressFailures { address } => { - query_contractmanager_query_address_failures(deps, address) - } - QueryMsg::ContractmanagerFailures { address } => { - query_contractmanager_query_failures(deps, address) - } - QueryMsg::InterchaintxParams {} => query_interchaintx_params(deps), - QueryMsg::InterchainqueriesParams {} => query_interchainqueries_params(deps), - QueryMsg::FeeburnerParams {} => query_feeburner_params(deps), - QueryMsg::FeeburnerTotalBurnedNeutronsAmount {} => { - query_feeburner_total_burned_neutrons_amount(deps) - } - } -} - -fn query_bank_balance(deps: Deps, address: String, denom: String) -> NeutronResult { - let msg = bank::v1beta1::QueryBalanceRequest { address, denom }; - let resp = make_stargate_query( - deps, - "/cosmos.bank.v1beta1.Query/Balance".to_string(), - msg.encode_to_vec(), - )?; - - Ok(to_json_binary(&resp)?) -} - -fn query_bank_denom_metadata(deps: Deps, denom: String) -> NeutronResult { - let msg = bank::v1beta1::QueryDenomMetadataRequest { denom }; - let mut bytes = Vec::new(); - Message::encode(&msg, &mut bytes).map_err(|_| StdError::generic_err("cannot encode proto"))?; - - let resp = make_stargate_query( - deps, - "/cosmos.bank.v1beta1.Query/DenomMetadata".to_string(), - bytes, - )?; - - Ok(to_json_binary(&resp)?) -} - -fn query_bank_params(deps: Deps) -> NeutronResult { - let msg = bank::v1beta1::QueryParamsRequest {}; - let mut bytes = Vec::new(); - Message::encode(&msg, &mut bytes).map_err(|_| StdError::generic_err("cannot encode proto"))?; - - let resp = make_stargate_query(deps, "/cosmos.bank.v1beta1.Query/Params".to_string(), bytes)?; - Ok(to_json_binary(&resp)?) -} - -fn query_bank_supply_of(deps: Deps, denom: String) -> NeutronResult { - let msg = bank::v1beta1::QuerySupplyOfRequest { denom }; - let resp = make_stargate_query( - deps, - "/cosmos.bank.v1beta1.Query/SupplyOf".to_string(), - Message::encode_to_vec(&msg), - )?; - - Ok(to_json_binary(&resp)?) -} - -fn query_auth_account(deps: Deps, address: String) -> NeutronResult { - let msg = auth::v1beta1::QueryAccountRequest { address }; - let resp = make_stargate_query( - deps, - "/cosmos.auth.v1beta1.Query/Account".to_string(), - msg.encode_to_vec(), - )?; - - Ok(to_json_binary(&resp)?) -} - -fn query_transfer_denom_trace(deps: Deps, hash: String) -> NeutronResult { - let msg = ibc::applications::transfer::v1::QueryDenomTraceRequest { hash }; - let resp = make_stargate_query( - deps, - "/ibc.applications.transfer.v1.Query/DenomTrace".to_string(), - msg.encode_to_vec(), - )?; - - Ok(to_json_binary(&resp)?) -} - -fn query_ibc_client_state(deps: Deps, client_id: String) -> NeutronResult { - let msg = ibc::core::client::v1::QueryClientStateRequest { client_id }; - let resp = make_stargate_query( - deps, - "/ibc.core.client.v1.Query/ClientState".to_string(), - msg.encode_to_vec(), - )?; - - Ok(to_json_binary(&resp)?) -} - -fn query_ibc_consensus_state( - deps: Deps, - client_id: String, - revision_number: u64, - revision_height: u64, - latest_height: bool, -) -> NeutronResult { - let msg = ibc::core::client::v1::QueryConsensusStateRequest { - client_id, - revision_number, - revision_height, - latest_height, - }; - let resp = make_stargate_query( - deps, - "/ibc.core.client.v1.Query/ConsensusState".to_string(), - msg.encode_to_vec(), - )?; - - Ok(to_json_binary(&resp)?) -} - -fn query_ibc_connection(deps: Deps, connection_id: String) -> NeutronResult { - let msg = ibc::core::connection::v1::QueryConnectionRequest { connection_id }; - let resp = make_stargate_query( - deps, - "/ibc.core.connection.v1.Query/Connection".to_string(), - msg.encode_to_vec(), - )?; - - Ok(to_json_binary(&resp)?) -} - -fn query_tokenfactory_params(deps: Deps) -> NeutronResult { - let msg = osmosis_std::types::osmosis::tokenfactory::v1beta1::QueryParamsRequest {}; - let resp = make_stargate_query( - deps, - "/osmosis.tokenfactory.v1beta1.Query/Params".to_string(), - msg.encode_to_vec(), - )?; - - Ok(to_json_binary(&resp)?) -} - -fn query_tokenfactory_denom_authority_metadata(deps: Deps, denom: String) -> NeutronResult { - let msg = - osmosis_std::types::osmosis::tokenfactory::v1beta1::QueryDenomAuthorityMetadataRequest { - denom, - }; - let resp = make_stargate_query( - deps, - "/osmosis.tokenfactory.v1beta1.Query/DenomAuthorityMetadata".to_string(), - msg.encode_to_vec(), - )?; - - Ok(to_json_binary(&resp)?) -} - -fn query_tokenfactory_denoms_from_creator(deps: Deps, creator: String) -> NeutronResult { - let msg = osmosis_std::types::osmosis::tokenfactory::v1beta1::QueryDenomsFromCreatorRequest { - creator, - }; - let resp = make_stargate_query( - deps, - "/osmosis.tokenfactory.v1beta1.Query/DenomsFromCreator".to_string(), - msg.encode_to_vec(), - )?; - - Ok(to_json_binary(&resp)?) -} - -fn query_contractmanager_query_address_failures( - deps: Deps, - address: String, -) -> NeutronResult { - let msg = stargate::contractmanager::QueryAddressFailuresRequest { address }; - let resp = make_stargate_query( - deps, - "/neutron.contractmanager.Query/AddressFailures".to_string(), - msg.encode_to_vec(), - )?; - - Ok(to_json_binary(&resp)?) -} - -fn query_contractmanager_query_failures(deps: Deps, address: String) -> NeutronResult { - let msg = stargate::contractmanager::QueryFailuresRequest { - address, - pagination: None, - }; - let resp = make_stargate_query( - deps, - "/neutron.contractmanager.Query/Failures".to_string(), - msg.encode_to_vec(), - )?; - - Ok(to_json_binary(&resp)?) -} - -fn query_interchaintx_params(deps: Deps) -> NeutronResult { - let msg = stargate::interchaintx::QueryParams {}; - let resp = make_stargate_query( - deps, - "/neutron.interchaintxs.v1.Query/Params".to_string(), - msg.encode_to_vec(), - )?; - - Ok(to_json_binary(&resp)?) -} - -fn query_interchainqueries_params(deps: Deps) -> NeutronResult { - let msg = stargate::interchainqueries::QueryParams {}; - let resp = make_stargate_query( - deps, - "/neutron.interchainqueries.Query/Params".to_string(), - msg.encode_to_vec(), - )?; - - Ok(to_json_binary(&resp)?) -} - -fn query_feeburner_params(deps: Deps) -> NeutronResult { - let msg = stargate::feeburner::QueryParams {}; - let resp = make_stargate_query( - deps, - "/neutron.feeburner.Query/Params".to_string(), - msg.encode_to_vec(), - )?; - - Ok(to_json_binary(&resp)?) -} - -// WARN: should not work since we did not allowlist it -// exists here only for testing purposes -fn query_feeburner_total_burned_neutrons_amount(deps: Deps) -> NeutronResult { - let msg = stargate::feeburner::QueryTotalBurnedNeutronsAmountRequest {}; - let resp = make_stargate_query( - deps, - "/neutron.feeburner.Query/TotalBurnedNeutronsAmount".to_string(), - msg.encode_to_vec(), - )?; - - Ok(to_json_binary(&resp)?) -} - -pub fn make_stargate_query( - deps: Deps, - path: String, - encoded_query_data: Vec, -) -> StdResult { - #[allow(deprecated)] - let raw = to_vec::>(&QueryRequest::Stargate { - path, - data: encoded_query_data.into(), - }) - .map_err(|serialize_err| { - StdError::generic_err(format!("Serializing QueryRequest: {}", serialize_err)) - })?; - match deps.querier.raw_query(&raw) { - SystemResult::Err(system_err) => Err(StdError::generic_err(format!( - "Querier system error: {}", - system_err - ))), - SystemResult::Ok(ContractResult::Err(contract_err)) => Err(StdError::generic_err(format!( - "Querier contract error: {}", - contract_err - ))), - // response(value) is base64 encoded bytes - SystemResult::Ok(ContractResult::Ok(value)) => { - let str = value.to_base64(); - deps.api - .debug(format!("WASMDEBUG: make_stargate_query: {:?}", str).as_str()); - from_utf8(value.as_slice()) - .map(|s| s.to_string()) - .map_err(|_e| StdError::generic_err("Unable to encode from utf8")) - } - } -} diff --git a/contracts/stargate_querier/src/stargate.rs b/contracts/stargate_querier/src/stargate.rs deleted file mode 100644 index 9f25dfc..0000000 --- a/contracts/stargate_querier/src/stargate.rs +++ /dev/null @@ -1,34 +0,0 @@ -pub mod interchaintx { - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct QueryParams {} -} - -pub mod interchainqueries { - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct QueryParams {} -} - -pub mod feeburner { - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct QueryParams {} - - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct QueryTotalBurnedNeutronsAmountRequest {} -} - -pub mod contractmanager { - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct QueryAddressFailuresRequest { - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - } - - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct QueryFailuresRequest { - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub pagination: - ::core::option::Option<::cosmos_sdk_proto::cosmos::base::query::v1beta1::PageRequest>, - } -} diff --git a/contracts/tokenfactory/schema/execute_msg.json b/contracts/tokenfactory/schema/execute_msg.json index 4137274..82f89c2 100644 --- a/contracts/tokenfactory/schema/execute_msg.json +++ b/contracts/tokenfactory/schema/execute_msg.json @@ -17,7 +17,8 @@ "subdenom": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -41,7 +42,8 @@ "new_admin_address": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -65,7 +67,8 @@ "denom": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -89,7 +92,8 @@ "denom": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -117,7 +121,8 @@ "recipient": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -141,7 +146,8 @@ "denom": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -173,7 +179,8 @@ "to": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -224,7 +231,8 @@ "uri_hash": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -254,7 +262,8 @@ "format": "uint32", "minimum": 0.0 } - } + }, + "additionalProperties": false }, "Uint128": { "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", diff --git a/contracts/tokenfactory/schema/instantiate_msg.json b/contracts/tokenfactory/schema/instantiate_msg.json index 44588cf..1352613 100644 --- a/contracts/tokenfactory/schema/instantiate_msg.json +++ b/contracts/tokenfactory/schema/instantiate_msg.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "InstantiateMsg", - "type": "object" + "type": "object", + "additionalProperties": false } diff --git a/contracts/tokenfactory/schema/migrate_msg.json b/contracts/tokenfactory/schema/migrate_msg.json index 87b18ea..7fbe8c5 100644 --- a/contracts/tokenfactory/schema/migrate_msg.json +++ b/contracts/tokenfactory/schema/migrate_msg.json @@ -1,5 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "MigrateMsg", - "type": "object" + "type": "object", + "additionalProperties": false } diff --git a/contracts/tokenfactory/schema/query_msg.json b/contracts/tokenfactory/schema/query_msg.json index 7f89698..117bfc9 100644 --- a/contracts/tokenfactory/schema/query_msg.json +++ b/contracts/tokenfactory/schema/query_msg.json @@ -21,7 +21,8 @@ "subdenom": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -41,7 +42,8 @@ "subdenom": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false @@ -61,7 +63,8 @@ "denom": { "type": "string" } - } + }, + "additionalProperties": false } }, "additionalProperties": false