diff --git a/.gitignore b/.gitignore index 15d713cbc..225c53b1b 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,7 @@ data .mutagen.yml vendor/ .testchains + +x/ibc-rate-limit/contracts/rate-limiter/target/ + +x/ibc-rate-limit/target/ diff --git a/x/ibc-rate-limit/contracts/rate-limiter/.cargo/config b/x/ibc-rate-limit/.cargo/config.toml similarity index 100% rename from x/ibc-rate-limit/contracts/rate-limiter/.cargo/config rename to x/ibc-rate-limit/.cargo/config.toml diff --git a/x/ibc-rate-limit/Cargo.lock b/x/ibc-rate-limit/Cargo.lock index 2041d2e98..45587b50e 100644 --- a/x/ibc-rate-limit/Cargo.lock +++ b/x/ibc-rate-limit/Cargo.lock @@ -4,44 +4,201 @@ version = 3 [[package]] name = "ahash" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ "getrandom", "once_cell", "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.66" +version = "1.0.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10f00e1f6e58a40e807377c75c6a7f97bf9044fab57816f2414e6f5f4499d7b8" + +[[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 = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", + "rayon", +] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "base16ct" -version = "0.1.1" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" -version = "0.13.1" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" -version = "1.5.3" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bech32" +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 = "b645a089122eccb6111b4f81cbc1a49f5900ac4666bb93ac027feaecf15607bf" +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" [[package]] name = "block-buffer" @@ -54,24 +211,39 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] +[[package]] +name = "bnum" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56953345e39537a3e18bdaeba4cb0c58a78c1f61f361dc0fa7c5c7340ae87c5f" + +[[package]] +name = "bnum" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" + [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.2.1" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +dependencies = [ + "serde", +] [[package]] name = "cfg-if" @@ -81,47 +253,97 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.23" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ - "num-integer", "num-traits", ] [[package]] name = "const-oid" -version = "0.9.0" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "cosmos-sdk-proto" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32560304ab4c365791fd307282f76637213d8083c1a98490c35159cd67852237" +dependencies = [ + "prost 0.12.6", + "prost-types", + "tendermint-proto", +] + +[[package]] +name = "cosmwasm-core" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "722e23542a15cea1f65d4a1419c4cfd7a26706c70871a13a04238ca3f40f1661" +checksum = "d905990ef3afb5753bb709dc7de88e9e370aa32bcc2f31731d4b533b63e82490" [[package]] name = "cosmwasm-crypto" -version = "1.1.5" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28376836c7677e1ea6d6656a754582e88b91e544ce22fae42956d5fe5549a958" +checksum = "0f862b355f7e47711e0acfe6af92cb3fd8fd5936b66a9eaa338b51edabd1e77d" dependencies = [ - "digest 0.10.5", - "ed25519-zebra", + "digest 0.10.7", + "ed25519-zebra 3.1.0", "k256", "rand_core 0.6.4", "thiserror", ] +[[package]] +name = "cosmwasm-crypto" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b2a7bd9c1dd9a377a4dc0f4ad97d24b03c33798cd5a6d7ceb8869b41c5d2f2d" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "cosmwasm-core", + "digest 0.10.7", + "ecdsa", + "ed25519-zebra 4.0.3", + "k256", + "num-traits", + "p256", + "rand_core 0.6.4", + "rayon", + "sha2 0.10.8", + "thiserror", +] + +[[package]] +name = "cosmwasm-derive" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd85de6467cd1073688c86b39833679ae6db18cf4771471edd9809f15f1679f1" +dependencies = [ + "syn 1.0.109", +] + [[package]] name = "cosmwasm-derive" -version = "1.1.5" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eb69f4f7a8a4bce68c8fbd3646238fede1e77056e4ea31c5b6bfc37b709eec3" +checksum = "029910b409398fdf81955d7301b906caf81f2c42b013ea074fbd89720229c424" dependencies = [ - "syn", + "proc-macro2", + "quote", + "syn 2.0.77", ] [[package]] name = "cosmwasm-schema" -version = "1.1.5" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a227cfeb9a7152b26a354b1c990e930e962f75fd68f57ab5ae2ef888c8524292" +checksum = "4bc0d4d85e83438ab9a0fea9348446f7268bc016aacfebce37e998559f151294" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -132,64 +354,109 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "1.1.5" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3626cb42eef870de67f791e873711255325224d86f281bf628c42abd295f3a14" +checksum = "edf5c8adac41bb7751c050d7c4c18675be19ee128714454454575e894424eeef" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.77", ] [[package]] name = "cosmwasm-std" -version = "1.1.5" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46bf9157d060abbc55152aeadcace799d03dc630575daa66604079a1206cb060" +checksum = "2685c2182624b2e9e17f7596192de49a3f86b7a0c9a5f6b25c1df5e24592e836" dependencies = [ - "base64", - "cosmwasm-crypto", - "cosmwasm-derive", + "base64 0.21.7", + "bech32 0.9.1", + "bnum 0.10.0", + "cosmwasm-crypto 1.5.7", + "cosmwasm-derive 1.5.7", "derivative", "forward_ref", "hex", "schemars", "serde", - "serde-json-wasm 0.4.1", + "serde-json-wasm 0.5.2", + "sha2 0.10.8", + "static_assertions", + "thiserror", +] + +[[package]] +name = "cosmwasm-std" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51dec99a2e478715c0a4277f0dbeadbb8466500eb7dec873d0924edd086e77f1" +dependencies = [ + "base64 0.22.1", + "bech32 0.11.0", + "bnum 0.11.0", + "cosmwasm-core", + "cosmwasm-crypto 2.1.3", + "cosmwasm-derive 2.1.3", + "derive_more", + "hex", + "rand_core 0.6.4", + "schemars", + "serde", + "serde-json-wasm 1.0.1", + "sha2 0.10.8", + "static_assertions", "thiserror", - "uint", ] [[package]] name = "cosmwasm-storage" -version = "1.1.5" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b61fcfef87d15af0263e2e4d792af80355929674a3b4e29ffb3c898ec6e25852" +checksum = "66de2ab9db04757bcedef2b5984fbe536903ada4a8a9766717a4a71197ef34f6" dependencies = [ - "cosmwasm-std", + "cosmwasm-std 1.5.7", "serde", ] [[package]] name = "cpufeatures" -version = "0.2.5" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] [[package]] -name = "crunchy" -version = "0.2.2" +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 = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-bigint" -version = "0.4.9" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", "rand_core 0.6.4", @@ -221,53 +488,71 @@ dependencies = [ ] [[package]] -name = "cw-multi-test" -version = "0.13.4" +name = "curve25519-dalek" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f9a8ab7c3c29ec93cb7a39ce4b14a05e053153b4a17ef7cf2246af1b7c087e" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ - "anyhow", - "cosmwasm-std", - "cosmwasm-storage", - "cw-storage-plus 0.13.4", - "cw-utils", - "derivative", - "itertools 0.10.5", - "prost 0.9.0", - "schemars", - "serde", - "thiserror", + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", ] [[package]] -name = "cw-storage-plus" -version = "0.13.4" +name = "curve25519-dalek-derive" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "648b1507290bbc03a8d88463d7cd9b04b1fa0155e5eef366c4fa052b9caaac7a" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ - "cosmwasm-std", + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "cw-multi-test" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0ae276e7a06ad1b7e7da78a3d68aba80634cde30ee7fe8259a94e653603fef8" +dependencies = [ + "anyhow", + "bech32 0.11.0", + "cosmwasm-std 2.1.3", + "cw-storage-plus", + "cw-utils", + "derivative", + "itertools 0.13.0", + "prost 0.13.2", "schemars", "serde", + "sha2 0.10.8", + "thiserror", ] [[package]] name = "cw-storage-plus" -version = "0.16.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b6f91c0b94481a3e9ef1ceb183c37d00764f8751e39b45fc09f4d9b970d469" +checksum = "f13360e9007f51998d42b1bc6b7fa0141f74feae61ed5fd1e5b0a89eec7b5de1" dependencies = [ - "cosmwasm-std", + "cosmwasm-std 2.1.3", "schemars", "serde", ] [[package]] name = "cw-utils" -version = "0.13.4" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dbaecb78c8e8abfd6b4258c7f4fbeb5c49a5e45ee4d910d3240ee8e1d714e1b" +checksum = "07dfee7f12f802431a856984a32bce1cb7da1e6c006b5409e3981035ce562dec" dependencies = [ - "cosmwasm-std", + "cosmwasm-schema", + "cosmwasm-std 2.1.3", "schemars", "serde", "thiserror", @@ -275,26 +560,38 @@ dependencies = [ [[package]] name = "cw2" -version = "0.13.4" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cf4639517490dd36b333bbd6c4fbd92e325fd0acf4683b41753bc5eb63bfc1" +checksum = "b04852cd38f044c0751259d5f78255d07590d136b8a86d4e09efdd7666bd6d27" dependencies = [ - "cosmwasm-std", - "cw-storage-plus 0.13.4", + "cosmwasm-schema", + "cosmwasm-std 2.1.3", + "cw-storage-plus", "schemars", + "semver", "serde", + "thiserror", ] [[package]] name = "der" -version = "0.6.0" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dd2ae565c0a381dde7fade45fce95984c568bdcb4700a4fdbe3175e0380b2f" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "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" @@ -303,7 +600,28 @@ checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", + "unicode-xid", ] [[package]] @@ -317,31 +635,43 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.5" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.3", + "block-buffer 0.10.4", + "const-oid", "crypto-common", "subtle", ] [[package]] name = "dyn-clone" -version = "1.0.9" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f94fa09c2aeea5b8839e414b7b841bf429fd25b9c522116ac97ee87856d88b2" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "ecdsa" -version = "0.14.8" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", + "digest 0.10.7", "elliptic-curve", "rfc6979", "signature", + "spki", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", ] [[package]] @@ -350,8 +680,8 @@ 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", @@ -359,22 +689,36 @@ 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.8.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "elliptic-curve" -version = "0.12.3" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", - "der", - "digest 0.10.5", + "digest 0.10.7", "ff", "generic-array", "group", @@ -387,14 +731,29 @@ dependencies = [ [[package]] name = "ff" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ "rand_core 0.6.4", "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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c606d892c9de11507fa0dcffc116434f94e105d0bbdc4e405b61519464c49d7b" +dependencies = [ + "paste", +] + [[package]] name = "forward_ref" version = "1.0.0" @@ -403,19 +762,20 @@ checksum = "c8cbd1169bd7b4a0a20d92b9af7a7e0422888bd38a6f5ec29c1fd8c1558a272e" [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -424,9 +784,9 @@ dependencies = [ [[package]] name = "group" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", "rand_core 0.6.4", @@ -439,9 +799,34 @@ 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]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + [[package]] name = "hex" version = "0.4.3" @@ -454,7 +839,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.5", + "digest 0.10.7", ] [[package]] @@ -466,6 +851,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.13.0" @@ -477,171 +871,296 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.4" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "k256" -version = "0.11.6" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ "cfg-if", "ecdsa", "elliptic-curve", - "sha2 0.10.6", + "once_cell", + "sha2 0.10.8", + "signature", ] [[package]] name = "libc" -version = "0.2.137" +version = "0.2.158" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "neutron-std" +version = "4.2.2-rc" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" +checksum = "ea7d51a6eb54c2f550bb01630c8414b1988899d645e076d8ae52c068999b9951" +dependencies = [ + "bech32 0.9.1", + "chrono", + "cosmos-sdk-proto", + "cosmwasm-schema", + "cosmwasm-std 2.1.3", + "neutron-std-derive", + "prost 0.12.6", + "prost-types", + "protobuf", + "schemars", + "serde", + "serde-cw-value", + "serde-json-wasm 1.0.1", + "serde_json", + "speedate", + "tendermint-proto", + "thiserror", +] + +[[package]] +name = "neutron-std-derive" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22f4948005dcbb0c4eb644141d00dcbdc422b1b7024fb008712ca2960392ec11" +dependencies = [ + "itertools 0.10.5", + "proc-macro2", + "prost-types", + "quote", + "syn 1.0.109", +] + +[[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" +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-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] [[package]] name = "once_cell" -version = "1.16.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] -name = "osmosis-std" -version = "0.12.0" +name = "p256" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b3792977036dc49cfc9af9fd7a6c021fd48dfffc8ebf09324201506c65a47a" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" dependencies = [ - "chrono", - "cosmwasm-std", - "osmosis-std-derive", - "prost 0.11.2", - "prost-types", - "schemars", - "serde", - "serde-cw-value", + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2 0.10.8", ] [[package]] -name = "osmosis-std-derive" -version = "0.12.0" +name = "paste" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c501f2b8ff88b1c60ab671d7b808e947f384fa2524fe4ec8c06f63ef4be29979" -dependencies = [ - "itertools 0.10.5", - "proc-macro2", - "quote", - "syn", -] +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pkcs8" -version = "0.9.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ "der", "spki", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[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.47" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "prost" -version = "0.9.0" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", - "prost-derive 0.9.0", + "prost-derive 0.12.6", ] [[package]] name = "prost" -version = "0.11.2" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0841812012b2d4a6145fae9a6af1534873c32aa67fff26bd09f8fa42c83f95a" +checksum = "3b2ecbe40f08db5c006b5764a2645f7f3f141ce756412ac9e1dd6087e6d32995" dependencies = [ "bytes", - "prost-derive 0.11.2", + "prost-derive 0.13.2", ] [[package]] name = "prost-derive" -version = "0.9.0" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", - "itertools 0.10.5", + "itertools 0.12.1", "proc-macro2", "quote", - "syn", + "syn 2.0.77", ] [[package]] name = "prost-derive" -version = "0.11.2" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "164ae68b6587001ca506d3bf7f1000bfa248d0e1217b618108fba4ec1d0cc306" +checksum = "acf0c195eebb4af52c752bec4f52f645da98b6e92077a04110c7f349477ae5ac" dependencies = [ "anyhow", - "itertools 0.10.5", + "itertools 0.13.0", "proc-macro2", "quote", - "syn", + "syn 2.0.77", ] [[package]] name = "prost-types" -version = "0.11.2" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747761bc3dc48f9a34553bf65605cf6cb6288ba219f3450b4275dbd81539551a" +checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" dependencies = [ - "bytes", - "prost 0.11.2", + "prost 0.12.6", +] + +[[package]] +name = "protobuf" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b65f4a8ec18723a734e5dc09c173e0abf9690432da5340285d536edcb4dac190" +dependencies = [ + "once_cell", + "protobuf-support", + "thiserror", +] + +[[package]] +name = "protobuf-support" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6872f4d4f4b98303239a2b5838f5bbbb77b01ffc892d627957f37a22d7cfe69c" +dependencies = [ + "thiserror", ] [[package]] name = "quote" -version = "1.0.21" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" 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" @@ -662,45 +1181,78 @@ name = "rate-limiter" version = "0.1.0" dependencies = [ "cosmwasm-schema", - "cosmwasm-std", + "cosmwasm-std 2.1.3", "cosmwasm-storage", "cw-multi-test", - "cw-storage-plus 0.16.0", + "cw-storage-plus", "cw2", "hex", - "itertools 0.13.0", - "osmosis-std", - "osmosis-std-derive", - "prost 0.11.2", + "itertools 0.10.5", + "neutron-std", + "prost 0.12.6", "schemars", "serde", - "serde-json-wasm 0.5.2", - "sha2 0.10.6", + "serde-json-wasm 1.0.1", + "sha2 0.10.8", "thiserror", ] +[[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 = "rfc6979" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "crypto-bigint", "hmac", - "zeroize", + "subtle", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", ] +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + [[package]] name = "ryu" -version = "1.0.11" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "schemars" -version = "0.8.11" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a5fb6c61f29e723026dc8e923d94c694313212abbecbbe5f55a7748eec5b307" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" dependencies = [ "dyn-clone", "schemars_derive", @@ -710,21 +1262,21 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.11" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f188d036977451159430f3b8dc82ec76364a42b7e289c2b18a9a18f4470058e9" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn", + "syn 2.0.77", ] [[package]] name = "sec1" -version = "0.3.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct", "der", @@ -734,11 +1286,17 @@ dependencies = [ "zeroize", ] +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + [[package]] name = "serde" -version = "1.0.147" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] @@ -754,51 +1312,61 @@ dependencies = [ [[package]] name = "serde-json-wasm" -version = "0.4.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479b4dbc401ca13ee8ce902851b834893251404c4f3c65370a49e047a6be09a5" +checksum = "9e9213a07d53faa0b8dd81e767a54a8188a242fdb9be99ab75ec576a774bfdd7" dependencies = [ "serde", ] [[package]] name = "serde-json-wasm" -version = "0.5.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e9213a07d53faa0b8dd81e767a54a8188a242fdb9be99ab75ec576a774bfdd7" +checksum = "f05da0d153dd4595bdffd5099dc0e9ce425b205ee648eb93437ff7302af8c9a5" +dependencies = [ + "serde", +] + +[[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.147" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.77", ] [[package]] name = "serde_derive_internals" -version = "0.26.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.77", ] [[package]] name = "serde_json" -version = "1.0.87" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -818,30 +1386,40 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.6" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.5", + "digest 0.10.7", ] [[package]] name = "signature" -version = "1.6.4" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "digest 0.10.5", + "digest 0.10.7", "rand_core 0.6.4", ] +[[package]] +name = "speedate" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "242f76c50fd18cbf098607090ade73a08d39cfd84ea835f3796a2c855223b19b" +dependencies = [ + "strum", + "strum_macros", +] + [[package]] name = "spki" -version = "0.6.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", "der", @@ -853,72 +1431,155 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strum" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.25.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.77", +] + [[package]] name = "subtle" -version = "2.4.1" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] [[package]] name = "syn" -version = "1.0.103" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "tendermint-proto" +version = "0.34.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b797dd3d2beaaee91d2f065e7bdf239dc8d80bba4a183a288bc1279dd5a69a1e" +dependencies = [ + "bytes", + "flex-error", + "num-derive", + "num-traits", + "prost 0.12.6", + "prost-types", + "serde", + "serde_bytes", + "subtle-encoding", + "time", +] + [[package]] name = "thiserror" -version = "1.0.37" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.37" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.77", ] [[package]] -name = "typenum" -version = "1.15.0" +name = "time" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "num-conv", + "powerfmt", + "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 = "uint" -version = "0.9.4" +name = "time-macros" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a45526d29728d135c2900b0d30573fe3ee79fceb12ef534c7bb30e810a91b601" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", + "num-conv", + "time-core", ] +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + [[package]] name = "unicode-ident" -version = "1.0.5" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-xid" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" +checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "wasi" @@ -926,8 +1587,43 @@ 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 = [ + "byteorder", + "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.77", +] + [[package]] name = "zeroize" -version = "1.5.7" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +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.77", +] diff --git a/x/ibc-rate-limit/Cargo.toml b/x/ibc-rate-limit/Cargo.toml index 9e4bf04d4..64e7f0b3a 100644 --- a/x/ibc-rate-limit/Cargo.toml +++ b/x/ibc-rate-limit/Cargo.toml @@ -1,5 +1,4 @@ [workspace] - members = [ 'contracts/*', ] diff --git a/x/ibc-rate-limit/bytecode/rate_limiter.wasm b/x/ibc-rate-limit/bytecode/rate_limiter.wasm index d3300802d..31e5820bc 100644 Binary files a/x/ibc-rate-limit/bytecode/rate_limiter.wasm and b/x/ibc-rate-limit/bytecode/rate_limiter.wasm differ diff --git a/x/ibc-rate-limit/contracts/rate-limiter/Cargo.toml b/x/ibc-rate-limit/contracts/rate-limiter/Cargo.toml index 1c8330d32..8a40ba6c6 100644 --- a/x/ibc-rate-limit/contracts/rate-limiter/Cargo.toml +++ b/x/ibc-rate-limit/contracts/rate-limiter/Cargo.toml @@ -16,9 +16,6 @@ exclude = [ crate-type = ["cdylib", "rlib"] [features] -# for more explicit tests, cargo test --features=backtraces -backtraces = ["cosmwasm-std/backtraces"] -# use library feature to disable all instantiate/execute/query exports library = [] # Use the verbose responses feature if you want to include information about # the remaining quotas in the SendPacket/RecvPacket responses @@ -30,23 +27,21 @@ optimize = """docker run --rm -v "$(pwd)":/code \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ cosmwasm/rust-optimizer:0.12.6 """ - [dependencies] -cosmwasm-std = { version = "1.1.5", features = ["stargate", "cosmwasm_1_1"]} -cosmwasm-schema = "1.1.5" -cosmwasm-storage = "1.1.5" -cw-storage-plus = "0.16.0" -cw2 = "0.13.2" -schemars = "0.8.8" -serde = { version = "1.0.137", default-features = false, features = ["derive"] } -thiserror = { version = "1.0.31" } -prost = {version = "0.11.2", default-features = false, features = ["prost-derive"]} -osmosis-std-derive = {version = "0.12.0"} -osmosis-std = "0.12.0" +cosmwasm-std = {version = "2.1.0", features = ["cosmwasm_2_0", "std"]} +cosmwasm-schema = {version = "2.1.0", default-features = false} +cosmwasm-storage = "1" +cw-storage-plus = "2" +cw2 = "2" +schemars = "0.8.15" +serde = {version = "1.0.188", features = ["derive"], default-features = false} +thiserror = "1.0.49" +prost = "0.12.3" +neutron-std = "4.2.2-rc" sha2 = "0.10.6" hex = "0.4.3" [dev-dependencies] -cw-multi-test = "0.13.2" -serde-json-wasm = "0.5.2" -itertools = "0.13" \ No newline at end of file +cw-multi-test = "2.1.1" +serde-json-wasm = "1.0.0" +itertools = "0.10" \ No newline at end of file diff --git a/x/ibc-rate-limit/contracts/rate-limiter/LICENSE b/x/ibc-rate-limit/contracts/rate-limiter/LICENSE new file mode 100644 index 000000000..e8609a2c0 --- /dev/null +++ b/x/ibc-rate-limit/contracts/rate-limiter/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Range + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/x/ibc-rate-limit/contracts/rate-limiter/src/contract_tests.rs b/x/ibc-rate-limit/contracts/rate-limiter/src/contract_tests.rs index 35d346dbf..cf1c795b1 100644 --- a/x/ibc-rate-limit/contracts/rate-limiter/src/contract_tests.rs +++ b/x/ibc-rate-limit/contracts/rate-limiter/src/contract_tests.rs @@ -3,7 +3,7 @@ use crate::packet::Packet; use crate::state::rbac::Roles; use crate::{contract::*, test_msg_recv, test_msg_send, ContractError}; -use cosmwasm_std::testing::{mock_dependencies, mock_env, mock_info}; +use cosmwasm_std::testing::{mock_dependencies, mock_env, mock_info, MockApi}; use cosmwasm_std::{from_binary, Addr, Attribute, MessageInfo, Uint256}; use crate::helpers::tests::verify_query_response; @@ -11,16 +11,16 @@ use crate::msg::{InstantiateMsg, MigrateMsg, PathMsg, QueryMsg, QuotaMsg, SudoMs use crate::state::flow::tests::RESET_TIME_WEEKLY; use crate::state::rate_limit::RateLimit; use crate::state::storage::{GOVMODULE, IBCMODULE, RATE_LIMIT_TRACKERS, RBAC_PERMISSIONS}; -const IBC_ADDR: &str = "osmo1vz5e6tzdjlzy2f7pjvx0ecv96h8r4m2y92thdm"; -const GOV_ADDR: &str = "osmo1tzz5zf2u68t00un2j4lrrnkt2ztd46kfzfp58r"; +const IBC_ADDR: &str = "neutron1cdlz8scnf3mmxdnf4njmtp7vz4gps7fswphrqn"; +const GOV_ADDR: &str = "neutron1w02khza7ux68ccwmz2hln97mkjspjxes8y2k9v"; #[test] // Tests we ccan instantiate the contract and that the owners are set correctly fn proper_instantiation() { let mut deps = mock_dependencies(); let msg = InstantiateMsg { - gov_module: Addr::unchecked(GOV_ADDR), - ibc_module: Addr::unchecked(IBC_ADDR), + gov_module: MockApi::default().addr_make(GOV_ADDR), + ibc_module: MockApi::default().addr_make(IBC_ADDR), paths: vec![], }; let info = mock_info(IBC_ADDR, &[]); @@ -30,11 +30,11 @@ fn proper_instantiation() { assert_eq!(0, res.messages.len()); // The ibc and gov modules are properly stored - assert_eq!(IBCMODULE.load(deps.as_ref().storage).unwrap(), IBC_ADDR); - assert_eq!(GOVMODULE.load(deps.as_ref().storage).unwrap(), GOV_ADDR); + assert_eq!(IBCMODULE.load(deps.as_ref().storage).unwrap().to_string(), MockApi::default().addr_make(IBC_ADDR).to_string()); + assert_eq!(GOVMODULE.load(deps.as_ref().storage).unwrap().to_string(), MockApi::default().addr_make(GOV_ADDR).to_string()); let permissions = RBAC_PERMISSIONS - .load(&mut deps.storage, GOV_ADDR.to_string()) + .load(&mut deps.storage, MockApi::default().addr_make(GOV_ADDR).to_string()) .unwrap(); for permission in Roles::all_roles() { assert!(permissions.contains(&permission)); @@ -47,8 +47,8 @@ fn consume_allowance() { let quota = QuotaMsg::new("weekly", RESET_TIME_WEEKLY, 10, 10); let msg = InstantiateMsg { - gov_module: Addr::unchecked(GOV_ADDR), - ibc_module: Addr::unchecked(IBC_ADDR), + gov_module: MockApi::default().addr_make(GOV_ADDR), + ibc_module: MockApi::default().addr_make(IBC_ADDR), paths: vec![PathMsg { channel_id: "any".to_string(), denom: "denom".to_string(), @@ -86,8 +86,8 @@ fn symetric_flows_dont_consume_allowance() { let quota = QuotaMsg::new("weekly", RESET_TIME_WEEKLY, 10, 10); let msg = InstantiateMsg { - gov_module: Addr::unchecked(GOV_ADDR), - ibc_module: Addr::unchecked(IBC_ADDR), + gov_module: MockApi::default().addr_make(GOV_ADDR), + ibc_module: MockApi::default().addr_make(IBC_ADDR), paths: vec![PathMsg { channel_id: "any".to_string(), denom: "denom".to_string(), @@ -148,8 +148,8 @@ fn asymetric_quotas() { let quota = QuotaMsg::new("weekly", RESET_TIME_WEEKLY, 4, 1); let msg = InstantiateMsg { - gov_module: Addr::unchecked(GOV_ADDR), - ibc_module: Addr::unchecked(IBC_ADDR), + gov_module: MockApi::default().addr_make(GOV_ADDR), + ibc_module: MockApi::default().addr_make(IBC_ADDR), paths: vec![PathMsg { channel_id: "any".to_string(), denom: "denom".to_string(), @@ -231,8 +231,8 @@ fn query_state() { let quota = QuotaMsg::new("weekly", RESET_TIME_WEEKLY, 10, 10); let msg = InstantiateMsg { - gov_module: Addr::unchecked(GOV_ADDR), - ibc_module: Addr::unchecked(IBC_ADDR), + gov_module: MockApi::default().addr_make(GOV_ADDR), + ibc_module: MockApi::default().addr_make(IBC_ADDR), paths: vec![PathMsg { channel_id: "any".to_string(), denom: "denom".to_string(), @@ -296,8 +296,8 @@ fn bad_quotas() { let mut deps = mock_dependencies(); let msg = InstantiateMsg { - gov_module: Addr::unchecked(GOV_ADDR), - ibc_module: Addr::unchecked(IBC_ADDR), + gov_module: MockApi::default().addr_make(GOV_ADDR), + ibc_module: MockApi::default().addr_make(IBC_ADDR), paths: vec![PathMsg { channel_id: "any".to_string(), denom: "denom".to_string(), @@ -337,8 +337,8 @@ fn undo_send() { let quota = QuotaMsg::new("weekly", RESET_TIME_WEEKLY, 10, 10); let msg = InstantiateMsg { - gov_module: Addr::unchecked(GOV_ADDR), - ibc_module: Addr::unchecked(IBC_ADDR), + gov_module: MockApi::default().addr_make(GOV_ADDR), + ibc_module: MockApi::default().addr_make(IBC_ADDR), paths: vec![PathMsg { channel_id: "any".to_string(), denom: "denom".to_string(), @@ -415,12 +415,12 @@ fn proper_migrate() { deps.as_mut(), env, MessageInfo { - sender: Addr::unchecked("osmo16tumts0kckpfp9fk7e3rnx9ahzn70dyyqfypgh"), + sender: MockApi::default().addr_make("osmo16tumts0kckpfp9fk7e3rnx9ahzn70dyyqfypgh"), funds: vec![], }, InstantiateMsg { - gov_module: Addr::unchecked(GOV_ADDR), - ibc_module: Addr::unchecked(IBC_ADDR), + gov_module: MockApi::default().addr_make(GOV_ADDR), + ibc_module: MockApi::default().addr_make(IBC_ADDR), paths: vec![], }, ) @@ -428,21 +428,21 @@ fn proper_migrate() { // test that instantiate set the correct gov module address and RBAC permissions let permissions = RBAC_PERMISSIONS - .load(&mut deps.storage, GOV_ADDR.to_string()) + .load(&mut deps.storage, MockApi::default().addr_make(GOV_ADDR).to_string()) .unwrap(); for permission in Roles::all_roles() { assert!(permissions.contains(&permission)); } - assert_eq!(GOVMODULE.load(deps.as_ref().storage).unwrap(), GOV_ADDR); + assert_eq!(GOVMODULE.load(deps.as_ref().storage).unwrap().to_string(), MockApi::default().addr_make(GOV_ADDR).to_string()); // revoke all roles from the gov contract, instantiation should re-asssign - crate::rbac::revoke_role(&mut deps.as_mut(), GOV_ADDR.to_string(), Roles::all_roles()).unwrap(); + crate::rbac::revoke_role(&mut deps.as_mut(), MockApi::default().addr_make(GOV_ADDR).to_string(), Roles::all_roles()).unwrap(); migrate(deps.as_mut(), mock_env(), MigrateMsg {}).unwrap(); // ensure migration assigned all the roles let permissions = RBAC_PERMISSIONS - .load(&mut deps.storage, GOV_ADDR.to_string()) + .load(&mut deps.storage, MockApi::default().addr_make(GOV_ADDR).to_string()) .unwrap(); for permission in Roles::all_roles() { assert!(permissions.contains(&permission)); diff --git a/x/ibc-rate-limit/contracts/rate-limiter/src/execute.rs b/x/ibc-rate-limit/contracts/rate-limiter/src/execute.rs index 7ff9aad4b..a39c5faac 100644 --- a/x/ibc-rate-limit/contracts/rate-limiter/src/execute.rs +++ b/x/ibc-rate-limit/contracts/rate-limiter/src/execute.rs @@ -143,7 +143,7 @@ pub fn unset_denom_restrictions( #[cfg(test)] mod tests { - use cosmwasm_std::testing::{mock_dependencies, mock_env, mock_info}; + use cosmwasm_std::testing::{mock_dependencies, mock_env, mock_info, MockApi}; use cosmwasm_std::{from_binary, Addr, StdError}; use crate::contract::{execute, query}; @@ -156,23 +156,23 @@ mod tests { }; use crate::ContractError; - const IBC_ADDR: &str = "osmo1vz5e6tzdjlzy2f7pjvx0ecv96h8r4m2y92thdm"; - const GOV_ADDR: &str = "osmo1tzz5zf2u68t00un2j4lrrnkt2ztd46kfzfp58r"; + const IBC_ADDR: &str = "neutron1cdlz8scnf3mmxdnf4njmtp7vz4gps7fswphrqn"; + const GOV_ADDR: &str = "neutron1w02khza7ux68ccwmz2hln97mkjspjxes8y2k9v"; #[test] // Tests AddPath and RemovePath messages fn management_add_and_remove_path() { let mut deps = mock_dependencies(); IBCMODULE - .save(deps.as_mut().storage, &Addr::unchecked(IBC_ADDR)) + .save(deps.as_mut().storage, &MockApi::default().addr_make(IBC_ADDR)) .unwrap(); GOVMODULE - .save(deps.as_mut().storage, &Addr::unchecked(GOV_ADDR)) + .save(deps.as_mut().storage, &MockApi::default().addr_make(GOV_ADDR)) .unwrap(); // grant role to IBC_ADDR crate::rbac::grant_role( &mut deps.as_mut(), - IBC_ADDR.to_string(), + MockApi::default().addr_make(IBC_ADDR).to_string(), vec![Roles::AddRateLimit, Roles::RemoveRateLimit], ) .unwrap(); @@ -186,7 +186,7 @@ mod tests { send_recv: (3, 5), }], }; - let info = mock_info(IBC_ADDR, &[]); + let info = mock_info(&MockApi::default().addr_make(IBC_ADDR).to_string(), &[]); let env = mock_env(); let res = execute(deps.as_mut(), env.clone(), info, msg).unwrap(); @@ -222,7 +222,7 @@ mod tests { send_recv: (3, 5), }], }; - let info = mock_info(IBC_ADDR, &[]); + let info = mock_info(&MockApi::default().addr_make(IBC_ADDR).to_string(), &[]); let env = mock_env(); execute(deps.as_mut(), env.clone(), info, msg).unwrap(); @@ -233,7 +233,7 @@ mod tests { denom: "denom".to_string(), }; - let info = mock_info(IBC_ADDR, &[]); + let info = mock_info(&MockApi::default().addr_make(IBC_ADDR).to_string(), &[]); let env = mock_env(); execute(deps.as_mut(), env.clone(), info, msg).unwrap(); @@ -269,7 +269,7 @@ mod tests { send_recv: (50, 30), }], }; - let info = mock_info(IBC_ADDR, &[]); + let info = mock_info(&MockApi::default().addr_make(IBC_ADDR).to_string(), &[]); let env = mock_env(); execute(deps.as_mut(), env.clone(), info, msg).unwrap(); @@ -304,12 +304,12 @@ mod tests { denom: denom.clone(), allowed_channels: allowed_channels.clone(), }; - let info = mock_info("executor", &[]); + let info = mock_info(&MockApi::default().addr_make("executor").to_string(), &[]); // Grant the necessary role crate::rbac::grant_role( &mut deps.as_mut(), - "executor".to_string(), + MockApi::default().addr_make("executor").to_string(), vec![Roles::ManageDenomRestrictions], ) .unwrap(); @@ -336,12 +336,12 @@ mod tests { denom: denom.clone(), allowed_channels: allowed_channels.clone(), }; - let info = mock_info("executor", &[]); + let info = mock_info(&MockApi::default().addr_make("executor").to_string(), &[]); // Grant the necessary role crate::rbac::grant_role( &mut deps.as_mut(), - "executor".to_string(), + MockApi::default().addr_make("executor").to_string(), vec![Roles::ManageDenomRestrictions], ) .unwrap(); @@ -380,12 +380,12 @@ mod tests { denom: denom.clone(), allowed_channels: allowed_channels.clone(), }; - let info = mock_info("executor", &[]); + let info = mock_info(&MockApi::default().addr_make("executor").to_string(), &[]); // Grant the necessary role crate::rbac::grant_role( &mut deps.as_mut(), - "executor".to_string(), + MockApi::default().addr_make("executor").to_string(), vec![Roles::ManageDenomRestrictions], ) .unwrap(); diff --git a/x/ibc-rate-limit/contracts/rate-limiter/src/helpers.rs b/x/ibc-rate-limit/contracts/rate-limiter/src/helpers.rs index 8cccc9e7c..fc3d5a814 100644 --- a/x/ibc-rate-limit/contracts/rate-limiter/src/helpers.rs +++ b/x/ibc-rate-limit/contracts/rate-limiter/src/helpers.rs @@ -31,7 +31,7 @@ impl RateLimitingContract { let msg = to_binary(&msg.into()).unwrap(); cw_multi_test::SudoMsg::Wasm(cw_multi_test::WasmSudo { contract_addr: self.addr(), - msg, + message: msg, }) } } diff --git a/x/ibc-rate-limit/contracts/rate-limiter/src/integration_tests.rs b/x/ibc-rate-limit/contracts/rate-limiter/src/integration_tests.rs index 49c24627c..c86b19972 100644 --- a/x/ibc-rate-limit/contracts/rate-limiter/src/integration_tests.rs +++ b/x/ibc-rate-limit/contracts/rate-limiter/src/integration_tests.rs @@ -6,7 +6,7 @@ use crate::{ state::{rate_limit::RateLimit, rbac::Roles}, test_msg_send, ContractError, }; -use cosmwasm_std::{Addr, Coin, Empty, Timestamp, Uint128, Uint256}; +use cosmwasm_std::{testing::MockApi, Addr, Coin, Empty, Timestamp, Uint128, Uint256}; use cw_multi_test::{App, AppBuilder, Contract, ContractWrapper, Executor}; use crate::{ @@ -25,8 +25,8 @@ pub fn contract_template() -> Box> { } const USER: &str = "USER"; -const IBC_ADDR: &str = "osmo1vz5e6tzdjlzy2f7pjvx0ecv96h8r4m2y92thdm"; -const GOV_ADDR: &str = "osmo1tzz5zf2u68t00un2j4lrrnkt2ztd46kfzfp58r"; +const IBC_ADDR: &str = "neutron1cdlz8scnf3mmxdnf4njmtp7vz4gps7fswphrqn"; +const GOV_ADDR: &str = "neutron1w02khza7ux68ccwmz2hln97mkjspjxes8y2k9v"; const NATIVE_DENOM: &str = "nosmo"; fn mock_app() -> App { @@ -51,7 +51,7 @@ fn proper_instantiate(paths: Vec) -> (App, RateLimitingContract) { let cw_code_id = app.store_code(contract_template()); let msg = InstantiateMsg { - gov_module: Addr::unchecked(GOV_ADDR), + gov_module: MockApi::default().addr_make(GOV_ADDR), ibc_module: Addr::unchecked(IBC_ADDR), paths, }; @@ -59,7 +59,7 @@ fn proper_instantiate(paths: Vec) -> (App, RateLimitingContract) { let cw_rate_limit_contract_addr = app .instantiate_contract( cw_code_id, - Addr::unchecked(GOV_ADDR), + MockApi::default().addr_make(GOV_ADDR), &msg, &[], "test", @@ -415,7 +415,7 @@ fn add_paths_later() { }; let cosmos_msg = cw_rate_limit_contract.call(management_msg).unwrap(); - app.execute(Addr::unchecked(GOV_ADDR), cosmos_msg).unwrap(); + app.execute(MockApi::default().addr_make(GOV_ADDR), cosmos_msg).unwrap(); // Executing the same message again should fail, as it is now rate limited let cosmos_msg = cw_rate_limit_contract.sudo(msg); @@ -445,10 +445,10 @@ fn test_execute_add_path() { let cosmos_msg = cw_rate_limit_contract.call(management_msg).unwrap(); // non gov cant invoke assert!(app - .execute(Addr::unchecked("foobar"), cosmos_msg.clone()) + .execute(MockApi::default().addr_make("foobar"), cosmos_msg.clone()) .is_err()); // gov addr can invoke - app.execute(Addr::unchecked(GOV_ADDR), cosmos_msg.clone()) + app.execute(MockApi::default().addr_make(GOV_ADDR), cosmos_msg.clone()) .unwrap(); // Sending 1% to use the daily allowance @@ -499,10 +499,10 @@ fn test_execute_remove_path() { let cosmos_msg = cw_rate_limit_contract.call(management_msg).unwrap(); // non gov cant invoke assert!(app - .execute(Addr::unchecked("foobar"), cosmos_msg.clone()) + .execute(MockApi::default().addr_make("foobar"), cosmos_msg.clone()) .is_err()); // gov addr can invoke - app.execute(Addr::unchecked(GOV_ADDR), cosmos_msg.clone()) + app.execute(MockApi::default().addr_make(GOV_ADDR), cosmos_msg.clone()) .unwrap(); // rate limits should be removed @@ -550,10 +550,10 @@ fn test_execute_reset_path_quota() { let cosmos_msg = cw_rate_limit_contract.call(management_msg).unwrap(); // non gov cant invoke assert!(app - .execute(Addr::unchecked("foobar"), cosmos_msg.clone()) + .execute(MockApi::default().addr_make("foobar"), cosmos_msg.clone()) .is_err()); // gov addr can invoke - app.execute(Addr::unchecked(GOV_ADDR), cosmos_msg.clone()) + app.execute(MockApi::default().addr_make(GOV_ADDR), cosmos_msg.clone()) .unwrap(); let response = app @@ -606,16 +606,16 @@ fn test_execute_grant_and_revoke_role() { }]); let management_msg = ExecuteMsg::GrantRole { - signer: "foobar".to_string(), + signer: MockApi::default().addr_make("foobar").to_string(), roles: vec![Roles::GrantRole], }; let cosmos_msg = cw_rate_limit_contract.call(management_msg).unwrap(); // non gov cant invoke assert!(app - .execute(Addr::unchecked("foobar"), cosmos_msg.clone()) + .execute(MockApi::default().addr_make("foobar"), cosmos_msg.clone()) .is_err()); // gov addr can invoke - app.execute(Addr::unchecked(GOV_ADDR), cosmos_msg.clone()) + app.execute(MockApi::default().addr_make(GOV_ADDR), cosmos_msg.clone()) .unwrap(); let response = app @@ -623,7 +623,7 @@ fn test_execute_grant_and_revoke_role() { .query_wasm_smart::>( cw_rate_limit_contract.addr(), &QueryMsg::GetRoles { - owner: "foobar".to_string(), + owner: MockApi::default().addr_make("foobar").to_string(), }, ) .unwrap(); @@ -632,11 +632,11 @@ fn test_execute_grant_and_revoke_role() { // test foobar can grant a role let management_msg = ExecuteMsg::GrantRole { - signer: "foobarbaz".to_string(), + signer: MockApi::default().addr_make("foobarbaz").to_string(), roles: vec![Roles::GrantRole], }; let cosmos_msg = cw_rate_limit_contract.call(management_msg).unwrap(); - app.execute(Addr::unchecked("foobar"), cosmos_msg.clone()) + app.execute(MockApi::default().addr_make("foobar"), cosmos_msg.clone()) .unwrap(); let response = app @@ -644,7 +644,7 @@ fn test_execute_grant_and_revoke_role() { .query_wasm_smart::>( cw_rate_limit_contract.addr(), &QueryMsg::GetRoles { - owner: "foobarbaz".to_string(), + owner: MockApi::default().addr_make("foobarbaz").to_string(), }, ) .unwrap(); @@ -654,11 +654,11 @@ fn test_execute_grant_and_revoke_role() { // test role revocation let management_msg = ExecuteMsg::RevokeRole { - signer: "foobar".to_string(), + signer: MockApi::default().addr_make("foobar").to_string(), roles: vec![Roles::GrantRole], }; let cosmos_msg = cw_rate_limit_contract.call(management_msg).unwrap(); - app.execute(Addr::unchecked(GOV_ADDR), cosmos_msg.clone()) + app.execute(MockApi::default().addr_make(GOV_ADDR), cosmos_msg.clone()) .unwrap(); // foobar should no longer have roles @@ -667,7 +667,7 @@ fn test_execute_grant_and_revoke_role() { .query_wasm_smart::>( cw_rate_limit_contract.addr(), &QueryMsg::GetRoles { - owner: "foobar".to_string() + owner: MockApi::default().addr_make("foobar").to_string() } ) .is_err()); @@ -709,10 +709,10 @@ fn test_execute_edit_path_quota() { let cosmos_msg = cw_rate_limit_contract.call(management_msg).unwrap(); // non gov cant invoke assert!(app - .execute(Addr::unchecked("foobar"), cosmos_msg.clone()) + .execute(MockApi::default().addr_make("foobar"), cosmos_msg.clone()) .is_err()); // gov addr can invoke - app.execute(Addr::unchecked(GOV_ADDR), cosmos_msg.clone()) + app.execute(MockApi::default().addr_make(GOV_ADDR), cosmos_msg.clone()) .unwrap(); let response = app @@ -750,40 +750,40 @@ fn test_execute_remove_message() { }]); let management_msg = ExecuteMsg::GrantRole { - signer: "foobar".to_string(), + signer: MockApi::default().addr_make("foobar").to_string(), roles: vec![Roles::GrantRole], }; let cosmos_msg = cw_rate_limit_contract.call(management_msg).unwrap(); // non gov cant invoke assert!(app - .execute(Addr::unchecked("foobar"), cosmos_msg.clone()) + .execute(MockApi::default().addr_make("foobar"), cosmos_msg.clone()) .is_err()); // gov addr can invoke - app.execute(Addr::unchecked(GOV_ADDR), cosmos_msg.clone()) + app.execute(MockApi::default().addr_make(GOV_ADDR), cosmos_msg.clone()) .unwrap(); // set a timelock delay for foobar let management_msg = ExecuteMsg::SetTimelockDelay { - signer: "foobar".to_string(), + signer: MockApi::default().addr_make("foobar").to_string(), hours: 1, }; let cosmos_msg = cw_rate_limit_contract.call(management_msg).unwrap(); // non gov cant invoke as insufficient permissions assert!(app - .execute(Addr::unchecked("foobar"), cosmos_msg.clone()) + .execute(MockApi::default().addr_make("foobar"), cosmos_msg.clone()) .is_err()); // gov addr can invoke - app.execute(Addr::unchecked(GOV_ADDR), cosmos_msg.clone()) + app.execute(MockApi::default().addr_make(GOV_ADDR), cosmos_msg.clone()) .unwrap(); // message submitter by foobar should not be queued let management_msg = ExecuteMsg::GrantRole { - signer: "foobarbaz".to_string(), + signer: MockApi::default().addr_make("foobarbaz").to_string(), roles: vec![Roles::GrantRole], }; let cosmos_msg = cw_rate_limit_contract.call(management_msg).unwrap(); - app.execute(Addr::unchecked("foobar"), cosmos_msg.clone()) + app.execute(MockApi::default().addr_make("foobar"), cosmos_msg.clone()) .unwrap(); let response = app .wrap() @@ -796,7 +796,7 @@ fn test_execute_remove_message() { message_id: response[0].clone(), }; let cosmos_msg = cw_rate_limit_contract.call(management_msg).unwrap(); - app.execute(Addr::unchecked(GOV_ADDR), cosmos_msg.clone()) + app.execute(MockApi::default().addr_make(GOV_ADDR), cosmos_msg.clone()) .unwrap(); // no messges should be present @@ -828,42 +828,42 @@ fn test_execute_process_messages() { // allocate GrantRole and RevokeRole to `foobar` let management_msg = ExecuteMsg::GrantRole { - signer: "foobar".to_string(), + signer: MockApi::default().addr_make("foobar").to_string(), roles: vec![Roles::GrantRole, Roles::RevokeRole], }; let cosmos_msg = cw_rate_limit_contract.call(management_msg).unwrap(); // non gov cant invoke assert!(app - .execute(Addr::unchecked("foobar"), cosmos_msg.clone()) + .execute(MockApi::default().addr_make("foobar"), cosmos_msg.clone()) .is_err()); // gov addr can invoke - app.execute(Addr::unchecked(GOV_ADDR), cosmos_msg.clone()) + app.execute(MockApi::default().addr_make(GOV_ADDR), cosmos_msg.clone()) .unwrap(); // set a timelock delay for foobar let management_msg = ExecuteMsg::SetTimelockDelay { - signer: "foobar".to_string(), + signer: MockApi::default().addr_make("foobar").to_string(), hours: 1, }; let cosmos_msg = cw_rate_limit_contract.call(management_msg).unwrap(); // non gov cant invoke as insufficient permissions assert!(app - .execute(Addr::unchecked("foobar"), cosmos_msg.clone()) + .execute(MockApi::default().addr_make("foobar"), cosmos_msg.clone()) .is_err()); // gov addr can invoke - app.execute(Addr::unchecked(GOV_ADDR), cosmos_msg.clone()) + app.execute(MockApi::default().addr_make(GOV_ADDR), cosmos_msg.clone()) .unwrap(); // message submitted by foobar should be queued // allocate GrantRole to foobarbaz let management_msg = ExecuteMsg::GrantRole { - signer: "foobarbaz".to_string(), + signer: MockApi::default().addr_make("foobarbaz").to_string(), roles: vec![Roles::GrantRole], }; let cosmos_msg = cw_rate_limit_contract.call(management_msg).unwrap(); - app.execute(Addr::unchecked("foobar"), cosmos_msg.clone()) + app.execute(MockApi::default().addr_make("foobar"), cosmos_msg.clone()) .unwrap(); let response = app .wrap() @@ -925,7 +925,7 @@ fn test_execute_process_messages() { .query_wasm_smart::>( cw_rate_limit_contract.addr(), &QueryMsg::GetRoles { - owner: "foobarbaz".to_string(), + owner: MockApi::default().addr_make("foobarbaz").to_string(), }, ) .unwrap(); @@ -938,11 +938,11 @@ fn test_execute_process_messages() { }); let management_msg = ExecuteMsg::RevokeRole { - signer: "foobarbaz".to_string(), + signer: MockApi::default().addr_make("foobarbaz").to_string(), roles: vec![Roles::GrantRole], }; let cosmos_msg = cw_rate_limit_contract.call(management_msg).unwrap(); - app.execute(Addr::unchecked("foobar"), cosmos_msg.clone()) + app.execute(MockApi::default().addr_make("foobar"), cosmos_msg.clone()) .unwrap(); let message_ids = app @@ -960,7 +960,7 @@ fn test_execute_process_messages() { message_ids: None, }; let cosmos_msg = cw_rate_limit_contract.call(management_msg).unwrap(); - app.execute(Addr::unchecked("foobar"), cosmos_msg.clone()) + app.execute(MockApi::default().addr_make("foobar"), cosmos_msg.clone()) .unwrap(); // insufficient time has passed so queue length is still 1 @@ -969,7 +969,7 @@ fn test_execute_process_messages() { .query_wasm_smart::>( cw_rate_limit_contract.addr(), &QueryMsg::GetRoles { - owner: "foobarbaz".to_string(), + owner: MockApi::default().addr_make("foobarbaz").to_string(), }, ) .unwrap(); @@ -986,7 +986,7 @@ fn test_execute_process_messages() { message_ids: Some(message_ids.clone()), }; let cosmos_msg = cw_rate_limit_contract.call(management_msg).unwrap(); - app.execute(Addr::unchecked("foobar"), cosmos_msg.clone()) + app.execute(MockApi::default().addr_make("foobar"), cosmos_msg.clone()) .unwrap(); // sufficient time has passed, empty queue @@ -1002,7 +1002,7 @@ fn test_execute_process_messages() { .query_wasm_smart::>( cw_rate_limit_contract.addr(), &QueryMsg::GetRoles { - owner: "foobarbaz".to_string() + owner: MockApi::default().addr_make("foobarbaz").to_string() } ) .is_err()); @@ -1014,6 +1014,6 @@ fn test_execute_process_messages() { }; let cosmos_msg = cw_rate_limit_contract.call(management_msg).unwrap(); assert!(app - .execute(Addr::unchecked("foobar"), cosmos_msg.clone()) + .execute(MockApi::default().addr_make("foobar"), cosmos_msg.clone()) .is_err()); } diff --git a/x/ibc-rate-limit/contracts/rate-limiter/src/message_queue.rs b/x/ibc-rate-limit/contracts/rate-limiter/src/message_queue.rs index 998ea75da..93619a418 100644 --- a/x/ibc-rate-limit/contracts/rate-limiter/src/message_queue.rs +++ b/x/ibc-rate-limit/contracts/rate-limiter/src/message_queue.rs @@ -147,7 +147,7 @@ fn try_process_message( mod tests { use cosmwasm_std::{ from_binary, - testing::{mock_dependencies, mock_env}, + testing::{mock_dependencies, mock_env, MockApi}, Addr, Timestamp, TransactionInfo, }; @@ -160,16 +160,16 @@ mod tests { let mut deps = mock_dependencies(); let mut deps = deps.as_mut(); let foobar_info = MessageInfo { - sender: Addr::unchecked("foobar"), + sender: MockApi::default().addr_make("foobar"), funds: vec![], }; let foobarbaz_info = MessageInfo { - sender: Addr::unchecked("foobarbaz"), + sender: MockApi::default().addr_make("foobarbaz"), funds: vec![], }; TIMELOCK_DELAY - .save(deps.storage, "foobar".to_string(), &1) + .save(deps.storage, MockApi::default().addr_make("foobar").to_string(), &1) .unwrap(); assert!(must_queue_message(&mut deps, &foobar_info)); @@ -183,11 +183,11 @@ mod tests { let mut deps = deps.as_mut(); let foobar_info = MessageInfo { - sender: Addr::unchecked("foobar"), + sender: MockApi::default().addr_make("foobar"), funds: vec![], }; let foobarbaz_info = MessageInfo { - sender: Addr::unchecked("foobarbaz"), + sender: MockApi::default().addr_make("foobarbaz"), funds: vec![], }; let foobar_test_msg = ExecuteMsg::AddPath { @@ -203,8 +203,8 @@ mod tests { signer: "gov".to_string(), hours: 5, }; - set_timelock_delay(&mut deps, "foobar".to_string(), 10).unwrap(); - set_timelock_delay(&mut deps, "foobarbaz".to_string(), 1).unwrap(); + set_timelock_delay(&mut deps, MockApi::default().addr_make("foobar").to_string(), 10).unwrap(); + set_timelock_delay(&mut deps, MockApi::default().addr_make("foobarbaz").to_string(), 1).unwrap(); let foobar_message_id = { let mut env = env.clone(); env.transaction = Some(TransactionInfo { index: 1 }); @@ -320,7 +320,7 @@ mod tests { // signer should have a timelock delay of 1 hour assert_eq!( TIMELOCK_DELAY - .load(deps.storage, "signer".to_string()) + .load(deps.storage, MockApi::default().addr_make("signer").to_string()) .unwrap(), 1 ); @@ -336,7 +336,7 @@ mod tests { //signer should have a timelock delay of 3 hours assert_eq!( TIMELOCK_DELAY - .load(deps.storage, "signer".to_string()) + .load(deps.storage, MockApi::default().addr_make("signer").to_string()) .unwrap(), 3 ); @@ -352,7 +352,7 @@ mod tests { // signer should have a delay of 10 hours assert_eq!( TIMELOCK_DELAY - .load(deps.storage, "signer".to_string()) + .load(deps.storage, MockApi::default().addr_make("signer").to_string()) .unwrap(), 10 ); @@ -372,7 +372,7 @@ mod tests { // signer should have a delay of 1 hours assert_eq!( TIMELOCK_DELAY - .load(deps.storage, "signer".to_string()) + .load(deps.storage, MockApi::default().addr_make("signer").to_string()) .unwrap(), 1 ); @@ -399,7 +399,7 @@ mod tests { deps.storage, &QueuedMessage { message: ExecuteMsg::SetTimelockDelay { - signer: "signer".to_string(), + signer: MockApi::default().addr_make("signer").to_string(), hours: i as u64 + 1, }, submitted_at: ts(i as u64), diff --git a/x/ibc-rate-limit/contracts/rate-limiter/src/packet.rs b/x/ibc-rate-limit/contracts/rate-limiter/src/packet.rs index ad628131e..abe17a1ee 100644 --- a/x/ibc-rate-limit/contracts/rate-limiter/src/packet.rs +++ b/x/ibc-rate-limit/contracts/rate-limiter/src/packet.rs @@ -1,6 +1,5 @@ use crate::state::flow::FlowType; -use cosmwasm_std::{Addr, Deps, StdError, Uint256}; -use osmosis_std_derive::CosmwasmExt; +use cosmwasm_std::{to_base64, Addr, Binary, Deps, GrpcQuery, StdError, Uint256}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use sha2::{Digest, Sha256}; @@ -37,7 +36,6 @@ pub struct Packet { } // SupplyOf query message definition. -// osmosis-std doesn't currently support the SupplyOf query, so I'm defining it localy so it can be used to obtain the channel value #[derive( Clone, PartialEq, @@ -46,12 +44,6 @@ pub struct Packet { serde::Serialize, serde::Deserialize, schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmos.bank.v1beta1.QuerySupplyOfRequest")] -#[proto_query( - path = "/cosmos.bank.v1beta1.Query/SupplyOf", - response_type = QuerySupplyOfResponse )] pub struct QuerySupplyOfRequest { #[prost(string, tag = "1")] @@ -66,12 +58,10 @@ pub struct QuerySupplyOfRequest { serde::Serialize, serde::Deserialize, schemars::JsonSchema, - CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.bank.v1beta1.QuerySupplyOf")] pub struct QuerySupplyOfResponse { #[prost(message, optional, tag = "1")] - pub amount: ::core::option::Option, + pub amount: ::core::option::Option, } // End of SupplyOf query message definition @@ -113,11 +103,7 @@ impl Packet { } pub fn channel_value(&self, deps: Deps, direction: &FlowType) -> Result { - let res = QuerySupplyOfRequest { - denom: self.local_denom(direction), - } - .query(&deps.querier)?; - Uint256::from_str(&res.amount.unwrap_or_default().amount) + Ok(Uint256::from_uint128(deps.querier.query_supply(self.local_denom(direction))?.amount)) } pub fn get_funds(&self) -> Uint256 { diff --git a/x/ibc-rate-limit/contracts/rate-limiter/src/rbac.rs b/x/ibc-rate-limit/contracts/rate-limiter/src/rbac.rs index b85675b4d..ce571f6ac 100644 --- a/x/ibc-rate-limit/contracts/rate-limiter/src/rbac.rs +++ b/x/ibc-rate-limit/contracts/rate-limiter/src/rbac.rs @@ -90,7 +90,7 @@ mod test { use std::collections::BTreeSet; use crate::{msg::QuotaMsg, state::rbac::Roles}; - use cosmwasm_std::{testing::mock_dependencies, Addr}; + use cosmwasm_std::{testing::{mock_dependencies, MockApi}, Addr}; use itertools::Itertools; use super::*; @@ -98,12 +98,12 @@ mod test { fn test_set_timelock_delay() { let mut deps = mock_dependencies(); assert!(TIMELOCK_DELAY - .load(&deps.storage, "foobar".to_string()) + .load(&deps.storage, MockApi::default().addr_make("foobar").to_string()) .is_err()); - set_timelock_delay(&mut deps.as_mut(), "foobar".to_string(), 6).unwrap(); + set_timelock_delay(&mut deps.as_mut(), MockApi::default().addr_make("foobar").to_string(), 6).unwrap(); assert_eq!( TIMELOCK_DELAY - .load(&deps.storage, "foobar".to_string()) + .load(&deps.storage, MockApi::default().addr_make("foobar").to_string()) .unwrap(), 6 ); @@ -383,7 +383,7 @@ mod test { // no roles, should fail assert!(RBAC_PERMISSIONS - .load(deps.storage, "signer".to_string()) + .load(deps.storage, MockApi::default().addr_make("signer").to_string()) .is_err()); let mut granted_roles = BTreeSet::new(); @@ -391,13 +391,13 @@ mod test { for roles in &all_roles { let roles = roles.collect::>(); - grant_role(&mut deps, "signer".to_string(), roles.clone()).unwrap(); + grant_role(&mut deps, MockApi::default().addr_make("signer").to_string(), roles.clone()).unwrap(); roles.iter().for_each(|role| { granted_roles.insert(*role); }); let assigned_roles = RBAC_PERMISSIONS - .load(deps.storage, "signer".to_string()) + .load(deps.storage, MockApi::default().addr_make("signer").to_string()) .unwrap(); assert_eq!(granted_roles, assigned_roles); @@ -412,14 +412,14 @@ mod test { let all_roles = Roles::all_roles(); // no roles, should fail assert!(RBAC_PERMISSIONS - .load(deps.storage, "signer".to_string()) + .load(deps.storage, MockApi::default().addr_make("signer").to_string()) .is_err()); // grant all roles RBAC_PERMISSIONS .save( deps.storage, - "signer".to_string(), + MockApi::default().addr_make("signer").to_string(), &all_roles.iter().copied().collect::>(), ) .unwrap(); @@ -429,7 +429,7 @@ mod test { for roles in &all_roles.iter().chunks(2) { let roles = roles.copied().collect::>(); - revoke_role(&mut deps, "signer".to_string(), roles.clone()).unwrap(); + revoke_role(&mut deps, MockApi::default().addr_make("signer").to_string(), roles.clone()).unwrap(); roles.iter().for_each(|role| { granted_roles.remove(role); @@ -438,11 +438,11 @@ mod test { if granted_roles.is_empty() { // no roles, should fail assert!(RBAC_PERMISSIONS - .load(deps.storage, "signer".to_string()) + .load(deps.storage, MockApi::default().addr_make("signer").to_string()) .is_err()); } else { let assigned_roles = RBAC_PERMISSIONS - .load(deps.storage, "signer".to_string()) + .load(deps.storage, MockApi::default().addr_make("signer").to_string()) .unwrap(); assert_eq!(assigned_roles, granted_roles); diff --git a/x/ibc-rate-limit/contracts/rate-limiter/src/state/flow.rs b/x/ibc-rate-limit/contracts/rate-limiter/src/state/flow.rs index db55515f3..a230ae2ca 100644 --- a/x/ibc-rate-limit/contracts/rate-limiter/src/state/flow.rs +++ b/x/ibc-rate-limit/contracts/rate-limiter/src/state/flow.rs @@ -13,8 +13,8 @@ pub enum FlowType { /// A Flow represents the transfer of value for a denom through an IBC channel /// during a time window. /// -/// It tracks inflows (transfers into osmosis) and outflows (transfers out of -/// osmosis). +/// It tracks inflows (transfers into neturon) and outflows (transfers out of +/// neturon). /// /// The period_end represents the last point in time for which this Flow is /// tracking the value transfer. diff --git a/x/ibc-rate-limit/contracts/rate-limiter/src/state/storage.rs b/x/ibc-rate-limit/contracts/rate-limiter/src/state/storage.rs index 6e230d3a9..e8cb0a7af 100644 --- a/x/ibc-rate-limit/contracts/rate-limiter/src/state/storage.rs +++ b/x/ibc-rate-limit/contracts/rate-limiter/src/state/storage.rs @@ -26,7 +26,7 @@ pub const IBCMODULE: Item = Item::new("ibc_module"); /// allowing to flow through that channel in a specific duration (quota) /// /// For simplicity, the channel in the map keys refers to the "host" channel on -/// the osmosis side. This means that on PacketSend it will refer to the source +/// the neutron side. This means that on PacketSend it will refer to the source /// channel while on PacketRecv it refers to the destination channel. /// /// It is the responsibility of the go module to pass the appropriate channel