diff --git a/.cargo/config b/.cargo/config.toml similarity index 100% rename from .cargo/config rename to .cargo/config.toml diff --git a/Cargo.lock b/Cargo.lock index eca201b69..d22537639 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -35,7 +35,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.5", + "getrandom 0.2.8", "once_cell", "version_check", ] @@ -73,6 +73,47 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +[[package]] +name = "async-channel" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-io" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c374dda1ed3e7d8f0d9ba58715f924862c63eae6849c92d3a18e7fbde9e2794" +dependencies = [ + "async-lock", + "autocfg", + "concurrent-queue", + "futures-lite", + "libc", + "log", + "parking", + "polling", + "slab", + "socket2", + "waker-fn", + "windows-sys 0.42.0", +] + +[[package]] +name = "async-lock" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8101efe8695a6c17e02911402145357e718ac92d3ff88ae8419e84b1707b685" +dependencies = [ + "event-listener", + "futures-lite", +] + [[package]] name = "async-mutex" version = "1.4.0" @@ -82,6 +123,30 @@ dependencies = [ "event-listener", ] +[[package]] +name = "async-process" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6381ead98388605d0d9ff86371043b5aa922a3905824244de40dc263a14fcba4" +dependencies = [ + "async-io", + "async-lock", + "autocfg", + "blocking", + "cfg-if 1.0.0", + "event-listener", + "futures-lite", + "libc", + "signal-hook", + "windows-sys 0.42.0", +] + +[[package]] +name = "async-task" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" + [[package]] name = "async-trait" version = "0.1.42" @@ -93,6 +158,12 @@ dependencies = [ "syn", ] +[[package]] +name = "atomic-waker" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" + [[package]] name = "autocfg" version = "1.1.0" @@ -109,7 +180,7 @@ dependencies = [ "cc", "cfg-if 1.0.0", "libc", - "miniz_oxide", + "miniz_oxide 0.4.4", "object 0.27.1", "rustc-demangle", ] @@ -126,6 +197,23 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "binary-install" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5bc5f8c50dd6a80d0b303ddab79f42ddcb52fd43d68107ecf622c551fd4cd4" +dependencies = [ + "curl", + "dirs 1.0.5", + "failure", + "flate2", + "hex 0.3.2", + "is_executable", + "siphasher", + "tar", + "zip", +] + [[package]] name = "bincode" version = "1.3.3" @@ -183,6 +271,17 @@ dependencies = [ "opaque-debug", ] +[[package]] +name = "blake2b_simd" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "constant_time_eq", +] + [[package]] name = "blake3" version = "0.3.8" @@ -208,12 +307,35 @@ dependencies = [ "generic-array 0.14.5", ] +[[package]] +name = "block-buffer" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +dependencies = [ + "generic-array 0.14.5", +] + [[package]] name = "block-padding" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" +[[package]] +name = "blocking" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c67b173a56acffd6d2326fb7ab938ba0b00a71480e14902b2591c87bc5741e8" +dependencies = [ + "async-channel", + "async-lock", + "async-task", + "atomic-waker", + "fastrand", + "futures-lite", +] + [[package]] name = "borsh" version = "0.8.2" @@ -310,6 +432,12 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +[[package]] +name = "bumpalo" +version = "3.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" + [[package]] name = "byte-slice-cast" version = "1.2.1" @@ -334,6 +462,27 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c58ec36aac5066d5ca17df51b3e70279f5670a72102f5752cb7e7c856adfc70" +[[package]] +name = "bzip2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6afcd980b5f3a45017c57e57a2fcccbb351cc43a356ce117ef760ef8052b89b0" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + [[package]] name = "c2-chacha" version = "0.3.3" @@ -451,6 +600,15 @@ dependencies = [ "bitflags", ] +[[package]] +name = "concurrent-queue" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd7bef69dc86e3c610e4e7aed41035e2a7ed12e72dd7530f61327a6579a4390b" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "constant_time_eq" version = "0.1.5" @@ -463,6 +621,22 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + [[package]] name = "cpufeatures" version = "0.2.1" @@ -674,12 +848,11 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.7" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e5bed1f1c269533fa816a0a5492b3545209a205ca1a54842be180eb63a16a6" +checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" dependencies = [ "cfg-if 1.0.0", - "lazy_static", ] [[package]] @@ -688,6 +861,16 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array 0.14.5", + "typenum", +] + [[package]] name = "crypto-mac" version = "0.8.0" @@ -698,6 +881,36 @@ dependencies = [ "subtle", ] +[[package]] +name = "curl" +version = "0.4.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "509bd11746c7ac09ebd19f0b17782eae80aadee26237658a6b4808afb5c11a22" +dependencies = [ + "curl-sys", + "libc", + "openssl-probe", + "openssl-sys", + "schannel", + "socket2", + "winapi", +] + +[[package]] +name = "curl-sys" +version = "0.4.59+curl-7.86.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cfce34829f448b08f55b7db6d0009e23e2e86a34e8c2b366269bf5799b4a407" +dependencies = [ + "cc", + "libc", + "libz-sys", + "openssl-sys", + "pkg-config", + "vcpkg", + "winapi", +] + [[package]] name = "curve25519-dalek" version = "3.2.1" @@ -812,6 +1025,47 @@ dependencies = [ "generic-array 0.14.5", ] +[[package]] +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "block-buffer 0.10.3", + "crypto-common", +] + +[[package]] +name = "dirs" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901" +dependencies = [ + "libc", + "redox_users 0.3.5", + "winapi", +] + +[[package]] +name = "dirs" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users 0.4.3", + "winapi", +] + [[package]] name = "dynasm" version = "1.2.1" @@ -863,7 +1117,7 @@ dependencies = [ "ed25519", "rand 0.7.3", "serde", - "sha2", + "sha2 0.9.9", "zeroize", ] @@ -882,6 +1136,15 @@ dependencies = [ "heapsize", ] +[[package]] +name = "encoding_rs" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +dependencies = [ + "cfg-if 1.0.0", +] + [[package]] name = "enumset" version = "1.0.6" @@ -957,6 +1220,28 @@ version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" +[[package]] +name = "failure" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" +dependencies = [ + "backtrace", + "failure_derive", +] + +[[package]] +name = "failure_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + [[package]] name = "fallible-iterator" version = "0.2.0" @@ -972,6 +1257,18 @@ dependencies = [ "instant", ] +[[package]] +name = "filetime" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e884668cd0c7480504233e951174ddc3b382f7c2666e3b7310b5c4e7b0c37f9" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall 0.2.11", + "windows-sys 0.42.0", +] + [[package]] name = "fixed-hash" version = "0.7.0" @@ -984,12 +1281,37 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "flate2" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +dependencies = [ + "crc32fast", + "miniz_oxide 0.6.2", +] + [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "form_urlencoded" version = "1.0.1" @@ -1000,6 +1322,16 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "fs_extra" version = "1.2.0" @@ -1060,6 +1392,21 @@ version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" +[[package]] +name = "futures-lite" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + [[package]] name = "futures-macro" version = "0.3.21" @@ -1133,13 +1480,13 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.5" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d39cd93900197114fa1fcb7ae84ca742095eed9442088988ae74fa744e930e77" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if 1.0.0", "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "wasi 0.11.0+wasi-snapshot-preview1", ] [[package]] @@ -1176,6 +1523,25 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" +[[package]] +name = "h2" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "hashbrown" version = "0.9.1" @@ -1212,6 +1578,12 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + [[package]] name = "hermit-abi" version = "0.1.19" @@ -1223,38 +1595,124 @@ dependencies = [ [[package]] name = "hex" -version = "0.4.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" [[package]] -name = "ident_case" -version = "1.0.1" +name = "hex" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] -name = "idna" -version = "0.2.3" +name = "home" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "747309b4b440c06d57b0b25f2aee03ee9b5e5397d288c60e21fc709bb98a7408" dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", + "winapi", ] [[package]] -name = "impl-codec" -version = "0.5.1" +name = "http" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "161ebdfec3c8e3b52bf61c4f3550a1eea4f9579d10dc1b936f3171ebdcd6c443" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ - "parity-scale-codec", + "bytes", + "fnv", + "itoa", ] [[package]] -name = "impl-rlp" +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "hyper" +version = "0.14.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" +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-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "impl-codec" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "161ebdfec3c8e3b52bf61c4f3550a1eea4f9579d10dc1b936f3171ebdcd6c443" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-rlp" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" @@ -1302,11 +1760,26 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "ipnet" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11b0d96e660696543b251e58030cf9787df56da39dab19ad60eae7353040917e" + +[[package]] +name = "is_executable" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "302d553b8abc8187beb7d663e34c065ac4570b273bc9511a50e940e99409c577" +dependencies = [ + "winapi", +] + [[package]] name = "itoa" -version = "1.0.1" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" [[package]] name = "jemalloc-sys" @@ -1338,6 +1811,15 @@ dependencies = [ "libc", ] +[[package]] +name = "js-sys" +version = "0.3.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" +dependencies = [ + "wasm-bindgen", +] + [[package]] name = "keccak" version = "0.1.0" @@ -1375,9 +1857,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.119" +version = "0.2.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4" +checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" [[package]] name = "libloading" @@ -1411,6 +1893,18 @@ dependencies = [ "libc", ] +[[package]] +name = "libz-sys" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "lock_api" version = "0.3.4" @@ -1431,9 +1925,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.14" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ "cfg-if 1.0.0", ] @@ -1523,6 +2017,12 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" + [[package]] name = "minimal-lexical" version = "0.2.1" @@ -1539,12 +2039,61 @@ dependencies = [ "autocfg", ] +[[package]] +name = "miniz_oxide" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.42.0", +] + [[package]] name = "more-asserts" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "near-account-id" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5fbe33ba04b086e082aabe4167f03d8e7f5af2db4fffb5e6061226e46e7f5ff" +dependencies = [ + "borsh 0.9.3", + "serde", +] + [[package]] name = "near-account-id" version = "0.10.0" @@ -1555,6 +2104,35 @@ dependencies = [ "serde", ] +[[package]] +name = "near-account-id" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d924011380de759c3dc6fdbcda37a19a5c061f56dab69d28a34ecee765e23e4" +dependencies = [ + "borsh 0.9.3", + "serde", +] + +[[package]] +name = "near-chain-configs" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1faf676a95bd1718b06e5957e01a9415fedf7900f32d94d5bcf70abd678b10a2" +dependencies = [ + "anyhow", + "chrono", + "derive_more", + "near-crypto 0.15.0", + "near-primitives 0.15.0", + "num-rational", + "serde", + "serde_json", + "sha2 0.10.6", + "smart-default", + "tracing", +] + [[package]] name = "near-contract-standards" version = "4.0.0-pre.7" @@ -1591,6 +2169,33 @@ dependencies = [ "thiserror", ] +[[package]] +name = "near-crypto" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e44231c19aa95e0ff3b1a46209a8edb44f5e02fca8a60a19386ba38b2ee1942" +dependencies = [ + "arrayref", + "blake2", + "borsh 0.9.3", + "bs58", + "c2-chacha", + "curve25519-dalek", + "derive_more", + "ed25519-dalek", + "lazy_static", + "libc", + "near-account-id 0.5.0", + "parity-secp256k1", + "primitive-types 0.10.1", + "rand 0.7.3", + "rand_core 0.5.1", + "serde", + "serde_json", + "subtle", + "thiserror", +] + [[package]] name = "near-crypto" version = "0.10.0" @@ -1607,7 +2212,7 @@ dependencies = [ "ed25519-dalek", "lazy_static", "libc", - "near-account-id", + "near-account-id 0.10.0", "parity-secp256k1", "primitive-types 0.10.1", "rand 0.7.3", @@ -1618,6 +2223,66 @@ dependencies = [ "thiserror", ] +[[package]] +name = "near-crypto" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7754612b47737d277fb818e9fdbb1406e90f9e57151c55c3584d714421976cb6" +dependencies = [ + "arrayref", + "blake2", + "borsh 0.9.3", + "bs58", + "c2-chacha", + "curve25519-dalek", + "derive_more", + "ed25519-dalek", + "near-account-id 0.15.0", + "once_cell", + "primitive-types 0.10.1", + "rand 0.7.3", + "secp256k1", + "serde", + "serde_json", + "subtle", + "thiserror", +] + +[[package]] +name = "near-jsonrpc-client" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1335ffce1476da6516dcd22b26cece1a495fc725c0e8fec1879073752ac068d" +dependencies = [ + "borsh 0.9.3", + "lazy_static", + "log", + "near-chain-configs", + "near-crypto 0.15.0", + "near-jsonrpc-primitives", + "near-primitives 0.15.0", + "reqwest", + "serde", + "serde_json", + "thiserror", + "uuid", +] + +[[package]] +name = "near-jsonrpc-primitives" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ada226c74f05508c516f109a97b9f23335120d0bfda208f0d187b6bbfe6eef5a" +dependencies = [ + "near-chain-configs", + "near-crypto 0.15.0", + "near-primitives 0.15.0", + "near-rpc-error-macro 0.15.0", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "near-metrics" version = "0.1.0" @@ -1654,7 +2319,7 @@ dependencies = [ "chrono", "derive_more", "easy-ext", - "hex", + "hex 0.4.3", "jemallocator", "lazy_static", "near-crypto 0.1.0", @@ -1668,7 +2333,38 @@ dependencies = [ "regex", "serde", "serde_json", - "sha2", + "sha2 0.9.9", + "smart-default", + "validator", +] + +[[package]] +name = "near-primitives" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78f106c7bbf2a12228daf4af2a976122b030745683ede24b5dc4514e8faaa36c" +dependencies = [ + "base64 0.13.0", + "borsh 0.9.3", + "bs58", + "byteorder", + "bytesize", + "chrono", + "derive_more", + "easy-ext", + "hex 0.4.3", + "near-crypto 0.5.0", + "near-primitives-core 0.5.0", + "near-rpc-error-macro 0.5.0", + "near-vm-errors 3.1.0", + "num-rational", + "primitive-types 0.10.1", + "rand 0.7.3", + "reed-solomon-erasure", + "regex", + "serde", + "serde_json", + "sha2 0.9.9", "smart-default", "validator", ] @@ -1687,7 +2383,7 @@ dependencies = [ "chrono", "derive_more", "easy-ext", - "hex", + "hex 0.4.3", "near-crypto 0.10.0", "near-primitives-core 0.10.0", "near-rpc-error-macro 0.10.0", @@ -1699,11 +2395,41 @@ dependencies = [ "regex", "serde", "serde_json", - "sha2", + "sha2 0.9.9", "smart-default", "validator", ] +[[package]] +name = "near-primitives" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97670b302dce15f09bba50f24c67aa08130fd01528cc61d4415892401e88e974" +dependencies = [ + "borsh 0.9.3", + "byteorder", + "bytesize", + "cfg-if 1.0.0", + "chrono", + "derive_more", + "easy-ext", + "hex 0.4.3", + "near-crypto 0.15.0", + "near-primitives-core 0.15.0", + "near-rpc-error-macro 0.15.0", + "near-vm-errors 0.15.0", + "num-rational", + "once_cell", + "primitive-types 0.10.1", + "rand 0.7.3", + "reed-solomon-erasure", + "serde", + "serde_json", + "smart-default", + "strum 0.24.1", + "thiserror", +] + [[package]] name = "near-primitives-core" version = "0.4.0" @@ -1714,12 +2440,31 @@ dependencies = [ "borsh 0.8.2", "bs58", "derive_more", - "hex", + "hex 0.4.3", "lazy_static", "num-rational", "serde", "serde_json", - "sha2", + "sha2 0.9.9", +] + +[[package]] +name = "near-primitives-core" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "108d06655885c1174823e41941fd44a82e13e850b12fa068a95194c96e247c68" +dependencies = [ + "base64 0.11.0", + "borsh 0.9.3", + "bs58", + "derive_more", + "hex 0.4.3", + "lazy_static", + "near-account-id 0.5.0", + "num-rational", + "serde", + "serde_json", + "sha2 0.9.9", ] [[package]] @@ -1732,13 +2477,31 @@ dependencies = [ "borsh 0.9.3", "bs58", "derive_more", - "hex", + "hex 0.4.3", "lazy_static", - "near-account-id", + "near-account-id 0.10.0", "num-rational", "serde", "serde_json", - "sha2", + "sha2 0.9.9", +] + +[[package]] +name = "near-primitives-core" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7929e19d862221949734c4a0063a8f55e7069de3a2ebc2d4f4c13497a5e953cb" +dependencies = [ + "base64 0.13.0", + "borsh 0.9.3", + "bs58", + "derive_more", + "near-account-id 0.15.0", + "num-rational", + "serde", + "serde_repr", + "sha2 0.10.6", + "strum 0.24.1", ] [[package]] @@ -1754,6 +2517,18 @@ dependencies = [ "syn", ] +[[package]] +name = "near-rpc-error-core" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1db59973d0e8d8bd4be5ae508600add29f96737722d30e05cfc49e5044ded955" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "syn", +] + [[package]] name = "near-rpc-error-core" version = "0.10.0" @@ -1766,6 +2541,17 @@ dependencies = [ "syn", ] +[[package]] +name = "near-rpc-error-core" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36addf90cc04bd547a627b3a292f59d7de4dd6fb5042115419ae901b93ce6c2d" +dependencies = [ + "quote", + "serde", + "syn", +] + [[package]] name = "near-rpc-error-macro" version = "0.1.0" @@ -1782,15 +2568,40 @@ dependencies = [ [[package]] name = "near-rpc-error-macro" -version = "0.10.0" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46bde9eb491ab7ccccd48ee6d438dc07aa74318faa0ff007717c3d5b538d3951" +dependencies = [ + "near-rpc-error-core 0.5.0", + "proc-macro2", + "quote", + "serde", + "serde_json", + "syn", +] + +[[package]] +name = "near-rpc-error-macro" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1abade92d0fc76a6c25aeb82f3e7fd97678ab5d0fd92b80149a65d1088e86505" +dependencies = [ + "near-rpc-error-core 0.10.0", + "proc-macro2", + "quote", + "serde", + "serde_json", + "syn", +] + +[[package]] +name = "near-rpc-error-macro" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1abade92d0fc76a6c25aeb82f3e7fd97678ab5d0fd92b80149a65d1088e86505" +checksum = "0b5beb352f3b91d8c491646c2fa4fdbbbf463c7b9c0226951c28f0197de44f99" dependencies = [ - "near-rpc-error-core 0.10.0", - "proc-macro2", - "quote", + "near-rpc-error-core 0.15.0", "serde", - "serde_json", "syn", ] @@ -1803,7 +2614,7 @@ dependencies = [ "borsh 0.8.2", "byteorder", "ethereum-types", - "hex", + "hex 0.4.3", "lazy_static", "log", "near-crypto 0.1.0", @@ -1832,6 +2643,21 @@ dependencies = [ "regex", ] +[[package]] +name = "near-sandbox-utils" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4b2da180a368a12da1949e9940af2457cbce83acb85743b8834b6c9b4111e9f" +dependencies = [ + "anyhow", + "async-process", + "binary-install", + "chrono", + "fs2", + "hex 0.3.2", + "home", +] + [[package]] name = "near-sdk" version = "4.0.0-pre.7" @@ -1899,7 +2725,7 @@ dependencies = [ "rocksdb", "serde", "serde_json", - "strum", + "strum 0.20.0", ] [[package]] @@ -1908,6 +2734,38 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6a7aa3f46fac44416d8a93d14f30a562c4d730a1c6bf14bffafab5f475c244a" +[[package]] +name = "near-units" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97a2b77f295d398589eeee51ad0887905ef1734fb12b45cb6d77bd7e401988b9" +dependencies = [ + "near-units-core", + "near-units-macro", +] + +[[package]] +name = "near-units-core" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89aa2a7985de87a08ca35f28abd8d00f0f901e704257e6e029aadef981386bc6" +dependencies = [ + "num-format", + "regex", +] + +[[package]] +name = "near-units-macro" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ab45d066220846f9bd5c21e9ab88c47c892edd36f962ada78bf8308523171a" +dependencies = [ + "near-units-core", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "near-vm-errors" version = "0.10.0" @@ -1915,12 +2773,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e781248bed1f8e4792aee0c0362cf8bc831fc9f51573bc43807b5e07e0e7db81" dependencies = [ "borsh 0.9.3", - "hex", - "near-account-id", + "hex 0.4.3", + "near-account-id 0.10.0", "near-rpc-error-macro 0.10.0", "serde", ] +[[package]] +name = "near-vm-errors" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5591c9c8afa83a040cb5c3f29bc52b2efae2c32d4bcaee1bba723738da1a5cf6" +dependencies = [ + "borsh 0.9.3", + "near-account-id 0.15.0", + "near-rpc-error-macro 0.15.0", + "serde", + "strum 0.24.1", +] + +[[package]] +name = "near-vm-errors" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffec816703a13b6ca5b3dbd0005e6eb5360087058203c93e859a019dbfd88300" +dependencies = [ + "borsh 0.9.3", + "hex 0.4.3", + "near-account-id 0.5.0", + "near-rpc-error-macro 0.5.0", + "serde", +] + [[package]] name = "near-vm-errors" version = "4.0.0-pre.1" @@ -1928,7 +2812,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e281d8730ed8cb0e3e69fb689acee6b93cdb43824cd69a8ffd7e1bfcbd1177d7" dependencies = [ "borsh 0.8.2", - "hex", + "hex 0.4.3", "near-rpc-error-macro 0.1.0", "serde", ] @@ -1943,14 +2827,14 @@ dependencies = [ "borsh 0.9.3", "bs58", "byteorder", - "near-account-id", + "near-account-id 0.10.0", "near-crypto 0.10.0", "near-primitives 0.10.0", "near-primitives-core 0.10.0", "near-vm-errors 0.10.0", "ripemd160", "serde", - "sha2", + "sha2 0.9.9", "sha3", ] @@ -1968,7 +2852,7 @@ dependencies = [ "near-runtime-utils", "near-vm-errors 4.0.0-pre.1", "serde", - "sha2", + "sha2 0.9.9", "sha3", ] @@ -2031,6 +2915,16 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-format" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +dependencies = [ + "arrayvec 0.7.2", + "itoa", +] + [[package]] name = "num-integer" version = "0.1.44" @@ -2115,6 +3009,51 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +[[package]] +name = "openssl" +version = "0.10.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b102428fd03bc5edf97f62620f7298614c45cedf287c271e7ed450bbaf83f2e1" +dependencies = [ + "bitflags", + "cfg-if 1.0.0", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23bbbf7854cd45b83958ebe919f0e8e516793727652e27fda10a8384cfc790b7" +dependencies = [ + "autocfg", + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "page_size" version = "0.4.2" @@ -2169,6 +3108,12 @@ version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddfc878dac00da22f8f61e7af3157988424567ab01d9920b962ef7dcbd7cd865" +[[package]] +name = "parking" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" + [[package]] name = "parking_lot" version = "0.10.2" @@ -2190,6 +3135,16 @@ dependencies = [ "parking_lot_core 0.8.5", ] +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api 0.4.6", + "parking_lot_core 0.9.5", +] + [[package]] name = "parking_lot_core" version = "0.7.2" @@ -2218,6 +3173,19 @@ dependencies = [ "winapi", ] +[[package]] +name = "parking_lot_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall 0.2.11", + "smallvec", + "windows-sys 0.42.0", +] + [[package]] name = "peeking_take_while" version = "0.1.2" @@ -2230,6 +3198,26 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +[[package]] +name = "pin-project" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "pin-project-lite" version = "0.2.8" @@ -2242,6 +3230,35 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkg-config" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" + +[[package]] +name = "polling" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22122d5ec4f9fe1b3916419b76be1e80bcb93f618d071d2edf841b137b2a2bd6" +dependencies = [ + "autocfg", + "cfg-if 1.0.0", + "libc", + "log", + "wepoll-ffi", + "windows-sys 0.42.0", +] + +[[package]] +name = "portpicker" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be97d76faf1bfab666e1375477b23fde79eccf0276e9b63b92a39d676a889ba9" +dependencies = [ + "rand 0.8.5", +] + [[package]] name = "ppv-lite86" version = "0.2.16" @@ -2317,11 +3334,11 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.36" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" +checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] @@ -2430,7 +3447,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ - "getrandom 0.2.5", + "getrandom 0.2.8", ] [[package]] @@ -2493,6 +3510,28 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_users" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" +dependencies = [ + "getrandom 0.1.16", + "redox_syscall 0.1.57", + "rust-argon2", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom 0.2.8", + "redox_syscall 0.2.11", + "thiserror", +] + [[package]] name = "reed-solomon-erasure" version = "4.0.2" @@ -2562,13 +3601,50 @@ dependencies = [ "winapi", ] +[[package]] +name = "reqwest" +version = "0.11.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" +dependencies = [ + "base64 0.13.0", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + [[package]] name = "ripemd160" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eca4ecc81b7f313189bf73ce724400a07da2a6dac19588b03c8bd76a2dcc251" dependencies = [ - "block-buffer", + "block-buffer 0.9.0", "digest 0.9.0", "opaque-debug", ] @@ -2593,6 +3669,18 @@ dependencies = [ "librocksdb-sys", ] +[[package]] +name = "rust-argon2" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb" +dependencies = [ + "base64 0.13.0", + "blake2b_simd", + "constant_time_eq", + "crossbeam-utils", +] + [[package]] name = "rustc-demangle" version = "0.1.21" @@ -2635,12 +3723,64 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" +[[package]] +name = "schannel" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +dependencies = [ + "lazy_static", + "windows-sys 0.36.1", +] + [[package]] name = "scopeguard" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "secp256k1" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9512ffd81e3a3503ed401f79c33168b9148c75038956039166cd750eaa037c3" +dependencies = [ + "rand 0.8.5", + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" +dependencies = [ + "cc", +] + +[[package]] +name = "security-framework" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "semver" version = "0.9.0" @@ -2664,9 +3804,10 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.118" +version = "1.0.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800" +checksum = "97fed41fc1a24994d044e6db6935e69511a1153b52c15eb42493b26fa87feba0" + dependencies = [ "serde_derive", ] @@ -2692,9 +3833,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.118" +version = "1.0.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c84d3526699cd55261af4b941e4e725444df67aa4f9e6a3564f18030d12672df" +checksum = "255abe9a125a985c05190d687b320c12f9b1f0b99445e608c21ba0782c719ad8" dependencies = [ "proc-macro2", "quote", @@ -2703,9 +3844,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.79" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" +checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" dependencies = [ "indexmap", "itoa", @@ -2713,6 +3854,29 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_repr" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a5ec9fa74a20ebbe5d9ac23dac1fc96ba0ecfe9f50f2843b52e537b10fbcb4e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + [[package]] name = "serde_with" version = "1.6.4" @@ -2741,20 +3905,31 @@ version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ - "block-buffer", + "block-buffer 0.9.0", "cfg-if 1.0.0", "cpufeatures", "digest 0.9.0", "opaque-debug", ] +[[package]] +name = "sha2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.6", +] + [[package]] name = "sha3" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" dependencies = [ - "block-buffer", + "block-buffer 0.9.0", "digest 0.9.0", "keccak", "opaque-debug", @@ -2766,12 +3941,37 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" +[[package]] +name = "signal-hook" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a253b5e89e2698464fc26b545c9edceb338e18a89effeeecfea192c3025be29d" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +dependencies = [ + "libc", +] + [[package]] name = "signature" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f054c6c1a6e95179d6f23ed974060dcefb2d9388bb7256900badad682c499de4" +[[package]] +name = "siphasher" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" + [[package]] name = "slab" version = "0.4.5" @@ -2795,11 +3995,21 @@ dependencies = [ "syn", ] +[[package]] +name = "socket2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "sputnik-staking" version = "1.0.0" dependencies = [ - "hex", + "hex 0.4.3", "near-contract-standards", "near-sdk", "near-sdk-sim", @@ -2818,7 +4028,7 @@ dependencies = [ name = "sputnikdao2" version = "2.3.1" dependencies = [ - "hex", + "hex 0.4.3", "near-contract-standards", "near-sdk", "near-sdk-sim", @@ -2858,7 +4068,16 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7318c509b5ba57f18533982607f24070a55d353e90d4cae30c467cdb2ad5ac5c" dependencies = [ - "strum_macros", + "strum_macros 0.20.1", +] + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros 0.24.3", ] [[package]] @@ -2867,9 +4086,22 @@ version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee8bc6b87a5112aeeab1f4a9f7ab634fe6cbefc4850006df31267f4cfb9e3149" dependencies = [ - "heck", + "heck 0.3.3", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck 0.4.0", "proc-macro2", "quote", + "rustversion", "syn", ] @@ -2881,13 +4113,13 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.57" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4211ce9909eb971f111059df92c45640aad50a619cf55cd76476be803c4c68e6" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] @@ -2908,6 +4140,17 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +[[package]] +name = "tar" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6" +dependencies = [ + "filetime", + "libc", + "xattr", +] + [[package]] name = "target-lexicon" version = "0.10.0" @@ -2944,18 +4187,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.30" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" +checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.30" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" +checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ "proc-macro2", "quote", @@ -2996,6 +4239,72 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +[[package]] +name = "tokio" +version = "1.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46" +dependencies = [ + "autocfg", + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "parking_lot 0.12.1", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.42.0", +] + +[[package]] +name = "tokio-macros" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-retry" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f" +dependencies = [ + "pin-project", + "rand 0.8.5", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + [[package]] name = "toml" version = "0.5.8" @@ -3005,6 +4314,12 @@ dependencies = [ "serde", ] +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + [[package]] name = "tracing" version = "0.1.32" @@ -3037,6 +4352,12 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "try-lock" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" + [[package]] name = "typenum" version = "1.15.0" @@ -3051,7 +4372,7 @@ checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" dependencies = [ "byteorder", "crunchy", - "hex", + "hex 0.4.3", "static_assertions", ] @@ -3061,6 +4382,12 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" +[[package]] +name = "unicode-ident" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" + [[package]] name = "unicode-normalization" version = "0.1.19" @@ -3098,6 +4425,16 @@ dependencies = [ "idna", "matches", "percent-encoding", + "serde", +] + +[[package]] +name = "uuid" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "422ee0de9031b5b948b97a8fc04e3aa35230001a722ddd27943e0be31564ce4c" +dependencies = [ + "getrandom 0.2.8", ] [[package]] @@ -3122,6 +4459,12 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad9680608df133af2c1ddd5eaf1ddce91d60d61b6bc51494ef326458365a470a" +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "version_check" version = "0.9.4" @@ -3134,6 +4477,22 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" @@ -3142,9 +4501,75 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "de9a9cec1733468a8c657e57fa2413d2ae2c0129b95e87c5b72b8ace4d13f31f" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" [[package]] name = "wasmer" @@ -3319,7 +4744,7 @@ dependencies = [ "cc", "digest 0.8.1", "errno", - "hex", + "hex 0.4.3", "indexmap", "lazy_static", "libc", @@ -3602,6 +5027,16 @@ dependencies = [ "wast", ] +[[package]] +name = "web-sys" +version = "0.3.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fed94beee57daf8dd7d51f2b15dc2bcde92d7a72304cdf662a4371008b71b90" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "wee_alloc" version = "0.4.5" @@ -3614,6 +5049,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "wepoll-ffi" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" +dependencies = [ + "cc", +] + [[package]] name = "which" version = "4.2.4" @@ -3647,12 +5091,178 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] + +[[package]] +name = "workspaces" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73b13d249618f197811e3673decc81459730cf5cc09ee7246dc4bede1e9333bc" +dependencies = [ + "async-process", + "async-trait", + "base64 0.13.0", + "borsh 0.9.3", + "bs58", + "chrono", + "dirs 3.0.2", + "hex 0.4.3", + "libc", + "near-account-id 0.15.0", + "near-crypto 0.15.0", + "near-jsonrpc-client", + "near-jsonrpc-primitives", + "near-primitives 0.15.0", + "near-sandbox-utils", + "portpicker", + "rand 0.8.5", + "reqwest", + "serde", + "serde_json", + "thiserror", + "tokio", + "tokio-retry", + "tracing", + "url", +] + +[[package]] +name = "workspaces-rs-tests" +version = "0.1.0" +dependencies = [ + "anyhow", + "near-primitives 0.5.0", + "near-sdk", + "near-units", + "serde_json", + "sputnikdao-factory2", + "sputnikdao2", + "tokio", + "workspaces", +] + [[package]] name = "wyz" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" +[[package]] +name = "xattr" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" +dependencies = [ + "libc", +] + [[package]] name = "zeroize" version = "1.3.0" @@ -3673,3 +5283,17 @@ dependencies = [ "syn", "synstructure", ] + +[[package]] +name = "zip" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93ab48844d61251bb3835145c521d88aa4031d7139e8485990f60ca911fa0815" +dependencies = [ + "byteorder", + "bzip2", + "crc32fast", + "flate2", + "thiserror", + "time", +] diff --git a/Cargo.toml b/Cargo.toml index bb50970fa..7dfed2048 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,8 +4,10 @@ members = [ "sputnik-staking", "sputnikdao2", "sputnikdao-factory2", - "test-token" + "test-token", + "workspaces-rs-tests", ] +resolver = "2" [profile.release] codegen-units = 1 diff --git a/sputnik-staking/Cargo.toml b/sputnik-staking/Cargo.toml index 14d8c9137..a02d4484f 100644 --- a/sputnik-staking/Cargo.toml +++ b/sputnik-staking/Cargo.toml @@ -2,7 +2,7 @@ name = "sputnik-staking" version = "1.0.0" authors = ["Sputnik Devs "] -edition = "2018" +edition = "2021" publish = false [lib] diff --git a/sputnikdao-factory2/Cargo.lock b/sputnikdao-factory2/Cargo.lock index 9abcc43e3..696d4cbf0 100644 --- a/sputnikdao-factory2/Cargo.lock +++ b/sputnikdao-factory2/Cargo.lock @@ -583,4 +583,4 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" \ No newline at end of file diff --git a/sputnikdao-factory2/Cargo.toml b/sputnikdao-factory2/Cargo.toml index a8001aa07..66cd58fa4 100644 --- a/sputnikdao-factory2/Cargo.toml +++ b/sputnikdao-factory2/Cargo.toml @@ -2,7 +2,7 @@ name = "sputnikdao-factory2" version = "0.2.1" authors = ["Illia Polosukhin "] -edition = "2018" +edition = "2021" publish = false [lib] diff --git a/sputnikdao2/Cargo.toml b/sputnikdao2/Cargo.toml index 41a7a4f3b..8f569d804 100644 --- a/sputnikdao2/Cargo.toml +++ b/sputnikdao2/Cargo.toml @@ -2,7 +2,7 @@ name = "sputnikdao2" version = "2.3.1" authors = ["Sputnik Devs "] -edition = "2018" +edition = "2021" publish = false [lib] diff --git a/sputnikdao2/TestPlan.md b/sputnikdao2/TestPlan.md index fce004462..24b423976 100644 --- a/sputnikdao2/TestPlan.md +++ b/sputnikdao2/TestPlan.md @@ -5,50 +5,64 @@ The following is coverage checklists & notes about context tests needed to check # Sputnik Factory ## Init & Default + ### new -- [ ] Can instantiate a new factory with default struct, including DAOs set. -- [ ] Stores the latest compiled version of Sputnik DAO contract in storage -- [ ] Creates metadata for the latest compiled version of Sputnik DAO -- [ ] Does not allow re-init -- [ ] Does not allow anyone but owner to call "new" + +- [x] Can instantiate a new factory with default struct, including DAOs set. +- [x] Stores the latest compiled version of Sputnik DAO contract in storage +- [x] Creates metadata for the latest compiled version of Sputnik DAO +- [x] Does not allow re-init +- [x] Does not allow anyone but owner to call "new" ## DAOs + ### Creation -- [ ] Allows any account to call create method -- [ ] Created DAO becomes a sub-account of the factory. Example for new DAO: "awesome.sputnik.near" -- [ ] Creates a new DAO & instantiates with the correct default Sputnik DAO contract from storage - see metadata + +- [x] Allows any account to call create method +- [x] Created DAO becomes a sub-account of the factory. Example for new DAO: "awesome.sputnik.near" +- [x] Creates a new DAO & instantiates with the correct default Sputnik DAO contract from storage - see metadata - [ ] Returns the payment amount, if the creation failed for any reason - [ ] DAO Balance is equal to payment amount -- [ ] DAO exists in the list of DAOs upon successful creation -- [ ] Fails if the DAO name exists -- [ ] Fails if the DAO name is not a valid account ID +- [x] DAO exists in the list of DAOs upon successful creation +- [x] Fails if the DAO name exists +- [x] Fails if the DAO name is not a valid account ID + ### Upgrades + - [ ] DAO Can update to a specific code_hash version of Sputnik DAO Code - [ ] Fails if DAO is not within the list of supported DAOs - [ ] Fails if DAO tries a code_hash that doesnt exist - [ ] Fails if predecessor is not the DAO getting upgraded (DAO proposal must trigger upgrade) ## Ownership + ### Changing Owner -- [ ] Can get current owner -- [ ] Fails if trying to set owner from non-owner account -- [ ] Owner can be a DAO account -- [ ] Owner gets successfully updated + +- [x] Can get current owner +- [x] Fails if trying to set owner from non-owner account +- [x] Owner can be a DAO account +- [x] Owner gets successfully updated + ### Adding Code Version + - [ ] Can store code as blob in factory - [ ] Can set a default code_hash - [ ] Fails if not owner of factory - [ ] Fails if no code is attached when storing a code blob - [ ] Fails if code blob is too small to be a legit contract - [ ] Fails if attached payment doesnt support the storage cost + ### Adding Code Metadata + - [ ] Can add metadata for an existing set of Sputnik DAO Code (code_hash is available only upon storage of contract inside factory) - [ ] Can set the code_hash as default - [ ] Metadata version and other params meet types & spec standards - [ ] Fails to add code metadata if code_hash doesn't exist - [ ] Can remove code metadata if called by owner - [ ] Fails to remove code metadata if metadata by code_hash doesn't exist + ### Removing Code Version + - [ ] Can delete a code blob by code_hash - [ ] Can delete any/all associated code metadata for the same code_hash - [ ] Confirm storage is empty after deletion success @@ -56,47 +70,66 @@ The following is coverage checklists & notes about context tests needed to check - [ ] Fails if no code blob exists ## views + ### get_dao_list -- [ ] Returns empty array for new factory + +- [x] Returns empty array for new factory - [ ] Returns full list of DAOs - [ ] NOTE: This method will fail when list gets too long for gas to return on RPC + ### get_number_daos + - [ ] Returns an integer representing the total amount of DAOs known to factory + ### get_daos + - [ ] (Needs Impl) Returns default list of DAOs with a max length of 100 & offset of 0. - [ ] Returns a list of DAOs matching the specified `from_index` and `limit`. - [ ] Capable of returning non-zero indexed list, so pagination can be verified + ### get_owner -- [ ] Returns a string representing the account that owns the factory -- [ ] Fails if storage is corrupted or no owner + +- [x] Returns a string representing the account that owns the factory +- [x] Fails if storage is corrupted or no owner + ### get_default_code_hash + - [ ] Returns the default code_hash for a new DAO - [ ] Returns the default code_hash that has been updated after new code blob in factory + ### get_default_version + - [ ] Returns the default metadata version for a new DAO, this will be a simplified semver. Example: [2,0] for V 2.0 + ### get_code + - [ ] Returns an entire code blob based on given code_hash - [ ] Returns no value if code_hash doesn't exist + ### get_contracts_metadata + - [ ] Returns the supported list of all factory code_hash + metadata, indicating the supported versions available for DAOs to upgrade # Sputnik DAO ## Dao Policy Configurations + These tests are purely for checking support of certain policy configurations, no simulations. -You can check a DAO's policy by doing: +You can check a DAO's policy by doing: ```bash near view DAO_NAME.sputnik-dao.near get_policy ``` ### Default + **Goal:** Confirm the default policy acts as it should. **TESTS:** -- [ ] TODO: + +- [ ] TODO: **Default Config:** @@ -106,17 +139,13 @@ Confirm the default policy acts as it should. { "name": "all", "kind": "Everyone", - "permissions": [ - "*:AddProposal" - ], + "permissions": ["*:AddProposal"], "vote_policy": {} }, { "name": "council", "kind": { - "Group": [ - "user_1.testnet" - ] + "Group": ["user_1.testnet"] }, "permissions": [ "*:Finalize", @@ -131,7 +160,7 @@ Confirm the default policy acts as it should. "default_vote_policy": { "weight_kind": "RoleWeight", "quorum": "0", - "threshold": [ 1, 2 ] + "threshold": [1, 2] }, "proposal_bond": "1000000000000000000000000", "proposal_period": "604800000000000", @@ -141,11 +170,13 @@ Confirm the default policy acts as it should. ``` ### Threshold + **Goal:** -Each +Each **TESTS:** -- [ ] TODO: + +- [ ] TODO: **Threshold Config:** @@ -155,9 +186,7 @@ Each { "name": "all", "kind": "Everyone", - "permissions": [ - "*:AddProposal" - ], + "permissions": ["*:AddProposal"], "vote_policy": {} }, { @@ -179,10 +208,10 @@ Each "*:VoteRemove" ], "vote_policy": { - "Group":{ + "Group": { "weight_kind": "RoleWeight", "quorum": "0", - "threshold": [ 1, 5 ] + "threshold": [1, 5] } } } @@ -190,7 +219,7 @@ Each "default_vote_policy": { "weight_kind": "RoleWeight", "quorum": "0", - "threshold": [ 1, 2 ] + "threshold": [1, 2] }, "proposal_bond": "1000000000000000000000000", "proposal_period": "604800000000000", @@ -200,11 +229,13 @@ Each ``` ### Role Weighted + **Goal:** -Each +Each **TESTS:** -- [ ] TODO: + +- [ ] TODO: **Threshold Config:** @@ -214,9 +245,7 @@ Each { "name": "all", "kind": "Everyone", - "permissions": [ - "*:AddProposal" - ], + "permissions": ["*:AddProposal"], "vote_policy": {} }, { @@ -238,10 +267,10 @@ Each "*:VoteRemove" ], "vote_policy": { - "Group":{ + "Group": { "weight_kind": "RoleWeight", "quorum": "0", - "threshold": [ 1, 5 ] + "threshold": [1, 5] } } } @@ -249,7 +278,7 @@ Each "default_vote_policy": { "weight_kind": "RoleWeight", "quorum": "0", - "threshold": [ 1, 2 ] + "threshold": [1, 2] }, "proposal_bond": "1000000000000000000000000", "proposal_period": "604800000000000", @@ -259,11 +288,13 @@ Each ``` ### Token Weighted + **Goal:** -Each +Each **TESTS:** -- [ ] TODO: + +- [ ] TODO: **Threshold Config:** @@ -273,9 +304,7 @@ Each { "name": "all", "kind": "Everyone", - "permissions": [ - "*:AddProposal" - ], + "permissions": ["*:AddProposal"], "vote_policy": {} }, { @@ -297,10 +326,10 @@ Each "*:VoteRemove" ], "vote_policy": { - "Group":{ + "Group": { "weight_kind": "RoleWeight", "quorum": "0", - "threshold": [ 1, 5 ] + "threshold": [1, 5] } } } @@ -308,7 +337,7 @@ Each "default_vote_policy": { "weight_kind": "RoleWeight", "quorum": "0", - "threshold": [ 1, 2 ] + "threshold": [1, 2] }, "proposal_bond": "1000000000000000000000000", "proposal_period": "604800000000000", @@ -318,11 +347,13 @@ Each ``` ### Groups Weighted + **Goal:** -Each +Each **TESTS:** -- [ ] TODO: + +- [ ] TODO: **Threshold Config:** @@ -332,9 +363,7 @@ Each { "name": "all", "kind": "Everyone", - "permissions": [ - "*:AddProposal" - ], + "permissions": ["*:AddProposal"], "vote_policy": {} }, { @@ -356,10 +385,10 @@ Each "*:VoteRemove" ], "vote_policy": { - "Group":{ + "Group": { "weight_kind": "RoleWeight", "quorum": "0", - "threshold": [ 1, 5 ] + "threshold": [1, 5] } } } @@ -367,7 +396,7 @@ Each "default_vote_policy": { "weight_kind": "RoleWeight", "quorum": "0", - "threshold": [ 1, 2 ] + "threshold": [1, 2] }, "proposal_bond": "1000000000000000000000000", "proposal_period": "604800000000000", @@ -377,11 +406,13 @@ Each ``` ### Groups Varying Policy + **Goal:** Each group council can have different threshold criteria for consensus. Confirm that a group can be assessed based on their individual definitions versus the default policy config. **TESTS:** -- [ ] TODO: + +- [ ] TODO: **Varying Policy Config:** @@ -407,21 +438,17 @@ Each group council can have different threshold criteria for consensus. Confirm "*:VoteRemove" ], "vote_policy": { - "Group":{ + "Group": { "weight_kind": "RoleWeight", "quorum": "0", - "threshold": [ 1, 5 ] + "threshold": [1, 5] } } }, { "name": "admins", "kind": { - "Group": [ - "admin_1.testnet", - "admin_2.testnet", - "admin_3.testnet" - ] + "Group": ["admin_1.testnet", "admin_2.testnet", "admin_3.testnet"] }, "permissions": [ "*:Finalize", @@ -431,7 +458,7 @@ Each group council can have different threshold criteria for consensus. Confirm "*:VoteRemove" ], "vote_policy": { - "Group":{ + "Group": { "weight_kind": "RoleWeight", "quorum": "60", "threshold": [] @@ -442,7 +469,7 @@ Each group council can have different threshold criteria for consensus. Confirm "default_vote_policy": { "weight_kind": "RoleWeight", "quorum": "0", - "threshold": [ 1, 2 ] + "threshold": [1, 2] }, "proposal_bond": "1000000000000000000000000", "proposal_period": "604800000000000", @@ -451,11 +478,14 @@ Each group council can have different threshold criteria for consensus. Confirm } ``` - ## Staking Token + ### None + - [ ] Confirming other policies means non token-staking works fine + ### New Staking Contract + - [ ] Can deploy a new staking contract, configured to the right DAO owner, token & stake period - [ ] DAO Can propose and accept the staking contract proposal - [ ] Users can pre-pay storage & register to delegate tokens @@ -466,11 +496,12 @@ Each group council can have different threshold criteria for consensus. Confirm - [ ] Users can undelegate tokens from a delegation - [ ] Users can withdraw any available tokens that aren't delegated in the staking contract - ## bounties ### Happy path + Creates an end-to-end check of happy path completion + - [x] Setup test token - [x] propose a bounty - [x] Vote on the bounty @@ -482,22 +513,30 @@ Creates an end-to-end check of happy path completion - [x] Check bounty proposal approved ### bounty_claim + Claims given bounty by caller with given expected duration to execute. + - [x] The method could panic if the bounty with given id doesn't exist - [x] Should panic if `attached_deposit` is not equal to the corresponding `bounty_bond` - [x] Should panic in case of wrong deadline - [x] Should panic if all bounties are claimed - [x] Should increase number of claims - [x] Should add this claim to the list of claims, done by this account + ### bounty_done + Reports that bounty is done. Creates a proposal to vote for paying out the bounty. + - [x] Should panic if the caller is not in the list of claimers - [x] Should panic if the list of claims for the caller of the method doesn't contain the claim with given ID - [x] Should panic if the bounty claim is completed - [x] If claim is not expired, the `bounty_done` can only be called by the claimer - [x] If not expired, proposal should be added, claim is marked as completed + ### bounty_giveup + Gives up working on the bounty. + - [x] Should panic if the caller is not in the list of claimers - [x] Should panic if the list of claims for the caller of the method doesn't contain the claim with given ID - [x] If within forgiveness period, `bounty_bond` should be returned @@ -506,19 +545,27 @@ Gives up working on the bounty. ## delegation ### register_delegation + Inserts a caller to the `delegations` LookupMap with zero balance. + - [x] Check that delegation appears in `delegations` LookupMap. - [x] Can only be called by the `staking_id` - [x] Attached deposit is handled correctly + ### delegate + Adds given amount to given account as delegated weight. + - [x] Should panic if `staking_id` is `None` - [x] Check that amount is added correctly - [x] Check that a user can't delegate more than it has - [x] Check that it can only be called by the `staking_id` - [x] Can't be called without previos registration + ### undelegate + Removes given amount from given account's delegations. + - [x] Should panic if `staking_id` is `None` - [x] Check that it can only be called by the `staking_id` - [x] Check that amount is subtracted correctly @@ -530,13 +577,18 @@ Removes given amount from given account's delegations. _NOTE: This covers v2 functionality for upgrades only_ ### store_blob + Stores attached data into blob store and returns the hash of it. + - [x] Should panic if contract is not initialized - [x] Should panic if the blob already exists - [x] Should panic if the amount of the attached deposit is not enough - [x] Should save the blob to the LookupMap + ### remove_blob + Removes blob from contract storage and pays back to the original storer. + - [x] Should panic if `hash` is wrong - [x] Should return hash of stored data - [x] Can only be called by the original storer @@ -547,74 +599,121 @@ Removes blob from contract storage and pays back to the original storer. _TODO: Policy is missing a lot of coverage:_ - ### TokenWeight + Happy path for token-weighted policy + - [x] Can create new DAO - [x] Can set staking contract - [x] Can change policy to TokenWeight - [x] Can register & delegate tokens - [x] Can use TokenWeight policy to vote & approve a proposal + ### TokenWeight Self-Lock + - [x] Can create new DAO, with TokenWeight set without staking contract id - [x] Attempt a proposal, fail to move status because voting is locked ## proposals ### add_proposal + Adds proposal to this DAO. -- [x] Check that the method fails in case of insufficient deposit + +- [x] Check that the method fails in case of insufficient deposit - [x] Check that different kinds of `proposal` are validated correctly - [x] Check that only those with a permission can add the proposal - [x] Check that the proposal is added to the list of proposals + ### act_proposal + Act on given proposal by id, if permissions allow. + - [??] Check that only those with a permission can act on the the proposal - [x] Check that the method works correctly on any possible `action` - [x] If the number of votes in the group has changed (new members has been added) the proposal can lose it's approved state. In this case new proposal needs to be made, this one should expire + ### on_proposal_callback + Receiving callback after the proposal has been finalized. + - [??] If successful, should return bond money to the proposal originator - [??] If the proposal execution failed (funds didn't transfer or function call failure), should move the proposal to the "Failed" state _NOTE: Appears views are currently just helper methods and dont have test coverage_ ## views + ### version + - [ ] Returns the version of this contract. + ### get_config + - [ ] Returns the config of this contract. + ### get_policy + - [ ] Returns policy of this contract. + ### get_staking_contract + - [ ] Returns the staking contract if available. Otherwise returns `None`. + ### has_blob + - [ ] Returns whether the blob with given hash is stored. + ### get_locked_storage_amount + - [ ] Returns the locked amount of NEAR that is used for the storage. + ### get_available_amount + - [ ] Returns the available amount of NEAR that can be spent (outside of the amount for the storage and bonds). + ### delegation_total_supply + - [ ] Returns the total delegated stake. + ### delegation_balance_of + - [ ] Returns the delegated stake of the given account. + ### delegation_balance_ratio + - [ ] Combines the balance and the total amount for calling from external contracts. + ### get_last_proposal_id + - [ ] Returns the last proposal's id. + ### get_proposals + - [ ] Returns a vector of the proposals. + ### get_proposal + - [ ] Returns the specific proposal by id. - [ ] Should panic if the proposal with the given id doesn't exist + ### get_bounty + - [ ] Returns the specific bounty by id. - [ ] Should panic if the bounty with the given id doesn't exist + ### get_last_bounty_id + - [ ] Returns number of the bounties. + ### get_bounties + - [ ] Returns the bounties. + ### get_bounty_claims + - [ ] Returns bounty claims for given user. + ### get_bounty_number_of_claims + - [ ] Returns the number of claims per given bounty. diff --git a/test-token/Cargo.toml b/test-token/Cargo.toml index 8ffa00e8e..9dd71a5b4 100644 --- a/test-token/Cargo.toml +++ b/test-token/Cargo.toml @@ -2,7 +2,7 @@ name = "test-token" version = "0.1.0" authors = ["Illia Polosukhin "] -edition = "2018" +edition = "2021" publish = false [lib] diff --git a/workspaces-rs-tests/.gitignore b/workspaces-rs-tests/.gitignore new file mode 100644 index 000000000..4fffb2f89 --- /dev/null +++ b/workspaces-rs-tests/.gitignore @@ -0,0 +1,2 @@ +/target +/Cargo.lock diff --git a/workspaces-rs-tests/Cargo.toml b/workspaces-rs-tests/Cargo.toml new file mode 100644 index 000000000..51de8daad --- /dev/null +++ b/workspaces-rs-tests/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "workspaces-rs-tests" +version = "0.1.0" +authors = ["Nemanja Ninkovic "] +edition = "2021" +publish = false + +[lib] +crate-type = ["cdylib", "rlib"] + +[dev-dependencies] +anyhow = "1.0" +near-primitives = "0.5.0" +near-sdk = { version = "4.0.0-pre.4", features = ["unstable"] } +near-units = "0.2.0" +serde_json = "1.0" +tokio = { version = "1.14", features = ["full"] } +near-workspaces = "0.7.0" +near-sdk-sim = "4.0.0-pre.4" +sputnikdao2 = { path = "../sputnikdao2" } +sputnikdao-factory2 = { path = "../sputnikdao-factory2" } diff --git a/workspaces-rs-tests/README.md b/workspaces-rs-tests/README.md new file mode 100644 index 000000000..15860124c --- /dev/null +++ b/workspaces-rs-tests/README.md @@ -0,0 +1,3 @@ +# Sputnik Test Planning + +These tests are aimed at 100% of the latest version, and best coverage of older versions. diff --git a/workspaces-rs-tests/src/lib.rs b/workspaces-rs-tests/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/workspaces-rs-tests/tests/test_sputnikdao_factory.rs b/workspaces-rs-tests/tests/test_sputnikdao_factory.rs new file mode 100644 index 000000000..2db725aa2 --- /dev/null +++ b/workspaces-rs-tests/tests/test_sputnikdao_factory.rs @@ -0,0 +1,265 @@ +use near_sdk::json_types::Base64VecU8; +use near_units::{parse_gas, parse_near}; +use sputnikdao2::{Config, VersionedPolicy}; +use std::str::FromStr; +extern crate near_workspaces as workspaces; + +use workspaces::types::{KeyType, SecretKey}; +use workspaces::AccountId; + + +//----------------------------------------------------------------------------- + +const FACTORY: &str = "../sputnikdao-factory2/res/sputnikdao_factory2.wasm"; + +//----------------------------------------------------------------------------- + +#[tokio::test] +async fn test_factory() -> anyhow::Result<()> { + println!("Testing: SPUTNIK FACTORY\n"); + + // Create a sandbox environment. + let worker = workspaces::sandbox().await?; + let wasm = std::fs::read(FACTORY)?; + + //------------------------------------------------------------------------- + + println!("\nTesting: Can instantiate a new factory with default struct."); + + // Deploy Spunik DAO factory contract in sandbox. + let dao_factory = worker + .create_tla_and_deploy( + AccountId::from_str("sputnik-factory.test.near")?, + SecretKey::from_random(KeyType::ED25519), + &wasm, + ) + .await? + .into_result()?; + assert_eq!( + dao_factory.id().as_str(), + "sputnik-factory.test.near", + "❌ Failed to create an account!" + ); + println!( + "✅ Created an account to hold wasm file: {:?}", + dao_factory.id().as_str() + ); + + //------------------------------------------------------------------------- + + // Init daofactory contract with a wrong owner. + println!("\nTesting: Only factory owner can call \"new\"."); + println!("Initiating a SputnikDAO Factory with a wrong owner."); + let some_user = worker + .create_tla( + AccountId::from_str("some-user.test.near")?, + SecretKey::from_random(KeyType::ED25519), + ) + .await? + .into_result()?; + let factory_wrong_owner = some_user + .call(&dao_factory.id(), "new") + .gas(parse_gas!("42 Tgas") as u64) + .transact() + .await?; + assert!( + factory_wrong_owner.is_failure(), + "❌ Factory initiated succesfully with non owner calling \"new\"!!" + ); + println!("✅ Must be owner Error"); + + //------------------------------------------------------------------------- + + // Init daofactory contract with a correct owner now. + println!("\nTesting: Can instantiate a new factory."); + println!("Initiating a SputnikDAO Factory"); + let factory_init = dao_factory + .call("new") + .gas(parse_gas!("42 Tgas") as u64) + .transact() + .await?; + assert!(factory_init.is_success(), "❌ Factory failed to initiate!"); + println!("✅ Factory successfuly initiatet."); + + //------------------------------------------------------------------------- + + // Checking the factory owner. + println!("\nTesting: get_owner Returns the account that owns the factory"); + let owner: AccountId = dao_factory.view("get_owner").await?.json()?; + assert_eq!(dao_factory.id().as_str(), owner.as_str(), "❌ Error"); + println!("✅ Factory owner: {:?}", owner.as_str()); + + //------------------------------------------------------------------------- + + // Returns empty array for new factory + println!("\nTesting: get_dao_list Returns empty array for new factory"); + let get_dao_list_new_factory: Vec = + dao_factory.view("get_dao_list").await?.json()?; + assert!( + get_dao_list_new_factory.is_empty(), + "❌ New factory returned a non empty DAO list." + ); + println!("✅ DAO list: {:?}", get_dao_list_new_factory); + + //------------------------------------------------------------------------- + + // Re-init daofactory contract. + println!("\nTesting: Does not allow re-init of a factory."); + println!("Trying to re-initiate a SputnikDAO Factory."); + let factory_re_init = dao_factory + .call("new") + .gas(parse_gas!("42 Tgas") as u64) + .transact() + .await?; + assert!( + factory_re_init.is_failure(), + "❌ Factory re-initiated succesfully!!!" + ); + println!("✅ The contract has already been initialized Error"); + + //------------------------------------------------------------------------- + + // Define parameters of new dao: + + // Configure name, purpose, and initial council members of the DAO and + // convert the arguments in base64. + let config = Config { + name: "sputnik-dao".to_string(), + purpose: "Sputnik internal test DAO".to_string(), + metadata: Base64VecU8(vec![]), + }; + let policy = VersionedPolicy::Default(vec![]); + let params = serde_json::json!({ "config": config, "policy": policy, }) + .to_string() + .into_bytes(); + + //------------------------------------------------------------------------- + + // Creating a dao with "some-user" account. + println!("\nTesting: Allows any account to call create method."); + let create_new_dao = some_user + .call(&dao_factory.id(), "create") + .args_json(serde_json::json!({ + "name": "test", + "args":Base64VecU8(params.clone()), + })) + .deposit(parse_near!("6 N")) + .gas(parse_gas!("150 Tgas") as u64) + .transact() + .await?; + assert!( + create_new_dao.is_success(), + "❌ Failed to create a DAO using \"some_user\" as an account." + ); + println!( + "✅ DAO successfully created using {:?} as an account", + some_user.id().as_str() + ); + + //------------------------------------------------------------------------- + + // Creating a dao with factory owner account. + println!("\nTesting: Allows any account to call create method."); + let create_new_dao = dao_factory + .call("create") + .args_json(serde_json::json!({ + "name": "awesome", + "args":Base64VecU8(params.clone()), + })) + .deposit(parse_near!("6 N")) + .gas(parse_gas!("150 Tgas") as u64) + .transact() + .await?; + assert!( + create_new_dao.is_success(), + "❌ Failed to create a DAO using factory owner as an account." + ); + println!( + "✅ DAO successfully created using {:?} as an account", + dao_factory.id().as_str() + ); + + //------------------------------------------------------------------------- + + // Checking for daos to see if dao is in a DAO list. + println!("\nTesting: Created DAO becomes a sub-account of the factory."); + let get_dao_list_dao_in_a_list: Vec = + dao_factory.view("get_dao_list").await?.json()?; + assert_eq!( + get_dao_list_dao_in_a_list.last().unwrap().as_str(), + "awesome.sputnik-factory.test.near", + "❌ Dao not sub-account of the factory" + ); + println!( + "✅ DAO exists in the list: {:?}", + get_dao_list_dao_in_a_list + ); + + //------------------------------------------------------------------------- + + // Creating a dao with same dao name. + println!("\nTesting: Fails if the DAO name exists."); + let create_new_dao_same_name = dao_factory + .call("create") + .args_json(serde_json::json!({ + "name": "awesome", + "args":Base64VecU8(params.clone()), + })) + .deposit(parse_near!("6 N")) + .gas(parse_gas!("150 Tgas") as u64) + .transact() + .await?; + assert!( + create_new_dao_same_name.is_failure(), + "❌ Succesfully created a dao with name that already exists." + ); + println!("✅ AccountAlreadyExists Error"); + + //------------------------------------------------------------------------- + + // Creating a dao with invalid account ID. + println!("\nTesting: Fails if the DAO name is not a valid account ID."); + let create_new_dao_wrong_name = dao_factory + .call("create") + .args_json(serde_json::json!({ + "name": "//", + "args":Base64VecU8(params.clone()), + })) + .deposit(parse_near!("6 N")) + .gas(parse_gas!("150 Tgas") as u64) + .transact() + .await?; + assert!( + create_new_dao_wrong_name.is_failure(), + "❌ Succesfully created a dao with invalid acconut ID." + ); + println!("✅ The account ID is invalid Error"); + + //------------------------------------------------------------------------- + + // println!("Getting default code hash..."); + // let default_code_hash: Base58CryptoHash = + // dao_factory.view("get_default_code_hash").await?.json()?; + // println!( + // "Code Hash: {:?}", + // serde_json::json!(default_code_hash).as_str().unwrap() + // ); + + // //------------------------------------------------------------------------- + + // println!("Getting the factory owner..."); + // let factory_owner: AccountId = dao_factory.view("get_owner").await?.json()?; + // println!("Factory owner: {:?}", factory_owner.as_str()); + + // //------------------------------------------------------------------------- + + // println!("Getting code..."); + // let get_code = dao_factory + // .view("get_code") + // .args_json(serde_json::json!({ "code_hash": default_code_hash, })) + // .await? + // .result; + // println!("Code len: {:?}.", get_code.len()); + + Ok(()) +}