diff --git a/Cargo.lock b/Cargo.lock index d274d3e5..5c28204c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,6 +28,15 @@ dependencies = [ "version_check", ] +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + [[package]] name = "anyhow" version = "1.0.86" @@ -40,6 +49,28 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +[[package]] +name = "async-trait" +version = "0.1.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + [[package]] name = "autocfg" version = "1.3.0" @@ -61,12 +92,24 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "base16ct" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" + [[package]] name = "base16ct" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + [[package]] name = "base64" version = "0.21.7" @@ -91,6 +134,47 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" +[[package]] +name = "bindgen" +version = "0.60.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6" +dependencies = [ + "bitflags 1.3.2", + "cexpr", + "clang-sys", + "clap", + "env_logger", + "lazy_static", + "lazycell", + "log", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "which", +] + +[[package]] +name = "bip32" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b30ed1d6f8437a487a266c8293aeb95b61a23261273e3e02912cdb8b68bf798b" +dependencies = [ + "bs58", + "hmac", + "k256 0.11.6", + "once_cell", + "pbkdf2", + "rand_core 0.6.4", + "ripemd", + "sha2 0.10.8", + "subtle", + "zeroize", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -139,6 +223,15 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56953345e39537a3e18bdaeba4cb0c58a78c1f61f361dc0fa7c5c7340ae87c5f" +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +dependencies = [ + "sha2 0.9.9", +] + [[package]] name = "bumpalo" version = "3.16.0" @@ -178,6 +271,9 @@ name = "bytes" version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" +dependencies = [ + "serde", +] [[package]] name = "cc" @@ -185,12 +281,56 @@ version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f" +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clap" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +dependencies = [ + "atty", + "bitflags 1.3.2", + "clap_lex", + "indexmap 1.9.3", + "strsim", + "termcolor", + "textwrap", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + [[package]] name = "clru" version = "0.6.2" @@ -209,6 +349,22 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + [[package]] name = "corosensei" version = "0.1.4" @@ -222,6 +378,36 @@ dependencies = [ "windows-sys 0.33.0", ] +[[package]] +name = "cosmos-sdk-proto-althea" +version = "0.16.0" +source = "git+https://github.com/oraichain/cosmos-rust.git?rev=061d0ec#061d0ecec94150985cea061e1e4f2779e950299c" +dependencies = [ + "prost 0.11.9", + "prost-types", + "tendermint-proto", +] + +[[package]] +name = "cosmrs" +version = "0.11.0" +source = "git+https://github.com/oraichain/cosmos-rust.git?rev=061d0ec#061d0ecec94150985cea061e1e4f2779e950299c" +dependencies = [ + "bip32", + "cosmos-sdk-proto-althea", + "ecdsa 0.14.8", + "eyre", + "getrandom", + "k256 0.11.6", + "rand_core 0.6.4", + "serde", + "serde_json", + "subtle-encoding", + "tendermint", + "tendermint-rpc", + "thiserror", +] + [[package]] name = "cosmwasm-crypto" version = "1.5.5" @@ -229,9 +415,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd50718a2b6830ce9eb5d465de5a018a12e71729d66b70807ce97e6dd14f931d" dependencies = [ "digest 0.10.7", - "ecdsa", + "ecdsa 0.16.9", "ed25519-zebra", - "k256", + "k256 0.13.1", "rand_core 0.6.4", "thiserror", ] @@ -275,7 +461,7 @@ version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78c1556156fdf892a55cced6115968b961eaaadd6f724a2c2cb7d1e168e32dd3" dependencies = [ - "base64", + "base64 0.21.7", "bech32 0.9.1", "bnum", "cosmwasm-crypto", @@ -304,7 +490,6 @@ dependencies = [ [[package]] name = "cosmwasm-testing-util" version = "0.1.0" -source = "git+https://github.com/oraichain/cosmwasm-testing-util.git?rev=1b9c412#1b9c4126e8b5e19dc547f992a1a5cd9dde3d1b0d" dependencies = [ "anyhow", "bech32 0.9.1", @@ -315,6 +500,7 @@ dependencies = [ "cw-multi-test", "cw20", "cw20-base", + "osmosis-test-tube", "token-bindings", "token-bindings-test", "tokenfactory", @@ -408,7 +594,7 @@ dependencies = [ "cranelift-entity", "fxhash", "hashbrown 0.12.3", - "indexmap", + "indexmap 1.9.3", "log", "smallvec", ] @@ -486,6 +672,18 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-bigint" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + [[package]] name = "crypto-bigint" version = "0.5.5" @@ -508,6 +706,15 @@ dependencies = [ "typenum", ] +[[package]] +name = "ct-logs" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1a816186fa68d9e426e3cb4ae4dff1fcd8e4a2c34b781bf7a822574a0d0aac8" +dependencies = [ + "sct", +] + [[package]] name = "curve25519-dalek" version = "3.2.0" @@ -530,8 +737,8 @@ dependencies = [ "anyhow", "bech32 0.11.0", "cosmwasm-std", - "cw-storage-plus 1.2.0", - "cw-utils 1.0.3", + "cw-storage-plus", + "cw-utils", "derivative", "itertools 0.13.0", "prost 0.12.6", @@ -541,17 +748,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "cw-storage-plus" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b6f91c0b94481a3e9ef1ceb183c37d00764f8751e39b45fc09f4d9b970d469" -dependencies = [ - "cosmwasm-std", - "schemars", - "serde", -] - [[package]] name = "cw-storage-plus" version = "1.2.0" @@ -563,21 +759,6 @@ dependencies = [ "serde", ] -[[package]] -name = "cw-utils" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6a84c6c1c0acc3616398eba50783934bd6c964bad6974241eaee3460c8f5b26" -dependencies = [ - "cosmwasm-schema", - "cosmwasm-std", - "cw2 0.16.0", - "schemars", - "semver", - "serde", - "thiserror", -] - [[package]] name = "cw-utils" version = "1.0.3" @@ -586,26 +767,13 @@ checksum = "1c4a657e5caacc3a0d00ee96ca8618745d050b8f757c709babafb81208d4239c" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cw2 1.1.2", + "cw2", "schemars", "semver", "serde", "thiserror", ] -[[package]] -name = "cw2" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91398113b806f4d2a8d5f8d05684704a20ffd5968bf87e3473e1973710b884ad" -dependencies = [ - "cosmwasm-schema", - "cosmwasm-std", - "cw-storage-plus 0.16.0", - "schemars", - "serde", -] - [[package]] name = "cw2" version = "1.1.2" @@ -614,7 +782,7 @@ checksum = "c6c120b24fbbf5c3bedebb97f2cc85fbfa1c3287e09223428e7e597b5293c1fa" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cw-storage-plus 1.2.0", + "cw-storage-plus", "schemars", "semver", "serde", @@ -629,7 +797,7 @@ checksum = "526e39bb20534e25a1cd0386727f0038f4da294e5e535729ba3ef54055246abd" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cw-utils 1.0.3", + "cw-utils", "schemars", "serde", ] @@ -642,8 +810,8 @@ checksum = "17ad79e86ea3707229bf78df94e08732e8f713207b4a77b2699755596725e7d9" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cw-storage-plus 1.2.0", - "cw2 1.1.2", + "cw-storage-plus", + "cw2", "cw20", "schemars", "semver", @@ -700,8 +868,8 @@ dependencies = [ [[package]] name = "decimal" -version = "0.1.0" -source = "git+https://github.com/oraichain/oraiswap-v3.git?rev=7f2b8ac#7f2b8ac6a239790006d7a662e6f56c175e189be0" +version = "0.2.0" +source = "git+https://github.com/oraichain/oraiswap-v3.git?rev=7d10324#7d103245b9f97f68184e6bbfe00e2378c266e40d" dependencies = [ "decimal-core", "integer-sqrt", @@ -711,8 +879,8 @@ dependencies = [ [[package]] name = "decimal-core" -version = "0.1.0" -source = "git+https://github.com/oraichain/oraiswap-v3.git?rev=7f2b8ac#7f2b8ac6a239790006d7a662e6f56c175e189be0" +version = "0.2.0" +source = "git+https://github.com/oraichain/oraiswap-v3.git?rev=7d10324#7d103245b9f97f68184e6bbfe00e2378c266e40d" dependencies = [ "proc-macro2", "quote", @@ -720,6 +888,16 @@ dependencies = [ "syn 2.0.72", ] +[[package]] +name = "der" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +dependencies = [ + "const-oid", + "zeroize", +] + [[package]] name = "der" version = "0.7.9" @@ -730,6 +908,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + [[package]] name = "derivative" version = "2.2.0" @@ -807,18 +994,51 @@ dependencies = [ "memmap2 0.5.10", ] +[[package]] +name = "ecdsa" +version = "0.14.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" +dependencies = [ + "der 0.6.1", + "elliptic-curve 0.12.3", + "rfc6979 0.3.1", + "signature 1.6.4", +] + [[package]] name = "ecdsa" version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ - "der", + "der 0.7.9", "digest 0.10.7", - "elliptic-curve", - "rfc6979", - "signature", - "spki", + "elliptic-curve 0.13.8", + "rfc6979 0.4.0", + "signature 2.2.0", + "spki 0.7.3", +] + +[[package]] +name = "ed25519" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +dependencies = [ + "signature 1.6.4", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek", + "ed25519", + "sha2 0.9.9", + "zeroize", ] [[package]] @@ -842,21 +1062,41 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +[[package]] +name = "elliptic-curve" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" +dependencies = [ + "base16ct 0.1.1", + "crypto-bigint 0.4.9", + "der 0.6.1", + "digest 0.10.7", + "ff 0.12.1", + "generic-array", + "group 0.12.1", + "pkcs8 0.9.0", + "rand_core 0.6.4", + "sec1 0.3.0", + "subtle", + "zeroize", +] + [[package]] name = "elliptic-curve" version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ - "base16ct", - "crypto-bigint", + "base16ct 0.2.0", + "crypto-bigint 0.5.5", "digest 0.10.7", - "ff", + "ff 0.13.0", "generic-array", - "group", - "pkcs8", + "group 0.13.0", + "pkcs8 0.10.2", "rand_core 0.6.4", - "sec1", + "sec1 0.7.3", "subtle", "zeroize", ] @@ -902,12 +1142,61 @@ dependencies = [ "syn 2.0.72", ] +[[package]] +name = "env_logger" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "eyre" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" +dependencies = [ + "indenter", + "once_cell", +] + [[package]] name = "fallible-iterator" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +[[package]] +name = "ff" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "ff" version = "0.13.0" @@ -918,6 +1207,16 @@ dependencies = [ "subtle", ] +[[package]] +name = "flex-error" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c606d892c9de11507fa0dcffc116434f94e105d0bbdc4e405b61519464c49d7b" +dependencies = [ + "eyre", + "paste", +] + [[package]] name = "fnv" version = "1.0.7" @@ -946,8 +1245,97 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] -name = "fxhash" -version = "0.2.1" +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "fxhash" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" dependencies = [ @@ -972,8 +1360,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi", + "wasm-bindgen", ] [[package]] @@ -983,7 +1373,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" dependencies = [ "fallible-iterator", - "indexmap", + "indexmap 1.9.3", "stable_deref_trait", ] @@ -993,17 +1383,53 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "group" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +dependencies = [ + "ff 0.12.1", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "group" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "ff", + "ff 0.13.0", "rand_core 0.6.4", "subtle", ] +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 2.5.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -1019,6 +1445,45 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +[[package]] +name = "headers" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" +dependencies = [ + "base64 0.21.7", + "bytes", + "headers-core", + "http", + "httpdate", + "mime", + "sha1", +] + +[[package]] +name = "headers-core" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" +dependencies = [ + "http", +] + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + [[package]] name = "hex" version = "0.4.3" @@ -1034,6 +1499,116 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "hyper" +version = "0.14.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-proxy" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca815a891b24fdfb243fa3239c86154392b0953ee584aa1a2a1f66d20cbe75cc" +dependencies = [ + "bytes", + "futures", + "headers", + "http", + "hyper", + "hyper-rustls", + "rustls-native-certs", + "tokio", + "tokio-rustls", + "tower-service", + "webpki", +] + +[[package]] +name = "hyper-rustls" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64" +dependencies = [ + "ct-logs", + "futures-util", + "hyper", + "log", + "rustls", + "rustls-native-certs", + "tokio", + "tokio-rustls", + "webpki", + "webpki-roots", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -1050,6 +1625,12 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + [[package]] name = "indexmap" version = "1.9.3" @@ -1060,6 +1641,16 @@ dependencies = [ "hashbrown 0.12.3", ] +[[package]] +name = "indexmap" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +dependencies = [ + "equivalent", + "hashbrown 0.14.5", +] + [[package]] name = "integer-sqrt" version = "0.1.5" @@ -1120,6 +1711,19 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "k256" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" +dependencies = [ + "cfg-if", + "ecdsa 0.14.8", + "elliptic-curve 0.12.3", + "sha2 0.10.8", + "sha3", +] + [[package]] name = "k256" version = "0.13.1" @@ -1127,11 +1731,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" dependencies = [ "cfg-if", - "ecdsa", - "elliptic-curve", + "ecdsa 0.16.9", + "elliptic-curve 0.13.8", "once_cell", "sha2 0.10.8", - "signature", + "signature 2.2.0", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", ] [[package]] @@ -1140,6 +1753,12 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + [[package]] name = "leb128" version = "0.2.5" @@ -1152,6 +1771,22 @@ version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +[[package]] +name = "libloading" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +dependencies = [ + "cfg-if", + "windows-targets", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + [[package]] name = "lock_api" version = "0.4.12" @@ -1219,6 +1854,18 @@ dependencies = [ "autocfg", ] +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.7.4" @@ -1228,12 +1875,51 @@ dependencies = [ "adler", ] +[[package]] +name = "mio" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +dependencies = [ + "hermit-abi 0.3.9", + "libc", + "wasi", + "windows-sys 0.52.0", +] + [[package]] name = "more-asserts" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-derive" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -1264,6 +1950,12 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + [[package]] name = "oraiswap" version = "0.2.0" @@ -1272,7 +1964,7 @@ dependencies = [ "cosmwasm-std", "cosmwasm-storage", "cosmwasm-testing-util", - "cw-utils 0.16.0", + "cw-utils", "cw20", "cw20-base", "derive_more", @@ -1302,7 +1994,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cosmwasm-storage", - "cw-storage-plus 1.2.0", + "cw-storage-plus", "oraiswap", "oraiswap-oracle", "oraiswap-pair", @@ -1316,7 +2008,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cosmwasm-storage", - "cw-storage-plus 1.2.0", + "cw-storage-plus", "cw20", "oraiswap", "oraiswap-factory", @@ -1332,7 +2024,7 @@ version = "0.2.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cw-storage-plus 1.2.0", + "cw-storage-plus", "cw20", "oraiswap", "oraiswap-token", @@ -1346,7 +2038,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cosmwasm-storage", - "cw-utils 0.16.0", + "cw-utils", "cw20", "oraiswap", "oraiswap-token", @@ -1360,8 +2052,8 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cosmwasm-storage", - "cw-storage-plus 1.2.0", - "cw2 1.1.2", + "cw-storage-plus", + "cw2", "cw20", "cw20-base", "integer-sqrt", @@ -1389,7 +2081,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cosmwasm-storage", - "cw-storage-plus 1.2.0", + "cw-storage-plus", "cw20", "oraiswap", "oraiswap-factory", @@ -1404,8 +2096,8 @@ version = "0.2.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cw-storage-plus 1.2.0", - "cw2 1.1.2", + "cw-storage-plus", + "cw2", "oraiswap", "oraiswap-factory", "oraiswap-oracle", @@ -1447,20 +2139,41 @@ dependencies = [ [[package]] name = "oraiswap-v3" -version = "0.1.0" -source = "git+https://github.com/oraichain/oraiswap-v3.git?rev=7f2b8ac#7f2b8ac6a239790006d7a662e6f56c175e189be0" +version = "0.2.0" +source = "git+https://github.com/oraichain/oraiswap-v3.git?rev=7d10324#7d103245b9f97f68184e6bbfe00e2378c266e40d" dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cosmwasm-storage", - "cw-storage-plus 1.2.0", - "cw2 1.1.2", + "cw-storage-plus", + "cw2", "cw20", "decimal", "derive_more", "thiserror", ] +[[package]] +name = "os_str_bytes" +version = "6.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" + +[[package]] +name = "osmosis-test-tube" +version = "19.2.0" +source = "git+https://github.com/oraichain/test-tube.git?rev=84a2f5d#84a2f5dbe1cecfa5d2f19eed1c253ebac214f702" +dependencies = [ + "base64 0.13.1", + "bindgen", + "cosmwasm-std", + "prost 0.11.9", + "serde", + "serde_json", + "test-tube", + "thiserror", +] + [[package]] name = "parking_lot_core" version = "0.9.10" @@ -1474,28 +2187,118 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "peg" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07c0b841ea54f523f7aa556956fbd293bcbe06f2e67d2eb732b7278aaf1d166a" +dependencies = [ + "peg-macros", + "peg-runtime", +] + +[[package]] +name = "peg-macros" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aa52829b8decbef693af90202711348ab001456803ba2a98eb4ec8fb70844c" +dependencies = [ + "peg-runtime", + "proc-macro2", + "quote", +] + +[[package]] +name = "peg-runtime" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c719dcf55f09a3a7e764c6649ab594c18a177e3599c467983cdf644bfc0a4088" + [[package]] name = "percent-encoding" version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + [[package]] name = "pin-project-lite" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +dependencies = [ + "der 0.6.1", + "spki 0.6.0", +] + [[package]] name = "pkcs8" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der", - "spki", + "der 0.7.9", + "spki 0.7.3", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -1575,6 +2378,15 @@ dependencies = [ "syn 2.0.72", ] +[[package]] +name = "prost-types" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" +dependencies = [ + "prost 0.11.9", +] + [[package]] name = "protobuf" version = "3.5.0" @@ -1693,6 +2505,8 @@ version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ + "aho-corasick", + "memchr", "regex-automata", "regex-syntax", ] @@ -1703,6 +2517,8 @@ version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ + "aho-corasick", + "memchr", "regex-syntax", ] @@ -1733,6 +2549,17 @@ dependencies = [ "bytecheck", ] +[[package]] +name = "rfc6979" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +dependencies = [ + "crypto-bigint 0.4.9", + "hmac", + "zeroize", +] + [[package]] name = "rfc6979" version = "0.4.0" @@ -1743,6 +2570,41 @@ dependencies = [ "subtle", ] +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + +[[package]] +name = "ripemd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "ripemd160" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eca4ecc81b7f313189bf73ce724400a07da2a6dac19588b03c8bd76a2dcc251" +dependencies = [ + "block-buffer 0.9.0", + "digest 0.9.0", + "opaque-debug", +] + [[package]] name = "rkyv" version = "0.7.44" @@ -1753,13 +2615,13 @@ dependencies = [ "bytecheck", "bytes", "hashbrown 0.12.3", - "indexmap", + "indexmap 1.9.3", "ptr_meta", "rend", "rkyv_derive", "seahash", "tinyvec", - "uuid", + "uuid 1.10.0", ] [[package]] @@ -1779,6 +2641,12 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc_version" version = "0.4.0" @@ -1788,12 +2656,68 @@ dependencies = [ "semver", ] +[[package]] +name = "rustix" +version = "0.38.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +dependencies = [ + "bitflags 2.6.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +dependencies = [ + "base64 0.13.1", + "log", + "ring", + "sct", + "webpki", +] + +[[package]] +name = "rustls-native-certs" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a07b7c1885bd8ed3831c289b7870b13ef46fe0e856d288c30d9cc17d75a2092" +dependencies = [ + "openssl-probe", + "rustls", + "schannel", + "security-framework", +] + [[package]] name = "ryu" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "schemars" version = "0.8.21" @@ -1824,26 +2748,73 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sct" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "seahash" version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +[[package]] +name = "sec1" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +dependencies = [ + "base16ct 0.1.1", + "der 0.6.1", + "generic-array", + "pkcs8 0.9.0", + "subtle", + "zeroize", +] + [[package]] name = "sec1" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ - "base16ct", - "der", + "base16ct 0.2.0", + "der 0.7.9", "generic-array", - "pkcs8", + "pkcs8 0.10.2", "subtle", "zeroize", ] +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags 2.6.0", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "self_cell" version = "1.0.4" @@ -1885,6 +2856,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "serde_bytes" +version = "0.11.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" +dependencies = [ + "serde", +] + [[package]] name = "serde_derive" version = "1.0.204" @@ -1918,6 +2898,28 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_repr" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + [[package]] name = "sha2" version = "0.9.9" @@ -1942,6 +2944,16 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + [[package]] name = "shared-buffer" version = "0.1.4" @@ -1952,6 +2964,22 @@ dependencies = [ "memmap2 0.6.2", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +dependencies = [ + "digest 0.10.7", + "rand_core 0.6.4", +] + [[package]] name = "signature" version = "2.2.0" @@ -1968,6 +2996,15 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + [[package]] name = "slice-group-by" version = "0.3.1" @@ -1980,6 +3017,32 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +[[package]] +name = "socket2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spki" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +dependencies = [ + "base64ct", + "der 0.6.1", +] + [[package]] name = "spki" version = "0.7.3" @@ -1987,7 +3050,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", - "der", + "der 0.7.9", ] [[package]] @@ -2002,12 +3065,27 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "subtle" version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +[[package]] +name = "subtle-encoding" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dcb1ed7b8330c5eed5441052651dd7a12c75e2ed88f2ec024ae1fa3a5e59945" +dependencies = [ + "zeroize", +] + [[package]] name = "syn" version = "1.0.109" @@ -2042,6 +3120,131 @@ version = "0.12.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4873307b7c257eddcb50c9bedf158eb669578359fb28428bef438fec8e6ba7c2" +[[package]] +name = "tendermint" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c518c082146825f10d6f9a32159ae46edcfd7dae8ac630c8067594bb2a784d72" +dependencies = [ + "bytes", + "ed25519", + "ed25519-dalek", + "flex-error", + "futures", + "k256 0.11.6", + "num-traits", + "once_cell", + "prost 0.11.9", + "prost-types", + "ripemd160", + "serde", + "serde_bytes", + "serde_json", + "serde_repr", + "sha2 0.9.9", + "signature 1.6.4", + "subtle", + "subtle-encoding", + "tendermint-proto", + "time", + "zeroize", +] + +[[package]] +name = "tendermint-config" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f58b86374e3bcfc8135770a6c55388fce101c00de4a5f03224fa5830c9240b7" +dependencies = [ + "flex-error", + "serde", + "serde_json", + "tendermint", + "toml", + "url", +] + +[[package]] +name = "tendermint-proto" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "890f1fb6dee48900c85f0cdf711ebf130e505ac09ad918cee5c34ed477973b05" +dependencies = [ + "bytes", + "flex-error", + "num-derive", + "num-traits", + "prost 0.11.9", + "prost-types", + "serde", + "serde_bytes", + "subtle-encoding", + "time", +] + +[[package]] +name = "tendermint-rpc" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06df4715f9452ec0a21885d6da8d804799455ba50d8bc40be1ec1c800afd4bd8" +dependencies = [ + "async-trait", + "bytes", + "flex-error", + "futures", + "getrandom", + "http", + "hyper", + "hyper-proxy", + "hyper-rustls", + "peg", + "pin-project", + "serde", + "serde_bytes", + "serde_json", + "subtle", + "subtle-encoding", + "tendermint", + "tendermint-config", + "thiserror", + "time", + "tokio", + "tracing", + "url", + "uuid 0.8.2", + "walkdir", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "test-tube" +version = "0.1.7" +source = "git+https://github.com/oraichain/test-tube.git?rev=84a2f5d#84a2f5dbe1cecfa5d2f19eed1c253ebac214f702" +dependencies = [ + "base64 0.13.1", + "cosmrs", + "cosmwasm-std", + "prost 0.11.9", + "serde", + "serde-json-wasm", + "serde_json", + "thiserror", +] + +[[package]] +name = "textwrap" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" + [[package]] name = "thiserror" version = "1.0.63" @@ -2062,6 +3265,36 @@ dependencies = [ "syn 2.0.72", ] +[[package]] +name = "time" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -2080,7 +3313,7 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "token-bindings" version = "0.11.0" -source = "git+https://github.com/oraichain/token-bindings.git?rev=7861576#78615761c7c0eb8ff8ebe64e26f70d20fec5b4e2" +source = "git+https://github.com/oraichain/token-bindings.git?rev=9796c74#9796c7480ee2955a508e84be54421fc231b74ee8" dependencies = [ "cosmwasm-schema", "cosmwasm-std", @@ -2091,12 +3324,12 @@ dependencies = [ [[package]] name = "token-bindings-test" version = "0.11.0" -source = "git+https://github.com/oraichain/token-bindings.git?rev=7861576#78615761c7c0eb8ff8ebe64e26f70d20fec5b4e2" +source = "git+https://github.com/oraichain/token-bindings.git?rev=9796c74#9796c7480ee2955a508e84be54421fc231b74ee8" dependencies = [ "anyhow", "cosmwasm-std", "cw-multi-test", - "cw-storage-plus 1.2.0", + "cw-storage-plus", "itertools 0.11.0", "schemars", "serde", @@ -2107,19 +3340,85 @@ dependencies = [ [[package]] name = "tokenfactory" version = "0.11.0" -source = "git+https://github.com/oraichain/token-bindings.git?rev=7861576#78615761c7c0eb8ff8ebe64e26f70d20fec5b4e2" +source = "git+https://github.com/oraichain/token-bindings.git?rev=9796c74#9796c7480ee2955a508e84be54421fc231b74ee8" dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cosmwasm-storage", - "cw-storage-plus 1.2.0", - "cw2 1.1.2", + "cw-storage-plus", + "cw2", "schemars", "serde", "thiserror", "token-bindings", ] +[[package]] +name = "tokio" +version = "1.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "tokio-macros", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-macros" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "tokio-rustls" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" +dependencies = [ + "rustls", + "tokio", + "webpki", +] + +[[package]] +name = "tokio-util" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + [[package]] name = "tracing" version = "0.1.40" @@ -2151,6 +3450,12 @@ dependencies = [ "once_cell", ] +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + [[package]] name = "typenum" version = "1.17.0" @@ -2190,6 +3495,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + [[package]] name = "url" version = "2.5.2" @@ -2201,6 +3512,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" + [[package]] name = "uuid" version = "1.10.0" @@ -2213,6 +3530,25 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2305,7 +3641,7 @@ dependencies = [ "bytes", "cfg-if", "derivative", - "indexmap", + "indexmap 1.9.3", "js-sys", "more-asserts", "rustc-demangle", @@ -2422,7 +3758,7 @@ dependencies = [ "bytecheck", "enum-iterator", "enumset", - "indexmap", + "indexmap 1.9.3", "more-asserts", "rkyv", "target-lexicon", @@ -2444,7 +3780,7 @@ dependencies = [ "derivative", "enum-iterator", "fnv", - "indexmap", + "indexmap 1.9.3", "lazy_static", "libc", "mach", @@ -2463,10 +3799,51 @@ version = "0.95.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2ea896273ea99b15132414be1da01ab0d8836415083298ecaffbe308eaac87a" dependencies = [ - "indexmap", + "indexmap 1.9.3", "url", ] +[[package]] +name = "web-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" +dependencies = [ + "webpki", +] + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + [[package]] name = "winapi" version = "0.3.9" @@ -2483,6 +3860,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -2619,3 +4005,17 @@ 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.72", +] diff --git a/Cargo.toml b/Cargo.toml index 156c7a9f..8c52e8c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ cw2 = { version = "1.0.1" } cw20 = { version = "1.0.1" } cw20-base = { version = "1.0.1" } cw-storage-plus = { version = "1.0.1" } -cw-utils = "0.16.0" +cw-utils = "1.0.3" oraiswap = { path = "./packages/oraiswap" } oraiswap-oracle = { path = "./contracts/oraiswap_oracle" } @@ -38,11 +38,11 @@ oraiswap-token = { path = "./contracts/oraiswap_token" } oraiswap-pair = { path = "./contracts/oraiswap_pair" } oraiswap-factory = { path = "./contracts/oraiswap_factory" } oraiswap-router = { path = "./contracts/oraiswap_router" } -oraiswap-v3 = { git = "https://github.com/oraichain/oraiswap-v3.git", rev = "7f2b8ac", features = [ +oraiswap-v3 = { git = "https://github.com/oraichain/oraiswap-v3.git", rev = "7d10324", features = [ "library", ] } -cosmwasm-testing-util = { git = "https://github.com/oraichain/cosmwasm-testing-util.git", rev = "1b9c412" } +cosmwasm-testing-util = { path = "/Users/phamtu/Projects/cosmwasm-testing-util" } [profile.release] opt-level = 3 diff --git a/contracts/oraiswap_converter/src/contract.rs b/contracts/oraiswap_converter/src/contract.rs index bb881fac..13d9a140 100644 --- a/contracts/oraiswap_converter/src/contract.rs +++ b/contracts/oraiswap_converter/src/contract.rs @@ -1,6 +1,8 @@ +#[cfg(not(feature = "library"))] +use cosmwasm_std::entry_point; use cosmwasm_std::{ - entry_point, from_json, to_json_binary, Addr, Attribute, BankMsg, Binary, Coin, CosmosMsg, - Decimal, Deps, DepsMut, Env, MessageInfo, Response, StdError, StdResult, Uint128, WasmMsg, + from_json, to_json_binary, Addr, Attribute, BankMsg, Binary, Coin, CosmosMsg, Decimal, Deps, + DepsMut, Env, MessageInfo, Response, StdError, StdResult, Uint128, WasmMsg, }; use cw20::{Cw20ExecuteMsg, Cw20ReceiveMsg}; use oraiswap::math::Converter128; diff --git a/contracts/oraiswap_converter/src/lib.rs b/contracts/oraiswap_converter/src/lib.rs index b35f3e64..ae072705 100644 --- a/contracts/oraiswap_converter/src/lib.rs +++ b/contracts/oraiswap_converter/src/lib.rs @@ -1,5 +1,4 @@ #![allow(deprecated)] - pub mod contract; pub mod state; diff --git a/contracts/oraiswap_mixed_router/src/testing.rs b/contracts/oraiswap_mixed_router/src/testing.rs index d41f7e65..cf0455e8 100644 --- a/contracts/oraiswap_mixed_router/src/testing.rs +++ b/contracts/oraiswap_mixed_router/src/testing.rs @@ -27,6 +27,7 @@ fn simulate_swap_operations_test() { }, ], )]); + let addr0000 = Addr::unchecked(&app.accounts[0]); app.set_oracle_contract(Box::new(create_entry_points_testing!(oraiswap_oracle))); @@ -87,7 +88,7 @@ fn simulate_swap_operations_test() { let _res = app .execute( - Addr::unchecked("addr0000"), + addr0000.clone(), pair_addr.clone(), &msg, &[ @@ -113,7 +114,7 @@ fn simulate_swap_operations_test() { // we can just call .unwrap() to assert this was a success let router_addr = app - .instantiate(code_id, Addr::unchecked("addr0000"), &msg, &[], "router") + .instantiate(code_id, addr0000.clone(), &msg, &[], "router") .unwrap(); let msg = QueryMsg::SimulateSwapOperations { @@ -148,6 +149,8 @@ fn execute_swap_operations() { ], )]); + let addr0000 = Addr::unchecked(&app.accounts[0]); + app.set_oracle_contract(Box::new(create_entry_points_testing!(oraiswap_oracle))); app.set_token_contract(Box::new(create_entry_points_testing!(oraiswap_token))); @@ -173,7 +176,7 @@ fn execute_swap_operations() { let asset_addr = app.create_token("asset"); - app.set_token_balances(&[("asset", &[("addr0000", 1000000u128)])]) + app.set_token_balances(&[("asset", &[(addr0000.as_str(), 1000000u128)])]) .unwrap(); let asset_infos1 = [ @@ -220,7 +223,7 @@ fn execute_swap_operations() { // set allowance app.execute( - Addr::unchecked("addr0000"), + addr0000.clone(), asset_addr.clone(), &cw20::Cw20ExecuteMsg::IncreaseAllowance { spender: pair_addr1.to_string(), @@ -233,7 +236,7 @@ fn execute_swap_operations() { let _res = app .execute( - Addr::unchecked("addr0000"), + addr0000.clone(), pair_addr1.clone(), &msg, &[Coin { @@ -264,7 +267,7 @@ fn execute_swap_operations() { // set allowance app.execute( - Addr::unchecked("addr0000"), + addr0000.clone(), asset_addr.clone(), &cw20::Cw20ExecuteMsg::IncreaseAllowance { spender: pair_addr2.to_string(), @@ -277,7 +280,7 @@ fn execute_swap_operations() { let _res = app .execute( - Addr::unchecked("addr0000"), + addr0000.clone(), pair_addr2.clone(), &msg, &[Coin { @@ -297,7 +300,7 @@ fn execute_swap_operations() { // we can just call .unwrap() to assert this was a success let router_addr = app - .instantiate(code_id, Addr::unchecked("addr0000"), &msg, &[], "router") + .instantiate(code_id, addr0000.clone(), &msg, &[], "router") .unwrap(); let msg: ExecuteMsg = ExecuteMsg::ExecuteSwapOperations { @@ -308,7 +311,7 @@ fn execute_swap_operations() { }; let error = app - .execute(Addr::unchecked("addr0000"), router_addr.clone(), &msg, &[]) + .execute(addr0000.clone(), router_addr.clone(), &msg, &[]) .unwrap_err(); assert!(error .root_cause() @@ -341,7 +344,7 @@ fn execute_swap_operations() { let res = app .execute( - Addr::unchecked("addr0000"), + addr0000.clone(), router_addr.clone(), &msg, &[ @@ -403,7 +406,7 @@ fn execute_swap_operations() { let error = app .execute( - Addr::unchecked("addr0000"), + addr0000.clone(), router_addr.clone(), &msg, &[ @@ -429,7 +432,7 @@ fn execute_swap_operations() { Addr::unchecked("admin"), pair_addr1.clone(), &oraiswap::pair::ExecuteMsg::RegisterTrader { - traders: vec![Addr::unchecked("addr0000")], + traders: vec![addr0000.clone()], }, &[], ) @@ -438,7 +441,7 @@ fn execute_swap_operations() { Addr::unchecked("admin"), pair_addr2.clone(), &oraiswap::pair::ExecuteMsg::RegisterTrader { - traders: vec![Addr::unchecked("addr0000")], + traders: vec![addr0000.clone()], }, &[], ) @@ -446,7 +449,7 @@ fn execute_swap_operations() { // swap successfully app.execute( - Addr::unchecked("addr0000"), + addr0000.clone(), router_addr.clone(), &msg, &[ @@ -505,25 +508,25 @@ fn init_v3( let lower_tick_index = -20; let middle_tick_index = -10; let upper_tick_index = 10; - + let addr0000 = Addr::unchecked(&app.accounts[0]); let liquidity_delta = Liquidity(1000000000000000000); app.approve_token( token_x_name, - "addr0000", + addr0000.as_str(), contract_addr.clone().as_str(), u128::MAX, ) .unwrap(); app.approve_token( token_y_name, - "addr0000", + addr0000.as_str(), contract_addr.clone().as_str(), u128::MAX, ) .unwrap(); app.execute( - Addr::unchecked("addr0000"), + addr0000.clone(), contract_addr.clone(), &OraiswapV3ExecuteMsg::CreatePosition { pool_key: pool_key.clone(), @@ -538,7 +541,7 @@ fn init_v3( .unwrap(); app.execute( - Addr::unchecked("addr0000"), + addr0000.clone(), contract_addr.clone(), &OraiswapV3ExecuteMsg::CreatePosition { pool_key: pool_key.clone(), @@ -570,7 +573,7 @@ fn simulate_mixed_swap() { }, ], )]); - + let addr0000 = Addr::unchecked(&app.accounts[0]); app.set_token_contract(Box::new(create_entry_points_testing!(oraiswap_token))); let token_x_name = "tokenx"; @@ -630,14 +633,14 @@ fn simulate_mixed_swap() { app.approve_token( token_x_name, - "addr0000", + addr0000.as_str(), pair_addr.clone().as_str(), u128::MAX, ) .unwrap(); app.approve_token( token_y_name, - "addr0000", + addr0000.as_str(), pair_addr.clone().as_str(), u128::MAX, ) @@ -662,7 +665,7 @@ fn simulate_mixed_swap() { }; let _res = app - .execute(Addr::unchecked("addr0000"), pair_addr.clone(), &msg, &[]) + .execute(addr0000.clone(), pair_addr.clone(), &msg, &[]) .unwrap(); let msg = InstantiateMsg { @@ -675,7 +678,7 @@ fn simulate_mixed_swap() { // we can just call .unwrap() to assert this was a success let router_addr = app - .instantiate(code_id, Addr::unchecked("addr0000"), &msg, &[], "router") + .instantiate(code_id, addr0000.clone(), &msg, &[], "router") .unwrap(); let msg = QueryMsg::SimulateSwapOperations { @@ -716,7 +719,7 @@ fn execute_mixed_swap_operations() { }, ], )]); - + let addr0000 = Addr::unchecked(&app.accounts[0]); app.set_token_contract(Box::new(create_entry_points_testing!(oraiswap_token))); let token_x_name = "tokenx"; @@ -724,9 +727,9 @@ fn execute_mixed_swap_operations() { let token_x = app.create_token(token_x_name); let token_y = app.create_token(token_y_name); - app.set_token_balances(&[("tokenx", &[("addr0000", 1000000000000u128)])]) + app.set_token_balances(&[("tokenx", &[(addr0000.as_str(), 1000000000000u128)])]) .unwrap(); - app.set_token_balances(&[("tokeny", &[("addr0000", 1000000000000u128)])]) + app.set_token_balances(&[("tokeny", &[(addr0000.as_str(), 1000000000000u128)])]) .unwrap(); let pool_key = init_v3( @@ -776,14 +779,14 @@ fn execute_mixed_swap_operations() { app.approve_token( token_x_name, - "addr0000", + addr0000.as_str(), pair_addr.clone().as_str(), u128::MAX, ) .unwrap(); app.approve_token( token_y_name, - "addr0000", + addr0000.as_str(), pair_addr.clone().as_str(), u128::MAX, ) @@ -808,7 +811,7 @@ fn execute_mixed_swap_operations() { }; let _res = app - .execute(Addr::unchecked("addr0000"), pair_addr.clone(), &msg, &[]) + .execute(addr0000.clone(), pair_addr.clone(), &msg, &[]) .unwrap(); let msg = InstantiateMsg { @@ -821,7 +824,7 @@ fn execute_mixed_swap_operations() { // we can just call .unwrap() to assert this was a success let router_addr = app - .instantiate(code_id, Addr::unchecked("addr0000"), &msg, &[], "router") + .instantiate(code_id, addr0000.clone(), &msg, &[], "router") .unwrap(); // first case: invalid route, can't swap @@ -847,7 +850,7 @@ fn execute_mixed_swap_operations() { let error = app .execute( - Addr::unchecked("addr0000"), + addr0000.clone(), token_x.clone(), &Cw20ExecuteMsg::Send { contract: router_addr.to_string(), @@ -897,7 +900,7 @@ fn execute_mixed_swap_operations() { ); app.execute( - Addr::unchecked("addr0000"), + addr0000.clone(), token_x.clone(), &Cw20ExecuteMsg::Send { contract: router_addr.to_string(), @@ -939,7 +942,7 @@ fn test_affiliates() { }, ], )]); - + let addr0000 = Addr::unchecked(&app.accounts[0]); app.set_token_contract(Box::new(create_entry_points_testing!(oraiswap_token))); let token_x_name = "tokenx"; @@ -947,9 +950,9 @@ fn test_affiliates() { let token_x = app.create_token(token_x_name); let token_y = app.create_token(token_y_name); - app.set_token_balances(&[("tokenx", &[("addr0000", 1000000000000u128)])]) + app.set_token_balances(&[("tokenx", &[(addr0000.as_str(), 1000000000000u128)])]) .unwrap(); - app.set_token_balances(&[("tokeny", &[("addr0000", 1000000000000u128)])]) + app.set_token_balances(&[("tokeny", &[(addr0000.as_str(), 1000000000000u128)])]) .unwrap(); app.set_oracle_contract(Box::new(create_entry_points_testing!(oraiswap_oracle))); @@ -991,14 +994,14 @@ fn test_affiliates() { app.approve_token( token_x_name, - "addr0000", + addr0000.as_str(), pair_addr.clone().as_str(), u128::MAX, ) .unwrap(); app.approve_token( token_y_name, - "addr0000", + addr0000.as_str(), pair_addr.clone().as_str(), u128::MAX, ) @@ -1023,7 +1026,7 @@ fn test_affiliates() { }; let _res = app - .execute(Addr::unchecked("addr0000"), pair_addr.clone(), &msg, &[]) + .execute(addr0000.clone(), pair_addr.clone(), &msg, &[]) .unwrap(); init_v3( @@ -1044,7 +1047,7 @@ fn test_affiliates() { // we can just call .unwrap() to assert this was a success let router_addr = app - .instantiate(code_id, Addr::unchecked("addr0000"), &msg, &[], "router") + .instantiate(code_id, addr0000.clone(), &msg, &[], "router") .unwrap(); // case 1: swap x to y => receive y @@ -1072,7 +1075,7 @@ fn test_affiliates() { }; app.execute( - Addr::unchecked("addr0000"), + addr0000.clone(), token_x.clone(), &Cw20ExecuteMsg::Send { contract: router_addr.to_string(), @@ -1138,7 +1141,7 @@ fn test_affiliates() { }; app.execute( - Addr::unchecked("addr0000"), + addr0000.clone(), token_x.clone(), &Cw20ExecuteMsg::Send { contract: router_addr.to_string(), diff --git a/contracts/oraiswap_orderbook/Cargo.toml b/contracts/oraiswap_orderbook/Cargo.toml index aa16b472..a782897d 100644 --- a/contracts/oraiswap_orderbook/Cargo.toml +++ b/contracts/oraiswap_orderbook/Cargo.toml @@ -18,6 +18,7 @@ crate-type = ["cdylib", "rlib"] # for quicker tests, cargo test --lib # for more explicit tests, cargo test --features=backtraces backtraces = ["cosmwasm-std/backtraces"] +test-tube = ["oraiswap/test-tube"] [dependencies] cw20 = { workspace = true } diff --git a/contracts/oraiswap_orderbook/src/testing/contract_test.rs b/contracts/oraiswap_orderbook/src/testing/contract_test.rs index 8aa54078..b3b08353 100644 --- a/contracts/oraiswap_orderbook/src/testing/contract_test.rs +++ b/contracts/oraiswap_orderbook/src/testing/contract_test.rs @@ -3,7 +3,7 @@ use std::str::FromStr; use cosmwasm_std::testing::mock_dependencies; use cosmwasm_std::{to_json_binary, Addr, Coin, Decimal, StdError, Uint128}; use oraiswap::create_entry_points_testing; -use oraiswap::testing::{AttributeUtil, MockApp, ATOM_DENOM}; +use oraiswap::testing::{MockApp, ATOM_DENOM}; use oraiswap::asset::{Asset, AssetInfo, AssetInfoRaw, ORAI_DENOM}; use oraiswap::orderbook::{ diff --git a/contracts/oraiswap_pair/Cargo.toml b/contracts/oraiswap_pair/Cargo.toml index dabbfdfd..3370fc46 100644 --- a/contracts/oraiswap_pair/Cargo.toml +++ b/contracts/oraiswap_pair/Cargo.toml @@ -16,6 +16,7 @@ crate-type = ["cdylib", "rlib"] # for quicker tests, cargo test --lib # for more explicit tests, cargo test --features=backtraces backtraces = ["cosmwasm-std/backtraces"] +test-tube = ["oraiswap/test-tube"] [dependencies] cw2 = { workspace = true } diff --git a/contracts/oraiswap_router/Cargo.toml b/contracts/oraiswap_router/Cargo.toml index e4205e51..67d14ebc 100644 --- a/contracts/oraiswap_router/Cargo.toml +++ b/contracts/oraiswap_router/Cargo.toml @@ -17,6 +17,7 @@ crate-type = ["cdylib", "rlib"] # for quicker tests, cargo test --lib # for more explicit tests, cargo test --features=backtraces backtraces = ["cosmwasm-std/backtraces"] +test-tube = ["oraiswap/test-tube"] [dependencies] cw20 = { workspace = true } diff --git a/contracts/oraiswap_staking/Cargo.toml b/contracts/oraiswap_staking/Cargo.toml index dba01ff7..af0b097b 100644 --- a/contracts/oraiswap_staking/Cargo.toml +++ b/contracts/oraiswap_staking/Cargo.toml @@ -16,6 +16,7 @@ crate-type = ["cdylib", "rlib"] # for quicker tests, cargo test --lib # for more explicit tests, cargo test --features=backtraces backtraces = ["cosmwasm-std/backtraces"] +test-tube = ["oraiswap/test-tube"] [dependencies] cw20 = { workspace = true } diff --git a/contracts/oraiswap_staking/src/testing/reward_test.rs b/contracts/oraiswap_staking/src/testing/reward_test.rs index f007938e..12b2d4c7 100644 --- a/contracts/oraiswap_staking/src/testing/reward_test.rs +++ b/contracts/oraiswap_staking/src/testing/reward_test.rs @@ -9,7 +9,7 @@ use oraiswap::staking::{ Cw20HookMsg, ExecuteMsg, InstantiateMsg, PoolInfoResponse, QueryMsg, RewardInfoResponse, RewardInfoResponseItem, RewardMsg, }; -use oraiswap::testing::{MockApp, ATOM_DENOM}; +use oraiswap::testing::{MockApp, APP_OWNER, ATOM_DENOM}; #[test] fn test_deposit_reward() { @@ -433,20 +433,12 @@ fn test_withdraw() { ]) .unwrap(); - let msg = InstantiateMsg { - owner: Some(Addr::unchecked("owner")), - rewarder: reward_addr.clone(), - minter: Some(Addr::unchecked("mint")), - oracle_addr: app.oracle_addr.clone(), - factory_addr: app.factory_addr.clone(), - base_denom: None, - }; - - let code_id = app.upload(Box::new(create_entry_points_testing!(crate))); + app.set_staking_contract( + Box::new(create_entry_points_testing!(crate)), + reward_addr.clone(), + ); - let staking_addr = app - .instantiate(code_id, Addr::unchecked("addr"), &msg, &[], "staking") - .unwrap(); + let staking_addr = app.staking_addr.clone(); // funding some balances to the staking contract from rewarder app.set_balances_from( @@ -495,7 +487,7 @@ fn test_withdraw() { }; let _res = app - .execute(Addr::unchecked("owner"), staking_addr.clone(), &msg, &[]) + .execute(Addr::unchecked(APP_OWNER), staking_addr.clone(), &msg, &[]) .unwrap(); let lp_addr = app.create_token("lptoken"); @@ -505,7 +497,7 @@ fn test_withdraw() { }; let _res = app - .execute(Addr::unchecked("owner"), staking_addr.clone(), &msg, &[]) + .execute(Addr::unchecked(APP_OWNER), staking_addr.clone(), &msg, &[]) .unwrap(); // bond 100 tokens diff --git a/contracts/oraiswap_staking/src/testing/staking_test.rs b/contracts/oraiswap_staking/src/testing/staking_test.rs index a37d58a7..e0c95337 100644 --- a/contracts/oraiswap_staking/src/testing/staking_test.rs +++ b/contracts/oraiswap_staking/src/testing/staking_test.rs @@ -15,7 +15,7 @@ use oraiswap::staking::{ Cw20HookMsg, ExecuteMsg, InstantiateMsg, PoolInfoResponse, QueryMsg, RewardInfoResponse, RewardInfoResponseItem, RewardMsg, }; -use oraiswap::testing::{AttributeUtil, MockApp, ATOM_DENOM}; +use oraiswap::testing::{MockApp, APP_OWNER, ATOM_DENOM}; #[test] fn test_query_all_pool_keys() { @@ -436,20 +436,11 @@ fn test_auto_stake() { ) .unwrap(); - let code_id = app.upload(Box::new(create_entry_points_testing!(crate))); - - let msg = InstantiateMsg { - owner: Some(Addr::unchecked("owner")), - rewarder: reward_addr.clone(), - minter: Some(Addr::unchecked("mint")), - oracle_addr: app.oracle_addr.clone(), - factory_addr: app.factory_addr.clone(), - base_denom: None, - }; - - let staking_addr = app - .instantiate(code_id, Addr::unchecked("addr"), &msg, &[], "staking") - .unwrap(); + app.set_staking_contract( + Box::new(create_entry_points_testing!(crate)), + reward_addr.clone(), + ); + let staking_addr = app.staking_addr.clone(); // set allowance app.execute( @@ -469,7 +460,7 @@ fn test_auto_stake() { }; let _res = app - .execute(Addr::unchecked("owner"), staking_addr.clone(), &msg, &[]) + .execute(Addr::unchecked(APP_OWNER), staking_addr.clone(), &msg, &[]) .unwrap(); // no token asset diff --git a/packages/oraiswap/Cargo.toml b/packages/oraiswap/Cargo.toml index 8f39c997..4c54cd8b 100644 --- a/packages/oraiswap/Cargo.toml +++ b/packages/oraiswap/Cargo.toml @@ -17,6 +17,7 @@ readme = "README.md" # for quicker tests, cargo test --lib # for more explicit tests, cargo test --features=backtraces backtraces = ["cosmwasm-std/backtraces"] +test-tube = [] [dependencies] cosmwasm-schema = { workspace = true } diff --git a/packages/oraiswap/src/testdata/oraiswap-converter.wasm b/packages/oraiswap/src/testdata/oraiswap-converter.wasm new file mode 100644 index 00000000..08bcd104 Binary files /dev/null and b/packages/oraiswap/src/testdata/oraiswap-converter.wasm differ diff --git a/packages/oraiswap/src/testdata/oraiswap-factory.wasm b/packages/oraiswap/src/testdata/oraiswap-factory.wasm new file mode 100644 index 00000000..298b5f52 Binary files /dev/null and b/packages/oraiswap/src/testdata/oraiswap-factory.wasm differ diff --git a/packages/oraiswap/src/testdata/oraiswap-mixed-router.wasm b/packages/oraiswap/src/testdata/oraiswap-mixed-router.wasm new file mode 100644 index 00000000..609f5562 Binary files /dev/null and b/packages/oraiswap/src/testdata/oraiswap-mixed-router.wasm differ diff --git a/packages/oraiswap/src/testdata/oraiswap-oracle.wasm b/packages/oraiswap/src/testdata/oraiswap-oracle.wasm new file mode 100644 index 00000000..9b729113 Binary files /dev/null and b/packages/oraiswap/src/testdata/oraiswap-oracle.wasm differ diff --git a/packages/oraiswap/src/testdata/oraiswap-orderbook.wasm b/packages/oraiswap/src/testdata/oraiswap-orderbook.wasm new file mode 100644 index 00000000..e878a93e Binary files /dev/null and b/packages/oraiswap/src/testdata/oraiswap-orderbook.wasm differ diff --git a/packages/oraiswap/src/testdata/oraiswap-pair.wasm b/packages/oraiswap/src/testdata/oraiswap-pair.wasm new file mode 100644 index 00000000..cde86f97 Binary files /dev/null and b/packages/oraiswap/src/testdata/oraiswap-pair.wasm differ diff --git a/packages/oraiswap/src/testdata/oraiswap-rewarder.wasm b/packages/oraiswap/src/testdata/oraiswap-rewarder.wasm new file mode 100644 index 00000000..1d8c2d2d Binary files /dev/null and b/packages/oraiswap/src/testdata/oraiswap-rewarder.wasm differ diff --git a/packages/oraiswap/src/testdata/oraiswap-router.wasm b/packages/oraiswap/src/testdata/oraiswap-router.wasm new file mode 100644 index 00000000..e5687c3c Binary files /dev/null and b/packages/oraiswap/src/testdata/oraiswap-router.wasm differ diff --git a/packages/oraiswap/src/testdata/oraiswap-smartrouter.wasm b/packages/oraiswap/src/testdata/oraiswap-smartrouter.wasm new file mode 100644 index 00000000..10fe6045 Binary files /dev/null and b/packages/oraiswap/src/testdata/oraiswap-smartrouter.wasm differ diff --git a/packages/oraiswap/src/testdata/oraiswap-staking.wasm b/packages/oraiswap/src/testdata/oraiswap-staking.wasm new file mode 100644 index 00000000..261c8b16 Binary files /dev/null and b/packages/oraiswap/src/testdata/oraiswap-staking.wasm differ diff --git a/packages/oraiswap/src/testdata/oraiswap-token.wasm b/packages/oraiswap/src/testdata/oraiswap-token.wasm new file mode 100644 index 00000000..b73c5c88 Binary files /dev/null and b/packages/oraiswap/src/testdata/oraiswap-token.wasm differ diff --git a/packages/oraiswap/src/testdata/oraiswap-v3.wasm b/packages/oraiswap/src/testdata/oraiswap-v3.wasm new file mode 100644 index 00000000..0f5e3f99 Binary files /dev/null and b/packages/oraiswap/src/testdata/oraiswap-v3.wasm differ diff --git a/packages/oraiswap/src/testing.rs b/packages/oraiswap/src/testing.rs index 36920828..eea7189e 100644 --- a/packages/oraiswap/src/testing.rs +++ b/packages/oraiswap/src/testing.rs @@ -1,10 +1,10 @@ use crate::asset::{AssetInfo, PairInfo, ORAI_DENOM}; -use cosmwasm_std::{coin, Addr, Attribute, Coin, Decimal, StdResult, Uint128}; +use cosmwasm_std::{coin, Addr, Coin, Decimal, StdResult, Uint128}; use derive_more::{Deref, DerefMut}; use oraiswap_v3::percentage::Percentage; use crate::pair::DEFAULT_COMMISSION_RATE; -use cosmwasm_testing_util::{AppResponse, Code, MockResult}; +use cosmwasm_testing_util::{Code, MockResult}; pub const ATOM_DENOM: &str = "ibc/1777D03C5392415FE659F0E8ECB2CE553C6550542A68E4707D5D46949116790B"; pub const APP_OWNER: &str = "admin"; @@ -20,25 +20,23 @@ macro_rules! create_entry_points_testing { }; } -pub trait AttributeUtil { - fn get_attributes(&self, index: usize) -> Vec; -} - -impl AttributeUtil for AppResponse { - fn get_attributes(&self, index: usize) -> Vec { - self.events[index].attributes[1..].to_vec() - } -} +#[cfg(not(feature = "test-tube"))] +pub type TestMockApp = cosmwasm_testing_util::MultiTestMockApp; +#[cfg(feature = "test-tube")] +pub type TestMockApp = cosmwasm_testing_util::TestTubeMockApp; #[derive(Deref, DerefMut)] pub struct MockApp { #[deref] #[deref_mut] - app: cosmwasm_testing_util::MockApp, + app: TestMockApp, + owner: Addr, + pub accounts: Vec, pub oracle_addr: Addr, pub factory_addr: Addr, pub router_addr: Addr, pub v3_addr: Addr, + pub staking_addr: Addr, } impl MockApp { @@ -48,20 +46,42 @@ impl MockApp { coin(1000000000000000000u128, ORAI_DENOM), coin(1000000000000000000u128, ATOM_DENOM), ]; - init_balances.push((APP_OWNER, &owner_balances)); - let app = cosmwasm_testing_util::MockApp::new(&init_balances); - + init_balances.insert(0, (APP_OWNER, &owner_balances)); + let (app, accounts) = TestMockApp::new(&init_balances); MockApp { app, + owner: Addr::unchecked(&accounts[0]), + accounts: accounts.into_iter().skip(1).collect(), oracle_addr: Addr::unchecked(""), factory_addr: Addr::unchecked(""), router_addr: Addr::unchecked(""), v3_addr: Addr::unchecked(""), + staking_addr: Addr::unchecked(""), + } + } + + pub fn set_token_contract(&mut self, code: Code) { + #[cfg(feature = "test-tube")] + { + self.app + .set_token_contract(include_bytes!("testdata/oraiswap-token.wasm")); + } + #[cfg(not(feature = "test-tube"))] + { + self.app.set_token_contract(code); } } pub fn set_oracle_contract(&mut self, code: Code) { - let code_id = self.upload(code); + let code_id; + #[cfg(feature = "test-tube")] + { + code_id = self.upload(include_bytes!("testdata/oraiswap-oracle.wasm")); + } + #[cfg(not(feature = "test-tube"))] + { + code_id = self.upload(code); + } self.oracle_addr = self .instantiate( code_id, @@ -80,8 +100,19 @@ impl MockApp { } pub fn set_factory_and_pair_contract(&mut self, factory_code: Code, pair_code: Code) { - let factory_id = self.upload(factory_code); - let pair_code_id = self.upload(pair_code); + let factory_id; + let pair_code_id; + #[cfg(feature = "test-tube")] + { + factory_id = self.upload(include_bytes!("testdata/oraiswap-factory.wasm")); + pair_code_id = self.upload(include_bytes!("testdata/oraiswap-pair.wasm")); + } + #[cfg(not(feature = "test-tube"))] + { + factory_id = self.upload(factory_code); + pair_code_id = self.upload(pair_code); + } + let token_code_id = self.token_id(); let oracle_addr = self.oracle_addr.clone(); self.factory_addr = self @@ -101,7 +132,15 @@ impl MockApp { } pub fn set_router_contract(&mut self, code: Code, factory_addr: Addr) { - let code_id = self.upload(code); + let code_id; + #[cfg(feature = "test-tube")] + { + code_id = self.upload(include_bytes!("testdata/oraiswap-router.wasm")); + } + #[cfg(not(feature = "test-tube"))] + { + code_id = self.upload(code); + } self.router_addr = self .instantiate( code_id, @@ -116,6 +155,30 @@ impl MockApp { .unwrap(); } + pub fn set_staking_contract(&mut self, code: Code, reward_addr: Addr) { + let code_id; + #[cfg(feature = "test-tube")] + { + code_id = self.upload(include_bytes!("testdata/oraiswap-staking.wasm")); + } + #[cfg(not(feature = "test-tube"))] + { + code_id = self.upload(code); + } + + let msg = crate::staking::InstantiateMsg { + owner: Some(self.owner.clone()), + rewarder: reward_addr, + minter: Some(self.owner.clone()), + oracle_addr: self.oracle_addr.clone(), + factory_addr: self.factory_addr.clone(), + base_denom: None, + }; + self.staking_addr = self + .instantiate(code_id, Addr::unchecked(APP_OWNER), &msg, &[], "staking") + .unwrap(); + } + // configure the oraiswap pair pub fn create_pairs(&mut self, asset_infos_list: &[[AssetInfo; 2]]) { for asset_infos in asset_infos_list.iter() { @@ -134,13 +197,14 @@ impl MockApp { pub fn create_pair(&mut self, asset_infos: [AssetInfo; 2]) -> Option { if !self.factory_addr.as_str().is_empty() { let contract_addr = self.factory_addr.clone(); + let admin = self.owner.clone(); let res = self .execute( - Addr::unchecked(APP_OWNER), + admin.clone(), contract_addr, &crate::factory::ExecuteMsg::CreatePair { asset_infos: asset_infos.clone(), - pair_admin: Some("admin".to_string()), + pair_admin: Some(admin.to_string()), }, &[], ) @@ -184,7 +248,7 @@ impl MockApp { pub fn query_pair(&self, asset_infos: [AssetInfo; 2]) -> StdResult { if !self.factory_addr.as_str().is_empty() { - return self.app.as_querier().query_wasm_smart( + return self.app.query( self.factory_addr.clone(), &crate::factory::QueryMsg::Pair { asset_infos }, ); @@ -194,12 +258,22 @@ impl MockApp { }) } + pub fn query_pool(&self, asset_info: AssetInfo, pool_addr: Addr) -> MockResult { + match asset_info { + AssetInfo::Token { contract_addr, .. } => { + self.query_token_balance(contract_addr.as_str(), pool_addr.as_str()) + } + AssetInfo::NativeToken { denom, .. } => self.query_balance(pool_addr, denom), + } + } + // configure the mint whitelist mock querier pub fn set_token_balances( &mut self, balances: &[(&str, &[(&str, u128)])], ) -> MockResult> { - self.set_token_balances_from(APP_OWNER, balances) + let sender = self.owner.to_string(); + self.set_token_balances_from(&sender, balances) } pub fn set_tax(&mut self, rate: Decimal, caps: &[(&str, u128)]) { @@ -231,7 +305,15 @@ impl MockApp { } pub fn create_v3(&mut self, code: Code) { - let code_id = self.upload(code); + let code_id; + #[cfg(feature = "test-tube")] + { + code_id = self.upload(include_bytes!("testdata/oraiswap-v3.wasm")); + } + #[cfg(not(feature = "test-tube"))] + { + code_id = self.upload(code); + } self.v3_addr = self .instantiate( code_id, @@ -250,11 +332,7 @@ impl MockApp { mod tests { use cosmwasm_std::{testing::MOCK_CONTRACT_ADDR, Addr, Coin, Uint128}; - use crate::{ - asset::AssetInfo, - querier::{query_supply, query_token_balance}, - testing::MockApp, - }; + use crate::{asset::AssetInfo, testing::MockApp}; #[test] fn token_balance_querier() { @@ -264,15 +342,12 @@ mod tests { app.set_token_balances(&[("AIRI", &[(&MOCK_CONTRACT_ADDR.to_string(), 123u128)])]) .unwrap(); + let token_addr = app.get_token_addr("AIRI").unwrap(); assert_eq!( Uint128::from(123u128), - query_token_balance( - &app.as_querier().into_empty(), - app.get_token_addr("AIRI").unwrap(), - Addr::unchecked(MOCK_CONTRACT_ADDR), - ) - .unwrap() + app.query_token_balance(token_addr.as_str(), MOCK_CONTRACT_ADDR,) + .unwrap() ); } @@ -341,13 +416,10 @@ mod tests { ], )]) .unwrap(); - assert_eq!( - query_supply( - &app.as_querier().into_empty(), - app.get_token_addr("LPA").unwrap() - ) - .unwrap(), + app.query_token_info(app.get_token_addr("LPA").unwrap()) + .unwrap() + .total_supply, Uint128::from(492u128) ) } @@ -386,20 +458,12 @@ mod tests { assert!(!token_info.is_native_token()); assert_eq!( - token_info - .query_pool( - &app.as_querier().into_empty(), - Addr::unchecked(MOCK_CONTRACT_ADDR) - ) + app.query_pool(token_info, Addr::unchecked(MOCK_CONTRACT_ADDR)) .unwrap(), Uint128::from(123u128) ); assert_eq!( - native_token_info - .query_pool( - &app.as_querier().into_empty(), - Addr::unchecked(MOCK_CONTRACT_ADDR) - ) + app.query_pool(native_token_info, Addr::unchecked(MOCK_CONTRACT_ADDR)) .unwrap(), Uint128::from(123u128) );