diff --git a/Cargo.lock b/Cargo.lock index 1e754fe5b..65c3cec76 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -57,9 +57,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.11" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "42cd52102d3df161c77a887b608d7a4897d7cc112886a9537b738a887a03aaff" dependencies = [ "cfg-if", "once_cell", @@ -90,9 +90,9 @@ checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "alloy-chains" -version = "0.1.15" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96c81b05c893348760f232c4cc6a6a77fd91cfb09885d4eaad25cd03bd7732e" +checksum = "45625825df98039a6dced71fedca82e69a8a0177453e21faeed47b9a6f16a178" dependencies = [ "num_enum", "serde", @@ -117,7 +117,7 @@ dependencies = [ "proptest", "serde", "serde_json", - "winnow 0.6.5", + "winnow 0.6.0", ] [[package]] @@ -308,7 +308,7 @@ checksum = "1a047897373be4bbb0224c1afdabca92648dc57a9c9ef6e7b0be3aff7a859c83" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -383,7 +383,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", "syn-solidity 0.5.4", "tiny-keccak", ] @@ -403,7 +403,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.52", + "syn 2.0.48", "syn-solidity 0.6.4", "tiny-keccak", ] @@ -423,7 +423,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0045cc89524e1451ccf33e8581355b6027ac7c6e494bb02959d4213ad0d8e91d" dependencies = [ - "winnow 0.6.5", + "winnow 0.6.0", ] [[package]] @@ -532,9 +532,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" dependencies = [ "anstyle", "anstyle-parse", @@ -580,9 +580,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.80" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "arbitrary" @@ -742,7 +742,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" dependencies = [ "concurrent-queue", - "event-listener 5.2.0", + "event-listener 5.0.0", "event-listener-strategy 0.5.0", "futures-core", "pin-project-lite", @@ -767,7 +767,7 @@ checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -784,7 +784,7 @@ checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -831,7 +831,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -993,9 +993,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.9.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" +checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" dependencies = [ "memchr", "serde", @@ -1009,9 +1009,9 @@ checksum = "b4ae4235e6dac0694637c763029ecea1a2ec9e4e06ec2729bd21ba4d9c863eb7" [[package]] name = "bumpalo" -version = "3.15.4" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byte-slice-cast" @@ -1123,7 +1123,7 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.22", + "semver 1.0.21", "serde", "serde_json", "thiserror", @@ -1131,9 +1131,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.90" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", "libc", @@ -1147,9 +1147,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.35" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" +checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" dependencies = [ "android-tzdata", "iana-time-zone", @@ -1157,7 +1157,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.4", + "windows-targets 0.52.0", ] [[package]] @@ -1172,9 +1172,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.2" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b230ab84b0ffdf890d5a10abdbc8b83ae1c4918275daea1ab8801f71536b2651" +checksum = "80c21025abd42669a92efc996ef13cfb2c5c627858421ea58d5c3b331a6c134f" dependencies = [ "clap_builder", "clap_derive", @@ -1182,9 +1182,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "458bf1f341769dfcf849846f65dffdf9146daa56bcd2a47cb4e1de9915567c99" dependencies = [ "anstream", "anstyle", @@ -1204,7 +1204,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -1342,9 +1342,9 @@ dependencies = [ [[package]] name = "const-hex" -version = "1.11.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbd12d49ab0eaf8193ba9175e45f56bbc2e4b27d57b8cfe62aa47942a46b9a9" +checksum = "18d59688ad0945eaf6b84cb44fedbe93484c81b48970e98f09db8a22832d7961" dependencies = [ "cfg-if", "cpufeatures", @@ -1549,7 +1549,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a11d6119f9f0f55c9d7cff5189a7b318f35a7d2d6faa4872441ee521f65420b6" dependencies = [ "counter", - "darling 0.20.8", + "darling 0.20.6", "graphql-parser", "once_cell", "ouroboros", @@ -1557,7 +1557,7 @@ dependencies = [ "quote", "rkyv", "strsim 0.10.0", - "syn 2.0.52", + "syn 2.0.48", "thiserror", ] @@ -1568,9 +1568,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb81a5872a7774daf11caefb2ebe7166d9da12b1b69cf35661130b3c3fccbd61" dependencies = [ "cynic-codegen", - "darling 0.20.8", + "darling 0.20.6", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -1585,12 +1585,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.8" +version = "0.20.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" +checksum = "c376d08ea6aa96aafe61237c7200d1241cb177b7d3a542d791f2d118e9cbb955" dependencies = [ - "darling_core 0.20.8", - "darling_macro 0.20.8", + "darling_core 0.20.6", + "darling_macro 0.20.6", ] [[package]] @@ -1609,16 +1609,16 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.8" +version = "0.20.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" +checksum = "33043dcd19068b8192064c704b3f83eb464f91f1ff527b44a4e2b08d9cdb8855" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -1634,13 +1634,13 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.8" +version = "0.20.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +checksum = "c5a91391accf613803c2a9bf9abccdbaa07c54b4244a5b64883f9c3c137c86be" dependencies = [ - "darling_core 0.20.8", + "darling_core 0.20.6", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -1697,7 +1697,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -1736,10 +1736,10 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d48cda787f839151732d396ac69e3473923d54312c070ee21e9effcaa8ca0b1d" dependencies = [ - "darling 0.20.8", + "darling 0.20.6", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -1759,7 +1759,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" dependencies = [ "derive_builder_core 0.20.0", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -1775,6 +1775,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + [[package]] name = "digest" version = "0.9.0" @@ -1879,9 +1885,9 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "dyn-clone" -version = "1.0.17" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" [[package]] name = "ecdsa" @@ -1949,17 +1955,17 @@ dependencies = [ [[package]] name = "enr" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a3d8dc56e02f954cac8eb489772c552c473346fc34f67412bb6244fd647f7e4" +checksum = "2dc3eabaca59dc39ea5ed15062e4abc5bba9723b1cff7a4fea3faae0647f04c0" dependencies = [ + "alloy-rlp", "base64 0.21.7", "bytes", "hex", "k256", "log", "rand", - "rlp", "serde", "sha3", "zeroize", @@ -1973,7 +1979,7 @@ checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -2139,7 +2145,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "syn 2.0.52", + "syn 2.0.48", "toml", "walkdir", ] @@ -2157,7 +2163,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -2183,7 +2189,7 @@ dependencies = [ "serde", "serde_json", "strum 0.26.1", - "syn 2.0.52", + "syn 2.0.48", "tempfile", "thiserror", "tiny-keccak", @@ -2199,7 +2205,7 @@ dependencies = [ "chrono", "ethers-core", "reqwest", - "semver 1.0.22", + "semver 1.0.21", "serde", "serde_json", "thiserror", @@ -2292,7 +2298,7 @@ dependencies = [ "rand", "rusoto_core", "rusoto_kms", - "semver 1.0.22", + "semver 1.0.21", "sha2 0.10.8", "spki", "thiserror", @@ -2319,7 +2325,7 @@ dependencies = [ "path-slash", "rayon", "regex", - "semver 1.0.22", + "semver 1.0.21", "serde", "serde_json", "solang-parser", @@ -2345,9 +2351,9 @@ dependencies = [ [[package]] name = "event-listener" -version = "5.2.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b5fb89194fa3cad959b833185b3063ba881dbfc7030680b314250779fb4cc91" +checksum = "b72557800024fabbaa2449dd4bf24e37b93702d457a4d4f2b0dd1f0f039f20c1" dependencies = [ "concurrent-queue", "parking", @@ -2370,7 +2376,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291" dependencies = [ - "event-listener 5.2.0", + "event-listener 5.0.0", "pin-project-lite", ] @@ -2495,7 +2501,7 @@ dependencies = [ "alloy-primitives 0.6.4", "foundry-compilers", "reqwest", - "semver 1.0.22", + "semver 1.0.21", "serde", "serde_json", "thiserror", @@ -2584,7 +2590,7 @@ dependencies = [ "once_cell", "rand", "reqwest", - "semver 1.0.22", + "semver 1.0.21", "serde", "serde_json", "tempfile", @@ -2616,7 +2622,7 @@ dependencies = [ "path-slash", "rayon", "regex", - "semver 1.0.22", + "semver 1.0.21", "serde", "serde_json", "sha2 0.10.8", @@ -2651,7 +2657,7 @@ dependencies = [ "regex", "reqwest", "revm-primitives", - "semver 1.0.22", + "semver 1.0.21", "serde", "serde_json", "serde_regex", @@ -2740,7 +2746,7 @@ dependencies = [ "foundry-compilers", "foundry-evm-core", "revm", - "semver 1.0.22", + "semver 1.0.21", "tracing", ] @@ -2806,7 +2812,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -2926,7 +2932,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -2943,9 +2949,9 @@ checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" -version = "3.0.3" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" dependencies = [ "gloo-timers", "send_wrapper 0.4.0", @@ -3023,7 +3029,7 @@ dependencies = [ "aho-corasick", "bstr", "log", - "regex-automata 0.4.6", + "regex-automata 0.4.5", "regex-syntax 0.8.2", ] @@ -3129,9 +3135,9 @@ dependencies = [ [[package]] name = "half" -version = "1.8.3" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "hashbrown" @@ -3148,7 +3154,7 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash 0.8.11", + "ahash 0.8.8", "allocator-api2", "serde", ] @@ -3170,9 +3176,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.9" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" [[package]] name = "hex" @@ -3231,9 +3237,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.12" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -3430,9 +3436,9 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "indexmap" -version = "2.2.5" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" +checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" dependencies = [ "equivalent", "hashbrown 0.14.3", @@ -3464,9 +3470,9 @@ dependencies = [ [[package]] name = "insta" -version = "1.36.1" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a7c22c4d34ef4788c351e971c52bfdfe7ea2766f8c5466bc175dd46e52ac22e" +checksum = "5d64600be34b2fcfc267740a243fa7744441bb4947a619ac4e5bb6507f35fbfc" dependencies = [ "console", "lazy_static", @@ -3517,6 +3523,17 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +[[package]] +name = "is-terminal" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "itertools" version = "0.10.5" @@ -3561,9 +3578,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" dependencies = [ "wasm-bindgen", ] @@ -3628,33 +3645,31 @@ dependencies = [ [[package]] name = "lalrpop" -version = "0.20.2" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca" +checksum = "da4081d44f4611b66c6dd725e6de3169f9f63905421e8626fcb86b6a898998b8" dependencies = [ "ascii-canvas", "bit-set", + "diff", "ena", - "itertools 0.11.0", + "is-terminal", + "itertools 0.10.5", "lalrpop-util", "petgraph", "regex", - "regex-syntax 0.8.2", + "regex-syntax 0.7.5", "string_cache", "term", "tiny-keccak", "unicode-xid", - "walkdir", ] [[package]] name = "lalrpop-util" -version = "0.20.2" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" -dependencies = [ - "regex-automata 0.4.6", -] +checksum = "3f35c735096c0293d313e8f2a641627472b83d01b937177fe76e5e2708d31e0d" [[package]] name = "lazy_static" @@ -3825,9 +3840,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.11" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "wasi", @@ -3991,7 +4006,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -4048,9 +4063,9 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.64" +version = "0.10.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" dependencies = [ "bitflags 2.4.2", "cfg-if", @@ -4069,7 +4084,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -4080,9 +4095,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.101" +version = "0.9.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dda2b0f344e78efc2facf7d195d098df0dd72151b26ab98da807afc26c198dff" +checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" dependencies = [ "cc", "libc", @@ -4118,7 +4133,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -4247,7 +4262,7 @@ checksum = "4ccca0f6c17acc81df8e242ed473ec144cbf5c98037e69aa6d144780aad103c8" dependencies = [ "inlinable_string", "pear_codegen", - "yansi 1.0.0", + "yansi 1.0.0-rc.1", ] [[package]] @@ -4259,7 +4274,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -4288,9 +4303,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.8" +version = "2.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f8023d0fb78c8e03784ea1c7f3fa36e68a723138990b8d5a47d916b651e7a8" +checksum = "219c0dcc30b6a27553f9cc242972b67f75b60eb0db71f0b5462f38b058c41546" dependencies = [ "memchr", "thiserror", @@ -4347,7 +4362,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -4370,22 +4385,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -4423,9 +4438,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" [[package]] name = "powerfmt" @@ -4452,7 +4467,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" dependencies = [ "proc-macro2", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -4547,9 +4562,9 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", "version_check", - "yansi 1.0.0", + "yansi 1.0.0-rc.1", ] [[package]] @@ -4783,6 +4798,7 @@ version = "0.1.0" dependencies = [ "alloy-primitives 0.6.4", "alloy-sol-types 0.6.4", + "serde", ] [[package]] @@ -4804,7 +4820,6 @@ dependencies = [ "rust-bigint", "serde", "serde_bytes", - "serde_yaml", "tokio", "tracing", "tracing-subscriber", @@ -4905,9 +4920,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.9.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" dependencies = [ "either", "rayon-core", @@ -4960,7 +4975,7 @@ checksum = "5fddb4f8d99b0a2ebafc65a87a69a7b9875e4b1ae1f00db265d300ef7f28bccc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -4971,7 +4986,7 @@ checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", + "regex-automata 0.4.5", "regex-syntax 0.8.2", ] @@ -4986,9 +5001,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -5001,6 +5016,12 @@ version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +[[package]] +name = "regex-syntax" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + [[package]] name = "regex-syntax" version = "0.8.2" @@ -5018,9 +5039,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.25" +version = "0.11.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eea5a9eb898d3783f17c6407670e3592fd174cb81a10e51d4c37f49450b9946" +checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" dependencies = [ "base64 0.21.7", "bytes", @@ -5161,17 +5182,16 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.8" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", - "cfg-if", "getrandom", "libc", "spin 0.9.8", "untrusted 0.9.0", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -5257,9 +5277,9 @@ dependencies = [ [[package]] name = "ruint" -version = "1.12.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49b1d9521f889713d1221270fdd63370feca7e5c71a18745343402fa86e4f04f" +checksum = "608a5726529f2f0ef81b8fde9873c4bb829d6b5b5ca6be4d97345ddf0749c825" dependencies = [ "alloy-rlp", "arbitrary", @@ -5282,9 +5302,9 @@ dependencies = [ [[package]] name = "ruint-macro" -version = "1.2.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f86854cf50259291520509879a5c294c3c9a4c334e9ff65071c51e42ef1e2343" +checksum = "e666a5496a0b2186dbcd0ff6106e29e093c15591bde62c20d3842007c6978a09" [[package]] name = "rusb" @@ -5429,7 +5449,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.22", + "semver 1.0.21", ] [[package]] @@ -5464,7 +5484,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", - "ring 0.17.8", + "ring 0.17.7", "rustls-webpki", "sct", ] @@ -5496,7 +5516,7 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.8", + "ring 0.17.7", "untrusted 0.9.0", ] @@ -5520,9 +5540,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "salsa20" @@ -5623,7 +5643,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.8", + "ring 0.17.7", "untrusted 0.9.0", ] @@ -5699,9 +5719,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" dependencies = [ "serde", ] @@ -5763,7 +5783,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -5779,9 +5799,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.114" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "indexmap", "itoa", @@ -5807,7 +5827,7 @@ checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -5980,12 +6000,12 @@ checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -6120,7 +6140,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -6133,7 +6153,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -6166,7 +6186,7 @@ dependencies = [ "hex", "once_cell", "reqwest", - "semver 1.0.22", + "semver 1.0.21", "serde", "serde_json", "sha2 0.10.8", @@ -6183,7 +6203,7 @@ checksum = "5b8d3c94c4d3337336f58493471b98d712c267c66977b0fbe48efd6cbf69ffd0" dependencies = [ "build_const", "hex", - "semver 1.0.22", + "semver 1.0.21", "serde_json", "svm-rs", ] @@ -6201,9 +6221,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.52" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -6219,7 +6239,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -6231,7 +6251,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -6242,20 +6262,20 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "system-configuration" -version = "0.6.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bc6ee10a9b4fcf576e9b0819d95ec16f4d2c02d39fd83ac1c8789785c4a42" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ - "bitflags 2.4.2", + "bitflags 1.3.2", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.6.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" dependencies = [ "core-foundation-sys", "libc", @@ -6269,9 +6289,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" dependencies = [ "cfg-if", "fastrand", @@ -6317,14 +6337,14 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] name = "thread_local" -version = "1.1.8" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ "cfg-if", "once_cell", @@ -6427,7 +6447,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -6501,7 +6521,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.6", + "toml_edit 0.22.5", ] [[package]] @@ -6548,15 +6568,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.6" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6" +checksum = "99e68c159e8f5ba8a28c4eb7b0c0c190d77bb479047ca713270048145a9ad28a" dependencies = [ "indexmap", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.5", + "winnow 0.6.0", ] [[package]] @@ -6606,7 +6626,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -6706,9 +6726,8 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "typeshare" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99877a66770b25072a67101e80790fd7fe9ed9eff8c69ffb81e9bf5cbea7733f" +version = "1.0.1" +source = "git+https://github.com/1password/typeshare?rev=556b44aafd5304eedf17206800f69834e3820b7c#556b44aafd5304eedf17206800f69834e3820b7c" dependencies = [ "chrono", "serde", @@ -6718,12 +6737,11 @@ dependencies = [ [[package]] name = "typeshare-annotation" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecce25dea8aeaadc44909f4c1226d22d84512fccd07d22447ecbad176bc09545" +version = "1.0.2" +source = "git+https://github.com/1password/typeshare?rev=556b44aafd5304eedf17206800f69834e3820b7c#556b44aafd5304eedf17206800f69834e3820b7c" dependencies = [ "quote", - "syn 2.0.52", + "syn 1.0.109", ] [[package]] @@ -6783,9 +6801,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] @@ -6952,9 +6970,9 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.5.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", "winapi-util", @@ -6977,9 +6995,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -6987,24 +7005,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" dependencies = [ "cfg-if", "js-sys", @@ -7014,9 +7032,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -7024,28 +7042,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" dependencies = [ "js-sys", "wasm-bindgen", @@ -7057,7 +7075,7 @@ version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring 0.17.8", + "ring 0.17.7", "untrusted 0.9.0", ] @@ -7104,7 +7122,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.0", ] [[package]] @@ -7122,7 +7140,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.0", ] [[package]] @@ -7142,17 +7160,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] @@ -7163,9 +7181,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" @@ -7175,9 +7193,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" @@ -7187,9 +7205,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" @@ -7199,9 +7217,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" @@ -7211,9 +7229,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" @@ -7223,9 +7241,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" @@ -7235,9 +7253,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" @@ -7250,9 +7268,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.5" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" +checksum = "6b1dbce9e90e5404c5a52ed82b1d13fc8cfbdad85033b6f57546ffd1265f8451" dependencies = [ "memchr", ] @@ -7318,9 +7336,9 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "yansi" -version = "1.0.0" +version = "1.0.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c2861d76f58ec8fc95708b9b1e417f7b12fd72ad33c01fa6886707092dea0d3" +checksum = "1367295b8f788d371ce2dbc842c7b709c73ee1364d30351dd300ec2203b12377" [[package]] name = "zerocopy" @@ -7339,7 +7357,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -7359,7 +7377,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 01481fd51..810858232 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,7 @@ comfy-table = "7.1.0" cynic-codegen = { version = "3.4.0", features = ["rkyv"] } cynic = "3.4.0" chrono = "0.4.31" -typeshare = "1.0.1" +typeshare = { git = "https://github.com/1password/typeshare", rev = "556b44aafd5304eedf17206800f69834e3820b7c" } thiserror = "1.0.56" strict-yaml-rust = "0.1.2" dotrain = { git = "https://github.com/rainlanguage/dotrain", rev = "b813542cb1c9a2399664a606761f3a3db7b842af" } @@ -45,7 +45,6 @@ rain-interpreter-eval = { path = "lib/rain.interpreter/crates/eval" } csv = "1.3.0" insta = { version = "1.34.0" } proptest = "1.4.0" -k256 = "=0.13.3" derive_builder = "0.20.0" [workspace.dependencies.rain_orderbook_bindings] diff --git a/crates/bindings/Cargo.toml b/crates/bindings/Cargo.toml index 25aed80d1..0ea70f674 100644 --- a/crates/bindings/Cargo.toml +++ b/crates/bindings/Cargo.toml @@ -9,3 +9,4 @@ homepage.workspace = true [dependencies] alloy-sol-types = { workspace = true, features = ["json"] } alloy-primitives = { workspace = true } +serde = { workspace = true } \ No newline at end of file diff --git a/crates/bindings/src/lib.rs b/crates/bindings/src/lib.rs index 2823065e7..fc01496e1 100644 --- a/crates/bindings/src/lib.rs +++ b/crates/bindings/src/lib.rs @@ -2,6 +2,7 @@ use alloy_sol_types::sol; sol!( #![sol(all_derives = true)] + #[derive(serde::Serialize, serde::Deserialize)] IOrderBookV3, "../../out/IOrderBookV3.sol/IOrderBookV3.json" ); @@ -9,3 +10,8 @@ sol!( #![sol(all_derives = true)] IERC20, "../../out/IERC20.sol/IERC20.json" ); + +sol!( + #![sol(all_derives = true)] + ERC20, "../../out/ERC20.sol/ERC20.json" +); diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 633332cfa..5ab175c13 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -14,7 +14,6 @@ rain_orderbook_subgraph_client = { workspace = true } rain_orderbook_bindings = { workspace = true } rain_orderbook_common = { workspace = true } rain_orderbook_app_settings = { workspace = true } -serde_yaml = { workspace = true } anyhow = { workspace = true } clap = { workspace = true } reqwest = { workspace = true } diff --git a/crates/cli/src/commands/chart/mod.rs b/crates/cli/src/commands/chart/mod.rs index 03b0d5c60..a0b6b5437 100644 --- a/crates/cli/src/commands/chart/mod.rs +++ b/crates/cli/src/commands/chart/mod.rs @@ -1,7 +1,7 @@ use crate::execute::Execute; use anyhow::{anyhow, Result}; use clap::Args; -use rain_orderbook_app_settings::string_structs::ConfigString; +use rain_orderbook_app_settings::{string_structs::ConfigString, Config}; use rain_orderbook_common::dotrain::RainDocument; use rain_orderbook_common::fuzz::FuzzRunner; use std::fs::read_to_string; @@ -22,7 +22,8 @@ impl Execute for Chart { async fn execute(&self) -> Result<()> { let dotrain = read_to_string(self.dotrain_file.clone()).map_err(|e| anyhow!(e))?; let frontmatter = RainDocument::get_front_matter(&dotrain).unwrap(); - let config = serde_yaml::from_str::(frontmatter)?.try_into()?; + let config_string: ConfigString = frontmatter.to_string().try_into()?; + let config: Config = config_string.try_into()?; let mut fuzzer = FuzzRunner::new(&dotrain, config, None).await; let chart_data = fuzzer.build_chart_datas().await?; diff --git a/crates/cli/src/commands/order/add.rs b/crates/cli/src/commands/order/add.rs index 66d73ca68..c9c5482ca 100644 --- a/crates/cli/src/commands/order/add.rs +++ b/crates/cli/src/commands/order/add.rs @@ -3,9 +3,12 @@ use crate::{ }; use anyhow::{anyhow, Result}; use clap::Args; +use rain_orderbook_app_settings::Config; use rain_orderbook_common::add_order::AddOrderArgs; +use rain_orderbook_common::frontmatter::parse_frontmatter; use rain_orderbook_common::transaction::TransactionArgs; use std::fs::read_to_string; +use std::ops::Deref; use std::path::PathBuf; use tracing::info; @@ -18,22 +21,32 @@ pub struct CliOrderAddArgs { )] dotrain_file: PathBuf, + #[arg(short = 'e', long, help = "Deployment key to select from frontmatter")] + deployment: String, + #[clap(flatten)] pub transaction_args: CliTransactionArgs, } -impl TryFrom for AddOrderArgs { - type Error = anyhow::Error; +impl CliOrderAddArgs { + async fn to_add_order_args(&self) -> Result { + let text = read_to_string(&self.dotrain_file).map_err(|e| anyhow!(e))?; + let config: Config = parse_frontmatter(text.clone())?.try_into()?; + let config_deployment = config + .deployments + .get(&self.deployment) + .ok_or(anyhow!("specified deployment is undefined!"))?; - fn try_from(val: CliOrderAddArgs) -> Result { - let text = read_to_string(val.dotrain_file).map_err(|e| anyhow!(e))?; - Ok(Self { dotrain: text }) + Ok( + AddOrderArgs::new_from_deployment(text.clone(), config_deployment.deref().clone()) + .await?, + ) } } impl Execute for CliOrderAddArgs { async fn execute(&self) -> Result<()> { - let add_order_args: AddOrderArgs = self.clone().try_into()?; + let add_order_args: AddOrderArgs = self.clone().to_add_order_args().await?; let mut tx_args: TransactionArgs = self.transaction_args.clone().into(); tx_args.try_fill_chain_id().await?; diff --git a/crates/common/src/add_order.rs b/crates/common/src/add_order.rs index ff8f1809a..3a9797951 100644 --- a/crates/common/src/add_order.rs +++ b/crates/common/src/add_order.rs @@ -1,23 +1,27 @@ use crate::{ dotrain_add_order_lsp::LANG_SERVICES, - frontmatter::{try_parse_frontmatter, FrontmatterError}, transaction::{TransactionArgs, TransactionArgsError}, }; use alloy_ethers_typecast::transaction::{ - ReadableClientError, ReadableClientHttp, WritableClientError, WriteTransaction, - WriteTransactionStatus, + ReadContractParameters, ReadableClientError, ReadableClientHttp, WritableClientError, + WriteTransaction, WriteTransactionStatus, }; use alloy_primitives::{hex::FromHexError, Address, U256}; -use dotrain::{error::ComposeError, RainDocument}; +use dotrain::{error::ComposeError, RainDocument, Rebind}; use rain_interpreter_dispair::{DISPair, DISPairError}; use rain_interpreter_parser::{Parser, ParserError, ParserV1}; use rain_metadata::{ ContentEncoding, ContentLanguage, ContentType, Error as RainMetaError, KnownMagic, RainMetaDocumentV1Item, }; -use rain_orderbook_bindings::IOrderBookV3::{addOrderCall, EvaluableConfigV3, OrderConfigV2}; +use rain_orderbook_app_settings::deployment::Deployment; +use rain_orderbook_bindings::{ + IOrderBookV3::{addOrderCall, EvaluableConfigV3, OrderConfigV2, IO}, + ERC20::decimalsCall, +}; use serde::{Deserialize, Serialize}; use serde_bytes::ByteBuf; +use std::collections::HashMap; use thiserror::Error; pub static ORDERBOOK_ORDER_ENTRYPOINTS: [&str; 2] = ["calculate-io", "handle-io"]; @@ -26,8 +30,6 @@ pub static ORDERBOOK_ORDER_ENTRYPOINTS: [&str; 2] = ["calculate-io", "handle-io" pub enum AddOrderArgsError { #[error("Empty Front Matter")] EmptyFrontmatter, - #[error("Front Matter: {0}")] - FrontmatterError(#[from] FrontmatterError), #[error(transparent)] DISPairError(#[from] DISPairError), #[error(transparent)] @@ -47,40 +49,88 @@ pub enum AddOrderArgsError { } #[derive(Serialize, Deserialize, Clone)] +#[serde(rename = "kebab-case")] pub struct AddOrderArgs { - /// Text of a dotrain file describing an addOrder call - /// Text MUST have strict yaml frontmatter of the following structure - /// - /// ```yaml - /// orderbook: - /// order: - /// deployer: 0x1111111111111111111111111111111111111111 - /// valid-inputs: - /// - address: 0x2222222222222222222222222222222222222222 - /// decimals: 18 - /// vault-id: 0x1234 - /// valid-outputs: - /// - address: 0x5555555555555555555555555555555555555555 - /// decimals: 8 - /// vault-id: 0x5678 - /// ``` - /// - /// Text MUST have valid dotrain body succeding frontmatter. - /// The dotrain body must contain two entrypoints: `calulate-io` and `handle-io`. pub dotrain: String, + pub inputs: Vec, + pub outputs: Vec, + pub deployer: Address, + pub bindings: HashMap, } impl AddOrderArgs { + /// create a new instance from Deployment + pub async fn new_from_deployment( + dotrain: String, + deployment: Deployment, + ) -> Result { + let mut inputs = vec![]; + for input in &deployment.order.inputs { + if let Some(decimals) = input.token.decimals { + inputs.push(IO { + token: input.token.address, + vaultId: input.vault_id, + decimals, + }); + } else { + let client = ReadableClientHttp::new_from_url(input.token.network.rpc.to_string())?; + let parameters = ReadContractParameters { + address: input.token.address, + call: decimalsCall {}, + block_number: None, + }; + let decimals = client.read(parameters).await?._0; + inputs.push(IO { + token: input.token.address, + vaultId: input.vault_id, + decimals, + }); + } + } + + let mut outputs = vec![]; + for output in &deployment.order.inputs { + if let Some(decimals) = output.token.decimals { + outputs.push(IO { + token: output.token.address, + vaultId: output.vault_id, + decimals, + }); + } else { + let client = + ReadableClientHttp::new_from_url(output.token.network.rpc.to_string())?; + let parameters = ReadContractParameters { + address: output.token.address, + call: decimalsCall {}, + block_number: None, + }; + let decimals = client.read(parameters).await?._0; + outputs.push(IO { + token: output.token.address, + vaultId: output.vault_id, + decimals, + }); + } + } + + Ok(AddOrderArgs { + dotrain: dotrain.to_string(), + inputs, + outputs, + deployer: deployment.scenario.deployer.address, + bindings: deployment.scenario.bindings.to_owned(), + }) + } + /// Read parser address from deployer contract, then call parser to parse rainlang into bytecode and constants async fn try_parse_rainlang( &self, rpc_url: String, - deployer: Address, rainlang: String, ) -> Result<(Vec, Vec), AddOrderArgsError> { let client = ReadableClientHttp::new_from_url(rpc_url) .map_err(AddOrderArgsError::ReadableClientError)?; - let dispair = DISPair::from_deployer(deployer, client.clone()) + let dispair = DISPair::from_deployer(self.deployer, client.clone()) .await .map_err(AddOrderArgsError::DISPairError)?; @@ -116,27 +166,29 @@ impl AddOrderArgs { // Parse file into dotrain document let meta_store = LANG_SERVICES.meta_store(); - let frontmatter = RainDocument::get_front_matter(&self.dotrain) - .ok_or(AddOrderArgsError::EmptyFrontmatter)?; - - // Prepare call - let (deployer, valid_inputs, valid_outputs, rebinds) = try_parse_frontmatter(frontmatter)?; + let mut rebinds = None; + if !self.bindings.is_empty() { + rebinds = Some( + self.bindings + .iter() + .map(|(key, value)| Rebind(key.clone(), value.clone())) + .collect(), + ); + }; let dotrain_doc = RainDocument::create(self.dotrain.clone(), Some(meta_store), None, rebinds); let rainlang = dotrain_doc.compose(&ORDERBOOK_ORDER_ENTRYPOINTS)?; - let (bytecode, constants) = self - .try_parse_rainlang(rpc_url, deployer, rainlang.clone()) - .await?; + let (bytecode, constants) = self.try_parse_rainlang(rpc_url, rainlang.clone()).await?; let meta = self.try_generate_meta(rainlang)?; Ok(addOrderCall { config: OrderConfigV2 { - validInputs: valid_inputs, - validOutputs: valid_outputs, + validInputs: self.inputs.clone(), + validOutputs: self.outputs.clone(), evaluableConfig: EvaluableConfigV3 { - deployer, + deployer: self.deployer, bytecode, constants, }, @@ -182,7 +234,13 @@ max-amount: 100e18, price: 2e18; ", ); - let args = AddOrderArgs { dotrain: "".into() }; + let args = AddOrderArgs { + dotrain: "".into(), + inputs: vec![], + outputs: vec![], + bindings: HashMap::new(), + deployer: Address::default(), + }; let meta_bytes = args.try_generate_meta(dotrain_body).unwrap(); assert_eq!( diff --git a/crates/common/src/dotrain_add_order_lsp.rs b/crates/common/src/dotrain_add_order_lsp.rs index b84555200..e414eec35 100644 --- a/crates/common/src/dotrain_add_order_lsp.rs +++ b/crates/common/src/dotrain_add_order_lsp.rs @@ -1,16 +1,17 @@ use crate::add_order::ORDERBOOK_ORDER_ENTRYPOINTS; -use crate::frontmatter::try_parse_frontmatter_rebinds; use crate::rainlang::parse_rainlang_on_fork; +use alloy_primitives::Address; use dotrain::{ error::{ComposeError, ErrorCode}, types::ast::Problem, - RainDocument, Rebind, + Rebind, }; use dotrain_lsp::{ lsp_types::{CompletionItem, Hover, Position, TextDocumentItem}, RainLanguageServices, }; use once_cell::sync::Lazy; +use std::collections::HashMap; /// static lang services instance /// meta store instance can be taken from this for shared access to a unfied meta store across @@ -19,18 +20,24 @@ pub static LANG_SERVICES: Lazy = Lazy::new(RainLanguageSer pub struct DotrainAddOrderLsp { text_document: TextDocumentItem, - frontmatter: String, rebinds: Option>, } impl DotrainAddOrderLsp { - pub fn new(text_document: TextDocumentItem) -> Self { - let frontmatter = RainDocument::get_front_matter(&text_document.text); - let rebinds = frontmatter.and_then(try_parse_frontmatter_rebinds); + pub fn new(text_document: TextDocumentItem, bindings: HashMap) -> Self { + let rebinds = if !bindings.is_empty() { + Some( + bindings + .iter() + .map(|(key, value)| Rebind(key.clone(), value.clone())) + .collect(), + ) + } else { + None + }; Self { text_document: text_document.clone(), - frontmatter: frontmatter.unwrap_or("").to_string(), rebinds, } } @@ -46,7 +53,12 @@ impl DotrainAddOrderLsp { } /// get problems for a given text document item - pub async fn problems(&self, rpc_url: &str, block_number: Option) -> Vec { + pub async fn problems( + &self, + rpc_url: &str, + block_number: Option, + deployer: Option
, + ) -> Vec { let rain_document = LANG_SERVICES.new_rain_document(&self.text_document, self.rebinds.clone()); let all_problems = rain_document.all_problems(); @@ -67,18 +79,26 @@ impl DotrainAddOrderLsp { }, }; - parse_rainlang_on_fork(&self.frontmatter, &rainlang, rpc_url, block_number) - .await - .map_or_else( - |e| { - vec![Problem { - msg: e.to_string(), - position: [0, 0], - code: ErrorCode::NativeParserError, - }] - }, - |_| vec![], - ) + if let Some(deployer_add) = deployer { + parse_rainlang_on_fork(&rainlang, rpc_url, block_number, deployer_add) + .await + .map_or_else( + |e| { + vec![Problem { + msg: e.to_string(), + position: [0, 0], + code: ErrorCode::NativeParserError, + }] + }, + |_| vec![], + ) + } else { + vec![Problem { + msg: "undefined deployer address".to_owned(), + position: [0, 0], + code: ErrorCode::NativeParserError, + }] + } } } } diff --git a/crates/common/src/frontmatter.rs b/crates/common/src/frontmatter.rs index 63512f458..2be2a3c21 100644 --- a/crates/common/src/frontmatter.rs +++ b/crates/common/src/frontmatter.rs @@ -1,210 +1,8 @@ -use alloy_primitives::{Address, U256}; -use dotrain::Rebind; -use rain_orderbook_bindings::IOrderBookV3::IO; -use strict_yaml_rust::{scanner::ScanError, StrictYaml, StrictYamlLoader}; -use thiserror::Error; +use dotrain::RainDocument; +use rain_orderbook_app_settings::{config::ParseConfigStringError, string_structs::ConfigString}; -#[derive(Error, Debug)] -pub enum FrontmatterError { - #[error("frontmatter is not valid strict yaml: {0}")] - FrontmatterInvalidYaml(#[from] ScanError), - #[error("Invalid Field: {0}")] - FrontmatterFieldInvalid(String), - #[error("Missing Field: {0}")] - FrontmatterFieldMissing(String), - #[error("Frontmatter empty")] - FrontmatterEmpty, -} - -/// Parse dotrain frontmatter to extract deployer, valid-inputs and valid-outputs -#[allow(clippy::type_complexity)] -pub fn try_parse_frontmatter( - frontmatter: &str, -) -> Result<(Address, Vec, Vec, Option>), FrontmatterError> { - // Parse dotrain document frontmatter - let frontmatter_yaml_vec = StrictYamlLoader::load_from_str(frontmatter) - .map_err(FrontmatterError::FrontmatterInvalidYaml)?; - let frontmatter_yaml = frontmatter_yaml_vec - .first() - .ok_or(FrontmatterError::FrontmatterEmpty)?; - - let deployer = frontmatter_yaml["orderbook"]["order"]["deployer"] - .as_str() - .ok_or(FrontmatterError::FrontmatterFieldMissing( - "orderbook.order.deployer".into(), - ))? - .parse::
() - .map_err(|_| { - FrontmatterError::FrontmatterFieldInvalid("orderbook.order.deployer".into()) - })?; - - let valid_inputs: Vec = try_parse_frontmatter_io( - frontmatter_yaml["orderbook"]["order"]["valid-inputs"].clone(), - "valid-inputs", - )?; - let valid_outputs: Vec = try_parse_frontmatter_io( - frontmatter_yaml["orderbook"]["order"]["valid-outputs"].clone(), - "valid-outputs", - )?; - - let rebinds = get_rebinds_from_yaml(frontmatter_yaml); - - Ok((deployer, valid_inputs, valid_outputs, rebinds)) -} - -/// parses a yaml text and tries to get rebindings from it -pub fn try_parse_frontmatter_rebinds(frontmatter: &str) -> Option> { - let frontmatter_yaml_vec = StrictYamlLoader::load_from_str(frontmatter).ok()?; - let frontmatter_yaml = frontmatter_yaml_vec.first()?; - - get_rebinds_from_yaml(frontmatter_yaml) -} - -/// gets rebindings from a parsed yaml -pub fn get_rebinds_from_yaml(frontmatter_yaml: &StrictYaml) -> Option> { - let mut rebinds = vec![]; - let items = frontmatter_yaml["bind"].as_vec()?; - for item in items { - for (key, value) in item.as_hash()? { - rebinds.push(Rebind(key.as_str()?.to_owned(), value.as_str()?.to_owned())) - } - } - Some(rebinds) -} - -/// Parse an Io array from from frontmatter field (i.e. valid-inputs or valid-outputs) -pub fn try_parse_frontmatter_io( - io_yamls: StrictYaml, - io_field_name: &str, -) -> Result, FrontmatterError> { - io_yamls - .into_vec() - .ok_or(FrontmatterError::FrontmatterFieldMissing(format!( - "orderbook.order.{}", - io_field_name - )))? - .into_iter() - .map(|io_yaml| -> Result { - Ok(IO { - token: io_yaml["token"] - .as_str() - .ok_or(FrontmatterError::FrontmatterFieldMissing(format!( - "orderbook.order.{}.token", - io_field_name - )))? - .parse::
() - .map_err(|_| { - FrontmatterError::FrontmatterFieldInvalid(format!( - "orderbook.order.{}.token", - io_field_name - )) - })?, - decimals: io_yaml["decimals"] - .as_str() - .ok_or(FrontmatterError::FrontmatterFieldMissing(format!( - "orderbook.order.{}.decimals", - io_field_name - )))? - .parse::() - .map_err(|_| { - FrontmatterError::FrontmatterFieldInvalid(format!( - "orderbook.order.{}.decimals", - io_field_name - )) - })?, - vaultId: io_yaml["vault-id"] - .as_str() - .ok_or(FrontmatterError::FrontmatterFieldMissing(format!( - "orderbook.order.{}.vault-id", - io_field_name - )))? - .parse::() - .map_err(|_| { - FrontmatterError::FrontmatterFieldInvalid(format!( - "orderbook.order.{}.vault-id", - io_field_name - )) - })?, - }) - }) - .collect::, FrontmatterError>>() -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_try_parse_rebinds() { - let frontmatter = " -orderbook: - order: - deployer: 0x1111111111111111111111111111111111111111 - valid-inputs: - - token: 0x0000000000000000000000000000000000000001 - decimals: 18 - vault-id: 0x1 - valid-outputs: - - token: 0x0000000000000000000000000000000000000002 - decimals: 18 - vault-id: 0x2 -bind: - - some-binding: 12345 - - some-other-binding: 2e16 - - another-binding: \" some literal string \" -"; - let rebinds = try_parse_frontmatter_rebinds(frontmatter).unwrap(); - let expected = vec![ - Rebind("some-binding".to_owned(), "12345".to_owned()), - Rebind("some-other-binding".to_owned(), "2e16".to_owned()), - Rebind( - "another-binding".to_owned(), - " some literal string ".to_owned(), - ), - ]; - assert_eq!(rebinds, expected) - } - - #[test] - fn test_try_parse_frontmatter() { - let frontmatter = " -orderbook: - order: - deployer: 0x1111111111111111111111111111111111111111 - valid-inputs: - - token: 0x0000000000000000000000000000000000000001 - decimals: 18 - vault-id: 0x1 - valid-outputs: - - token: 0x0000000000000000000000000000000000000002 - decimals: 18 - vault-id: 0x2 -"; - - let (deployer, valid_inputs, valid_outputs, _) = - try_parse_frontmatter(frontmatter).unwrap(); - - assert_eq!( - deployer, - "0x1111111111111111111111111111111111111111" - .parse::
() - .unwrap() - ); - assert_eq!( - valid_inputs[0].token, - "0x0000000000000000000000000000000000000001" - .parse::
() - .unwrap() - ); - assert_eq!(valid_inputs[0].decimals, 18); - assert_eq!(valid_inputs[0].vaultId, U256::from(1)); - assert_eq!( - valid_outputs[0].token, - "0x0000000000000000000000000000000000000002" - .parse::
() - .unwrap() - ); - assert_eq!(valid_outputs[0].decimals, 18); - assert_eq!(valid_outputs[0].vaultId, U256::from(2)); - } +/// Parse dotrain frontmatter and merges it with top Config if given +pub fn parse_frontmatter(dotrain: String) -> Result { + let frontmatter = RainDocument::get_front_matter(dotrain.as_str()).unwrap_or(""); + Ok(frontmatter.to_string().try_into()?) } diff --git a/crates/common/src/fuzz/mod.rs b/crates/common/src/fuzz/mod.rs index 453fd402b..a2c9e8668 100644 --- a/crates/common/src/fuzz/mod.rs +++ b/crates/common/src/fuzz/mod.rs @@ -281,7 +281,7 @@ deployers: networks: mumbai: rpc: https://polygon-mumbai.g.alchemy.com/v2/_i0186N-488iRU9wUwMQDreCAKy-MEXa - chain_id: 80001 + chain-id: 80001 scenarios: mumbai: runs: 500 @@ -329,7 +329,7 @@ b: fuzzed; networks: mumbai: rpc: https://polygon-mumbai.g.alchemy.com/v2/_i0186N-488iRU9wUwMQDreCAKy-MEXa - chain_id: 80001 + chain-id: 80001 scenarios: mumbai: runs: 500 @@ -346,12 +346,12 @@ b: fuzzed; data: x: 0.0 y: 0.1 - plot_type: line + plot-type: line plot2: data: x: 0.0 y: 0.2 - plot_type: bar + plot-type: bar --- #bound !bind it #fuzzed !fuzz it diff --git a/crates/common/src/rainlang.rs b/crates/common/src/rainlang.rs index dd8aa7203..8036fb0ab 100644 --- a/crates/common/src/rainlang.rs +++ b/crates/common/src/rainlang.rs @@ -1,4 +1,3 @@ -use crate::frontmatter::{try_parse_frontmatter, FrontmatterError}; use alloy_ethers_typecast::transaction::{ReadableClientError, ReadableClientHttp}; use alloy_primitives::{bytes::Bytes, Address}; use once_cell::sync::Lazy; @@ -21,8 +20,6 @@ pub enum ForkParseError { ForkerError(ForkCallError), #[error("Fork Call Reverted: {0}")] ForkCallReverted(AbiDecodedErrorType), - #[error("Front Matter: {0}")] - FrontmatterError(#[from] FrontmatterError), #[error(transparent)] ReadableClientError(#[from] ReadableClientError), #[error("Failed to read Parser address from deployer")] @@ -50,13 +47,11 @@ pub const SENDER_ADDRESS: Address = Address::repeat_byte(0x1); /// with the deployer parsed from the front matter /// returns abi encoded expression config on Ok variant pub async fn parse_rainlang_on_fork( - frontmatter: &str, rainlang: &str, rpc_url: &str, block_number: Option, + deployer: Address, ) -> Result { - let deployer = try_parse_frontmatter(frontmatter)?.0; - // Prepare evm fork let block_number_val = match block_number { Some(b) => b, diff --git a/crates/settings/src/chart.rs b/crates/settings/src/chart.rs index d6b9ca9f5..5b1421f68 100644 --- a/crates/settings/src/chart.rs +++ b/crates/settings/src/chart.rs @@ -6,7 +6,8 @@ use typeshare::typeshare; use crate::*; #[typeshare] -#[derive(Debug, Serialize, Deserialize, Clone)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[serde(rename_all = "kebab-case")] pub struct Chart { #[typeshare(typescript(type = "Scenario"))] pub scenario: Arc, @@ -14,14 +15,16 @@ pub struct Chart { } #[typeshare] -#[derive(Debug, Serialize, Deserialize, Clone)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[serde(rename_all = "kebab-case")] pub struct Plot { pub data: DataPoints, pub plot_type: String, } #[typeshare] -#[derive(Debug, Serialize, Deserialize, Clone)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[serde(rename_all = "kebab-case")] pub struct DataPoints { pub x: String, pub y: String, diff --git a/crates/settings/src/config.rs b/crates/settings/src/config.rs index 1b13c67ba..a0b84ad15 100644 --- a/crates/settings/src/config.rs +++ b/crates/settings/src/config.rs @@ -8,7 +8,8 @@ use typeshare::typeshare; use url::Url; #[typeshare] -#[derive(Debug, Serialize, Deserialize, Default, Clone)] +#[derive(Debug, Serialize, Deserialize, Default, Clone, PartialEq)] +#[serde(rename_all = "kebab-case")] pub struct Config { #[typeshare(typescript(type = "Record"))] pub networks: HashMap>, @@ -70,16 +71,7 @@ impl TryFrom for Config { let subgraphs = item .subgraphs .into_iter() - .map(|(name, subgraph)| { - Ok(( - name, - Arc::new( - subgraph - .parse() - .map_err(ParseConfigStringError::SubgraphParseError)?, - ), - )) - }) + .map(|(name, subgraph)| Ok((name, Arc::new(subgraph)))) .collect::>, ParseConfigStringError>>()?; let orderbooks = item @@ -181,13 +173,6 @@ impl TryFrom for Config { } } -impl TryFrom<&str> for Config { - type Error = ParseConfigStringError; - fn try_from(val: &str) -> Result { - std::convert::TryInto::::try_into(val)?.try_into() - } -} - #[cfg(test)] mod tests { use super::*; @@ -201,10 +186,10 @@ mod tests { networks.insert( "mainnet".to_string(), NetworkString { - rpc: "https://mainnet.node".to_string(), - chain_id: "1".to_string(), + rpc: Url::parse("https://mainnet.node").unwrap(), + chain_id: 1, label: Some("Ethereum Mainnet".to_string()), - network_id: Some("1".to_string()), + network_id: Some(1), currency: Some("ETH".to_string()), }, ); @@ -212,14 +197,16 @@ mod tests { let mut subgraphs = HashMap::new(); subgraphs.insert( "mainnet".to_string(), - "https://mainnet.subgraph".to_string(), + Url::parse("https://mainnet.subgraph").unwrap(), ); let mut orderbooks = HashMap::new(); orderbooks.insert( "mainnetOrderbook".to_string(), OrderbookString { - address: "0x1234567890123456789012345678901234567890".to_string(), + address: "0x1234567890123456789012345678901234567890" + .parse::
() + .unwrap(), network: Some("mainnet".to_string()), subgraph: Some("mainnet".to_string()), label: Some("Mainnet Orderbook".to_string()), @@ -231,8 +218,10 @@ mod tests { "ETH".to_string(), TokenString { network: "mainnet".to_string(), - address: "0x7890123456789012345678901234567890123456".to_string(), - decimals: Some("18".to_string()), + address: "0x7890123456789012345678901234567890123456" + .parse::
() + .unwrap(), + decimals: Some(18), label: Some("Ethereum".to_string()), symbol: Some("ETH".to_string()), }, @@ -242,7 +231,9 @@ mod tests { deployers.insert( "mainDeployer".to_string(), DeployerString { - address: "0xabcdef0123456789ABCDEF0123456789ABCDEF01".to_string(), + address: "0xabcdef0123456789ABCDEF0123456789ABCDEF01" + .parse::
() + .unwrap(), network: Some("mainnet".to_string()), label: Some("Mainnet Deployer".to_string()), }, diff --git a/crates/settings/src/deployer.rs b/crates/settings/src/deployer.rs index 94d4ee17c..d4f773b0d 100644 --- a/crates/settings/src/deployer.rs +++ b/crates/settings/src/deployer.rs @@ -6,7 +6,7 @@ use thiserror::Error; use typeshare::typeshare; #[typeshare] -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] pub struct Deployer { #[typeshare(typescript(type = "string"))] pub address: Address, @@ -43,10 +43,7 @@ impl DeployerString { }; Ok(Deployer { - address: self - .address - .parse() - .map_err(ParseDeployerStringError::AddressParseError)?, + address: self.address, network: network_ref, label: self.label, }) @@ -76,7 +73,7 @@ mod tests { let network_name = "Local Testnet"; let networks = HashMap::from([(network_name.to_string(), mock_network())]); let deployer_string = DeployerString { - address: address.to_string(), + address, network: Some(network_name.to_string()), label: Some("Test Deployer".to_string()), }; @@ -92,31 +89,13 @@ mod tests { assert_eq!(deployer.label, Some("Test Deployer".to_string())); } - #[test] - fn test_try_into_deployer_address_parse_error() { - let invalid_address = "zzz"; // Intentionally invalid address format - let network_name = "testnet"; - let networks = HashMap::from([(network_name.to_string(), mock_network())]); - let deployer_string = DeployerString { - address: invalid_address.into(), - network: Some(network_name.to_string()), - label: Some("Invalid Deployer".to_string()), - }; - - let result = deployer_string.try_into_deployer(network_name.to_string(), &networks); - assert!(matches!( - result, - Err(ParseDeployerStringError::AddressParseError(_)) - )); - } - #[test] fn test_try_into_deployer_network_not_found_error() { let address = Address::repeat_byte(0x01); let invalid_network_name = "unknownnet"; let networks = HashMap::new(); // Empty networks map let deployer_string = DeployerString { - address: address.to_string(), + address, network: Some(invalid_network_name.to_string()), label: None, }; @@ -134,7 +113,7 @@ mod tests { let network_name = "Local Testnet"; let networks = HashMap::from([(network_name.to_string(), mock_network())]); let deployer_string = DeployerString { - address: address.to_string(), + address, network: None, // No network specified label: None, }; diff --git a/crates/settings/src/deployment.rs b/crates/settings/src/deployment.rs index bb98f2081..e06396dea 100644 --- a/crates/settings/src/deployment.rs +++ b/crates/settings/src/deployment.rs @@ -5,7 +5,8 @@ use thiserror::Error; use typeshare::typeshare; #[typeshare] -#[derive(Debug, Serialize, Deserialize, Clone)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[serde(rename_all = "kebab-case")] pub struct Deployment { #[typeshare(typescript(type = "Scenario"))] pub scenario: Arc, diff --git a/crates/settings/src/lib.rs b/crates/settings/src/lib.rs index 8b5faad70..ffdf391a7 100644 --- a/crates/settings/src/lib.rs +++ b/crates/settings/src/lib.rs @@ -6,13 +6,11 @@ pub mod merge; pub mod network; pub mod order; pub mod orderbook; -pub mod parse; pub mod scenario; pub mod string_structs; pub mod token; pub(crate) use chart::*; -pub(crate) use config::*; pub(crate) use deployer::*; pub(crate) use deployment::*; pub(crate) use network::*; @@ -25,7 +23,4 @@ pub(crate) use token::*; #[cfg(test)] mod test; -pub use parse::*; - -#[macro_use] -extern crate derive_builder; +pub use config::*; diff --git a/crates/settings/src/merge.rs b/crates/settings/src/merge.rs index 0f3c1fea9..c51c150a1 100644 --- a/crates/settings/src/merge.rs +++ b/crates/settings/src/merge.rs @@ -27,6 +27,9 @@ pub enum MergeError { #[error("There is already a chart called {0}")] ChartCollision(String), + + #[error("There is already a deployment called {0}")] + DeploymentCollision(String), } impl ConfigString { @@ -103,6 +106,15 @@ impl ConfigString { charts.insert(key, value); } + // Deployments + let deployments = &mut self.deployments; + for (key, value) in other.deployments { + if deployments.contains_key(&key) { + return Err(MergeError::DeploymentCollision(key)); + } + deployments.insert(key, value); + } + Ok(()) } } @@ -181,12 +193,23 @@ impl Config { charts.insert(key, value.clone()); } + // Deployments + let deployments = &mut self.deployments; + for (key, value) in other.deployments { + if deployments.contains_key(&key) { + return Err(MergeError::DeploymentCollision(key)); + } + deployments.insert(key, value); + } + Ok(()) } } #[cfg(test)] mod tests { + use url::Url; + use super::*; use std::collections::HashMap; #[test] @@ -245,13 +268,15 @@ mod tests { }; // Add a collision to cause an unsuccessful merge - config - .subgraphs - .insert("subgraph1".to_string(), "value1".to_string()); + config.subgraphs.insert( + "subgraph1".to_string(), + Url::parse("https://myurl").unwrap(), + ); - other - .subgraphs - .insert("subgraph1".to_string(), "value1".to_string()); + other.subgraphs.insert( + "subgraph1".to_string(), + Url::parse("https://myurl").unwrap(), + ); assert_eq!( config.merge(other), diff --git a/crates/settings/src/network.rs b/crates/settings/src/network.rs index 613ed07d7..1a4be7cd1 100644 --- a/crates/settings/src/network.rs +++ b/crates/settings/src/network.rs @@ -6,14 +6,15 @@ use typeshare::typeshare; use url::{ParseError, Url}; #[typeshare] -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +#[serde(rename_all = "kebab-case")] pub struct Network { #[typeshare(typescript(type = "string"))] pub rpc: Url, - #[typeshare(skip)] + #[typeshare(typescript(type = "number"))] pub chain_id: u64, pub label: Option, - #[typeshare(skip)] + #[typeshare(typescript(type = "number"))] pub network_id: Option, pub currency: Option, } @@ -33,22 +34,10 @@ impl TryFrom for Network { fn try_from(item: NetworkString) -> Result { Ok(Network { - rpc: item - .rpc - .parse() - .map_err(ParseNetworkStringError::RpcParseError)?, - chain_id: item - .chain_id - .parse() - .map_err(ParseNetworkStringError::ChainIdParseError)?, + rpc: item.rpc, + chain_id: item.chain_id, label: item.label, - network_id: item - .network_id - .map(|id| { - id.parse() - .map_err(ParseNetworkStringError::NetworkIdParseError) - }) - .transpose()?, + network_id: item.network_id, currency: item.currency, }) } @@ -62,9 +51,9 @@ mod tests { #[test] fn test_try_from_network_string_success() { let network_string = NetworkString { - rpc: "http://127.0.0.1:8545".into(), - chain_id: "1".into(), - network_id: Some("1".into()), + rpc: Url::parse("http://127.0.0.1:8545").unwrap(), + chain_id: 1, + network_id: Some(1), label: Some("Local Testnet".into()), currency: Some("ETH".into()), }; @@ -79,58 +68,4 @@ mod tests { assert_eq!(network.label, Some("Local Testnet".into())); assert_eq!(network.currency, Some("ETH".into())); } - - #[test] - fn test_try_from_network_string_rpc_parse_error() { - let invalid_rpc = "invalid_url"; // Intentionally invalid URL - let network_string = NetworkString { - rpc: invalid_rpc.into(), - chain_id: "1".into(), - network_id: Some("1".into()), - label: None, - currency: None, - }; - - let result = Network::try_from(network_string); - assert!(matches!( - result, - Err(ParseNetworkStringError::RpcParseError(_)) - )); - } - - #[test] - fn test_try_from_network_string_chain_id_parse_error() { - let invalid_chain_id = "abc"; // Intentionally invalid number format - let network_string = NetworkString { - rpc: "http://127.0.0.1:8545".into(), - chain_id: invalid_chain_id.into(), - network_id: Some("1".into()), - label: None, - currency: None, - }; - - let result = Network::try_from(network_string); - assert!(matches!( - result, - Err(ParseNetworkStringError::ChainIdParseError(_)) - )); - } - - #[test] - fn test_try_from_network_string_network_id_parse_error() { - let invalid_network_id = "abc"; // Intentionally invalid number format - let network_string = NetworkString { - rpc: "http://127.0.0.1:8545".into(), - chain_id: "1".into(), - network_id: Some(invalid_network_id.into()), - label: None, - currency: None, - }; - - let result = Network::try_from(network_string); - assert!(matches!( - result, - Err(ParseNetworkStringError::NetworkIdParseError(_)) - )); - } } diff --git a/crates/settings/src/order.rs b/crates/settings/src/order.rs index c05ab7e83..803bb3031 100644 --- a/crates/settings/src/order.rs +++ b/crates/settings/src/order.rs @@ -7,6 +7,7 @@ use typeshare::typeshare; #[typeshare] #[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[serde(rename_all = "kebab-case")] pub struct OrderIO { #[typeshare(typescript(type = "Token"))] pub token: Arc, @@ -15,7 +16,8 @@ pub struct OrderIO { } #[typeshare] -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "kebab-case")] pub struct Order { #[typeshare(typescript(type = "OrderIO[]"))] pub inputs: Vec, @@ -109,7 +111,7 @@ impl OrderString { if v.network == network { Ok(OrderIO { token: v.clone(), - vault_id: input.vault_id.parse::()?, + vault_id: input.vault_id, }) } else { Err(ParseOrderStringError::NetworkNotMatch) @@ -131,7 +133,7 @@ impl OrderString { if v.network == network { Ok(OrderIO { token: v.clone(), - vault_id: output.vault_id.parse::()?, + vault_id: output.vault_id, }) } else { Err(ParseOrderStringError::NetworkNotMatch) @@ -181,11 +183,11 @@ mod tests { orderbook: Some("Orderbook1".to_string()), inputs: vec![IOString { token: "Token1".to_string(), - vault_id: "1".to_string(), + vault_id: U256::from(1), }], outputs: vec![IOString { token: "Token2".to_string(), - vault_id: "2".to_string(), + vault_id: U256::from(2), }], }; @@ -291,7 +293,7 @@ mod tests { orderbook: None, inputs: vec![IOString { token: "Nonexistent Token".to_string(), - vault_id: "1".to_string(), + vault_id: U256::from(1), }], outputs: vec![], }; diff --git a/crates/settings/src/orderbook.rs b/crates/settings/src/orderbook.rs index b224208fa..27a436572 100644 --- a/crates/settings/src/orderbook.rs +++ b/crates/settings/src/orderbook.rs @@ -8,7 +8,8 @@ use thiserror::Error; use typeshare::typeshare; #[typeshare] -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +#[serde(rename_all = "kebab-case")] pub struct Orderbook { #[typeshare(typescript(type = "string"))] pub address: Address, @@ -67,10 +68,7 @@ impl OrderbookString { }; Ok(Orderbook { - address: self - .address - .parse() - .map_err(ParseOrderbookStringError::AddressParseError)?, + address: self.address, network: network_ref, subgraph: subgraph_ref, label: self.label, @@ -103,9 +101,11 @@ mod tests { #[test] fn test_orderbook_creation_success() { let (networks, subgraphs) = setup(); - let address = "0x1234567890123456789012345678901234567890"; + let address = "0x1234567890123456789012345678901234567890" + .parse::
() + .unwrap(); let orderbook_string = OrderbookString { - address: address.to_string(), + address, network: Some("TestNetwork".to_string()), subgraph: Some("TestSubgraph".to_string()), label: Some("TestLabel".to_string()), @@ -117,7 +117,7 @@ mod tests { assert!(orderbook.is_ok()); let orderbook = orderbook.unwrap(); - assert_eq!(orderbook.address, address.parse::
().unwrap()); + assert_eq!(orderbook.address, address); assert_eq!( Arc::as_ptr(&orderbook.network), Arc::as_ptr(networks.get("TestNetwork").unwrap()) @@ -133,7 +133,7 @@ mod tests { fn test_orderbook_creation_with_missing_network() { let (networks, subgraphs) = setup(); let orderbook_string = OrderbookString { - address: "1234".to_string(), + address: Address::random(), network: Some("NonExistingNetwork".to_string()), subgraph: Some("TestSubgraph".to_string()), label: None, @@ -153,7 +153,7 @@ mod tests { fn test_orderbook_creation_with_missing_subgraph() { let (networks, subgraphs) = setup(); let orderbook_string = OrderbookString { - address: "1234".to_string(), + address: Address::random(), network: Some("TestNetwork".to_string()), subgraph: Some("NonExistingSubgraph".to_string()), label: None, @@ -168,25 +168,4 @@ mod tests { ParseOrderbookStringError::SubgraphNotFoundError("NonExistingSubgraph".to_string()) ); } - - #[test] - fn test_orderbook_creation_with_invalid_address() { - let (networks, subgraphs) = setup(); - let invalid_address = "InvalidAddress"; - let orderbook_string = OrderbookString { - address: invalid_address.to_string(), - network: Some("TestNetwork".to_string()), - subgraph: Some("TestSubgraph".to_string()), - label: None, - }; - - let result = - orderbook_string.try_into_orderbook("TestName".to_string(), &networks, &subgraphs); - - assert!(result.is_err()); - match result.unwrap_err() { - ParseOrderbookStringError::AddressParseError(_) => (), - _ => panic!("Expected AddressParseError"), - } - } } diff --git a/crates/settings/src/parse.rs b/crates/settings/src/parse.rs deleted file mode 100644 index 454914496..000000000 --- a/crates/settings/src/parse.rs +++ /dev/null @@ -1,327 +0,0 @@ -use alloy_primitives::Address; -use serde::{Deserialize, Serialize}; -use strict_yaml_rust::{scanner::ScanError, StrictYaml, StrictYamlLoader}; -use thiserror::Error; -use typeshare::typeshare; -use url::Url; - -#[derive(Error, Debug)] -pub enum AppSettingsParseError { - #[error("Invalid Yaml")] - YamlInvalid(#[from] ScanError), - #[error("chains element missing field: {0}")] - ChainSettingsFieldMissing(String), - #[error("chains element invalid field: {0}")] - ChainSettingsFieldInvalid(String), - #[error("orderbooks element missing field: {0}")] - OrderbookSettingsFieldMissing(String), - #[error("orderbooks element invalid field: {0}")] - OrderbookSettingsFieldInvalid(String), - #[error(transparent)] - AppSettingsBuilder(#[from] AppSettingsBuilderError), - #[error(transparent)] - OrderbookSettingsBuilder(#[from] OrderbookSettingsBuilderError), - #[error(transparent)] - ChainSettingsBuilder(#[from] ChainSettingsBuilderError), -} - -#[typeshare] -#[derive(Serialize, Deserialize, Debug, Clone, Builder)] -pub struct ChainSettings { - label: Option, - #[typeshare(typescript(type = "string"))] - rpc_url: Url, - orderbooks: Vec, -} - -impl TryFrom for ChainSettings { - type Error = AppSettingsParseError; - - fn try_from(val: StrictYaml) -> Result { - let label = val["label"].as_str().map(|s| s.into()); - let rpc_url_str = - val["rpc-url"] - .as_str() - .ok_or(AppSettingsParseError::ChainSettingsFieldMissing( - "rpc-url".into(), - ))?; - let rpc_url = Url::parse(rpc_url_str) - .map_err(|_| AppSettingsParseError::ChainSettingsFieldInvalid("rpc-url".into()))?; - let orderbooks: Vec = val["orderbooks"] - .as_vec() - .unwrap_or(&vec![]) - .iter() - .map(|o| OrderbookSettings::try_from(o.clone())) - .collect::, AppSettingsParseError>>()?; - - Ok(ChainSettingsBuilder::default() - .label(label) - .rpc_url(rpc_url) - .orderbooks(orderbooks) - .build()?) - } -} - -#[typeshare] -#[derive(Serialize, Deserialize, Debug, Clone, Builder)] -pub struct OrderbookSettings { - label: Option, - #[typeshare(typescript(type = "string"))] - address: Address, - #[typeshare(typescript(type = "string"))] - subgraph_url: Url, -} - -impl TryFrom for OrderbookSettings { - type Error = AppSettingsParseError; - - fn try_from(val: StrictYaml) -> Result { - let label = val["label"].as_str().map(|s| s.into()); - let address = val["address"] - .as_str() - .ok_or(AppSettingsParseError::OrderbookSettingsFieldMissing( - "address".into(), - ))? - .parse::
() - .map_err(|_| AppSettingsParseError::OrderbookSettingsFieldInvalid("address".into()))?; - let subgraph_url_str = val["subgraph-url"].as_str().ok_or( - AppSettingsParseError::OrderbookSettingsFieldMissing("subgraph-url".into()), - )?; - let subgraph_url = Url::parse(subgraph_url_str).map_err(|_| { - AppSettingsParseError::OrderbookSettingsFieldInvalid("subgraph-url".into()) - })?; - - Ok(OrderbookSettingsBuilder::default() - .label(label) - .address(address) - .subgraph_url(subgraph_url) - .build()?) - } -} - -/// Parse string of settings yaml into AppSettings -/// Text MUST be strict yaml of the following structure -/// -/// ```yaml -/// chains: -/// - rpc-url: https://eth.llamarpc.com -/// orderbooks: -/// - address: 0x0000000000000000000000000000000000000001 -/// subgraph-url: https://api.thegraph.com/subgraphs/name/myname/mysubgraph1 -/// -/// - label: Polygon Infura -/// rpc-url: https://polygon-mainnet.infura.io/v3/abcd -/// orderbooks: -/// - label: My special orderbook -/// address: 0x0000000000000000000000000000000000000002 -/// subgraph-url: https://api.thegraph.com/subgraphs/name/myname/mysubgraph2 -/// -/// - address: 0x0000000000000000000000000000000000000001 -/// subgraph-url: https://api.thegraph.com/subgraphs/name/myname/mysubgraph3 -/// ``` -#[typeshare] -#[derive(Serialize, Deserialize, Debug, Clone, Builder, Default)] -pub struct AppSettings { - chains: Vec, -} - -impl TryFrom for AppSettings { - type Error = AppSettingsParseError; - - fn try_from(val: String) -> Result { - // Parse strict yaml - let yaml_vec = StrictYamlLoader::load_from_str(val.as_str()) - .map_err(AppSettingsParseError::YamlInvalid)?; - let maybe_yaml = yaml_vec.first(); - - match maybe_yaml { - // Yaml has no contents, return empty settings - None => Ok(AppSettings::default()), - - // Yaml has contents, parse them - Some(yaml) => { - let chains: Vec = yaml["chains"] - .as_vec() - .unwrap_or(&vec![]) - .iter() - .map(|v| v.clone().try_into()) - .collect::, Self::Error>>()?; - - Ok(AppSettingsBuilder::default().chains(chains).build()?) - } - } - } -} - -#[cfg(test)] -mod test { - use super::*; - - #[test] - fn can_create_settings_from_yaml() { - let settings_text: String = " -chains: - - label: Polygon Public Rpc - rpc-url: https://polygon-rpc.com/ - orderbooks: - - label: My special orderbook - address: 0x0000000000000000000000000000000000000001 - subgraph-url: https://api.thegraph.com/subgraphs/name/myname/mysubgraph1 - - - address: 0x0000000000000000000000000000000000000002 - subgraph-url: https://api.thegraph.com/subgraphs/name/myname/mysubgraph2 - - - rpc-url: https://eth-rpc.com - orderbooks: - - address: 0x0000000000000000000000000000000000000003 - subgraph-url: https://api.thegraph.com/subgraphs/name/myname/mysubgraph3 -" - .into(); - - let settings: AppSettings = settings_text.try_into().unwrap(); - - assert_eq!(settings.chains.len(), 2); - assert_eq!(settings.chains[0].label, Some("Polygon Public Rpc".into())); - assert_eq!( - settings.chains[0].rpc_url, - Url::parse("https://polygon-rpc.com/").unwrap() - ); - assert_eq!(settings.chains[0].orderbooks.len(), 2); - assert_eq!( - settings.chains[0].orderbooks[0].label, - Some("My special orderbook".into()) - ); - assert_eq!( - settings.chains[0].orderbooks[0].address, - "0x0000000000000000000000000000000000000001" - .parse::
() - .unwrap() - ); - assert_eq!( - settings.chains[0].orderbooks[0].subgraph_url, - Url::parse("https://api.thegraph.com/subgraphs/name/myname/mysubgraph1").unwrap() - ); - assert_eq!(settings.chains[0].orderbooks[1].label, None); - assert_eq!( - settings.chains[0].orderbooks[1].address, - "0x0000000000000000000000000000000000000002" - .parse::
() - .unwrap() - ); - assert_eq!( - settings.chains[0].orderbooks[1].subgraph_url, - Url::parse("https://api.thegraph.com/subgraphs/name/myname/mysubgraph2").unwrap() - ); - assert_eq!(settings.chains[1].label, None); - assert_eq!( - settings.chains[1].rpc_url, - Url::parse("https://eth-rpc.com").unwrap() - ); - assert_eq!( - settings.chains[1].orderbooks[0].address, - "0x0000000000000000000000000000000000000003" - .parse::
() - .unwrap() - ); - assert_eq!( - settings.chains[1].orderbooks[0].subgraph_url, - Url::parse("https://api.thegraph.com/subgraphs/name/myname/mysubgraph3").unwrap() - ); - } - - #[test] - fn empty_settings() { - let settings_text: String = " -chains: -" - .into(); - - let settings: AppSettings = settings_text.try_into().unwrap(); - assert_eq!(settings.chains.len(), 0); - - let settings_text: String = "".into(); - let settings: AppSettings = settings_text.try_into().unwrap(); - assert_eq!(settings.chains.len(), 0); - } - - #[test] - fn missing_chain_field_rpc_url() { - let settings_text: String = " -chains: - - label: abcd -" - .into(); - let settings: Result = settings_text.try_into(); - assert!(settings.is_err()); - } - - #[test] - fn inavalid_chain_field_rpc_url() { - let settings_text: String = " -chains: - - label: abcd - rpc-url: abcdef -" - .into(); - let settings: Result = settings_text.try_into(); - assert!(settings.is_err()); - } - - #[test] - fn missing_orderbook_field_subgraph_url() { - let settings_text: String = " -chains: - - label: abcd - rpc-url: https://rpc.com - orderbooks: - - address: 0x0000000000000000000000000000000000000003 -" - .into(); - let settings: Result = settings_text.try_into(); - assert!(settings.is_err()); - } - - #[test] - fn missing_orderbook_field_address() { - let settings_text: String = " -chains: - - label: abcd - rpc-url: https://rpc.com - orderbooks: - - subgraph-url: https://mysubgraph.com -" - .into(); - let settings: Result = settings_text.try_into(); - assert!(settings.is_err()); - } - - #[test] - fn invalid_orderbook_field_subgraph_url() { - let settings_text: String = " -chains: - - label: abcd - rpc-url: https://rpc.com - orderbooks: - - address: 0x0000000000000000000000000000000000000003 - subgraph-url: abc -" - .into(); - let settings: Result = settings_text.try_into(); - assert!(settings.is_err()); - } - - #[test] - fn invalid_orderbook_field_address() { - let settings_text: String = " -chains: - - label: abcd - rpc-url: https://rpc.com - orderbooks: - - address: abc - subgraph-url: https://mysubgraph.com -" - .into(); - let settings: Result = settings_text.try_into(); - assert!(settings.is_err()); - } -} diff --git a/crates/settings/src/scenario.rs b/crates/settings/src/scenario.rs index 4776bfc89..b856dc3a2 100644 --- a/crates/settings/src/scenario.rs +++ b/crates/settings/src/scenario.rs @@ -5,11 +5,12 @@ use thiserror::Error; use typeshare::typeshare; #[typeshare] -#[derive(Debug, Serialize, Deserialize, Clone)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[serde(rename_all = "kebab-case")] pub struct Scenario { pub name: String, pub bindings: HashMap, - #[typeshare(skip)] + #[typeshare(typescript(type = "number"))] pub runs: Option, #[typeshare(typescript(type = "Deployer"))] pub deployer: Arc, @@ -90,12 +91,7 @@ impl ScenarioString { let parent_scenario = Arc::new(Scenario { name: name.clone(), bindings: bindings.clone(), - runs: self - .runs - .as_ref() - .map(|s| s.parse::()) - .transpose() - .map_err(ParseScenarioStringError::RunsParseError)?, + runs: self.runs, deployer: deployer_ref.clone(), }); @@ -126,6 +122,8 @@ impl ScenarioString { mod tests { use crate::test::mock_deployer; + use alloy_primitives::Address; + use url::Url; use super::*; use std::collections::HashMap; @@ -137,10 +135,10 @@ mod tests { networks.insert( "mainnet".to_string(), NetworkString { - rpc: "https://mainnet.node".to_string(), - chain_id: "1".to_string(), + rpc: Url::parse("https://mainnet.node").unwrap(), + chain_id: 1, label: Some("Ethereum Mainnet".to_string()), - network_id: Some("1".to_string()), + network_id: Some(1), currency: Some("ETH".to_string()), }, ); @@ -150,7 +148,9 @@ mod tests { deployers.insert( "mainnet".to_string(), DeployerString { - address: "0xabcdef0123456789ABCDEF0123456789ABCDEF01".to_string(), + address: "0xabcdef0123456789ABCDEF0123456789ABCDEF01" + .parse::
() + .unwrap(), network: None, label: Some("Mainnet Deployer".to_string()), }, @@ -162,7 +162,7 @@ mod tests { "nested_scenario2".to_string(), ScenarioString { bindings: HashMap::new(), // Assuming no bindings for simplification - runs: Some("2".to_string()), + runs: Some(2), deployer: None, scenarios: None, // No further nesting }, @@ -173,7 +173,7 @@ mod tests { "nested_scenario1".to_string(), ScenarioString { bindings: HashMap::new(), // Assuming no bindings for simplification - runs: Some("5".to_string()), + runs: Some(5), deployer: None, scenarios: Some(nested_scenario2), // Include nested_scenario2 }, @@ -185,7 +185,7 @@ mod tests { "root_scenario".to_string(), ScenarioString { bindings: HashMap::new(), // Assuming no bindings for simplification - runs: Some("10".to_string()), + runs: Some(10), deployer: Some("mainnet".to_string()), scenarios: Some(nested_scenario1), // Include nested_scenario1 }, diff --git a/crates/settings/src/string_structs.rs b/crates/settings/src/string_structs.rs index 7620040cb..ff2460716 100644 --- a/crates/settings/src/string_structs.rs +++ b/crates/settings/src/string_structs.rs @@ -1,12 +1,17 @@ +use alloy_primitives::{Address, U256}; use serde::{Deserialize, Serialize}; use std::collections::HashMap; +use typeshare::typeshare; +use url::Url; +#[typeshare] #[derive(Debug, Serialize, Deserialize, Clone, Default)] +#[serde(rename_all = "kebab-case")] pub struct ConfigString { #[serde(default)] pub networks: HashMap, #[serde(default)] - pub subgraphs: HashMap, + pub subgraphs: HashMap, #[serde(default)] pub orderbooks: HashMap, #[serde(default)] @@ -23,82 +28,129 @@ pub struct ConfigString { pub deployments: HashMap, } +#[typeshare] +pub type SubgraphRef = String; + +#[typeshare] +pub type ScenarioRef = String; + +#[typeshare] +pub type NetworkRef = String; + +#[typeshare] +pub type DeployerRef = String; + +#[typeshare] +pub type OrderRef = String; + +#[typeshare] +pub type OrderbookRef = String; + +#[typeshare] +pub type TokenRef = String; + +#[typeshare] #[derive(Debug, Serialize, Deserialize, Clone)] +#[serde(rename_all = "kebab-case")] pub struct NetworkString { - pub rpc: String, - pub chain_id: String, + pub rpc: Url, + #[typeshare(typescript(type = "number"))] + pub chain_id: u64, pub label: Option, - pub network_id: Option, + #[typeshare(typescript(type = "number"))] + pub network_id: Option, pub currency: Option, } +#[typeshare] #[derive(Debug, Serialize, Deserialize, Clone)] +#[serde(rename_all = "kebab-case")] pub struct OrderbookString { - pub address: String, - pub network: Option, - pub subgraph: Option, + pub address: Address, + pub network: Option, + pub subgraph: Option, pub label: Option, } +#[typeshare] #[derive(Debug, Serialize, Deserialize, Clone)] +#[serde(rename_all = "kebab-case")] pub struct TokenString { - pub network: String, - pub address: String, - pub decimals: Option, + pub network: NetworkRef, + pub address: Address, + pub decimals: Option, pub label: Option, pub symbol: Option, } +#[typeshare] #[derive(Debug, Serialize, Deserialize, Clone)] +#[serde(rename_all = "kebab-case")] pub struct DeployerString { - pub address: String, - pub network: Option, + pub address: Address, + pub network: Option, pub label: Option, } +#[typeshare] #[derive(Debug, Serialize, Deserialize, Clone)] +#[serde(rename_all = "kebab-case")] pub struct DeploymentString { - pub scenario: String, - pub order: String, + pub scenario: ScenarioRef, + pub order: OrderRef, } +#[typeshare] #[derive(Debug, Serialize, Deserialize, Clone)] +#[serde(rename_all = "kebab-case")] pub struct IOString { - pub token: String, - pub vault_id: String, + pub token: TokenRef, + #[typeshare(typescript(type = "bigint"))] + pub vault_id: U256, } +#[typeshare] #[derive(Debug, Serialize, Deserialize, Clone)] +#[serde(rename_all = "kebab-case")] pub struct OrderString { pub inputs: Vec, pub outputs: Vec, - pub network: String, - pub deployer: Option, - pub orderbook: Option, + pub network: NetworkRef, + pub deployer: Option, + pub orderbook: Option, } +#[typeshare] #[derive(Debug, Serialize, Deserialize, Clone)] +#[serde(rename_all = "kebab-case")] pub struct ScenarioString { #[serde(default)] pub bindings: HashMap, - pub runs: Option, - pub deployer: Option, + #[typeshare(typescript(type = "number"))] + pub runs: Option, + pub deployer: Option, pub scenarios: Option>, } +#[typeshare] #[derive(Debug, Serialize, Deserialize, Clone)] +#[serde(rename_all = "kebab-case")] pub struct ChartString { - pub scenario: Option, + pub scenario: Option, pub plots: HashMap, } +#[typeshare] #[derive(Debug, Serialize, Deserialize, Clone)] +#[serde(rename_all = "kebab-case")] pub struct PlotString { pub data: DataPointsString, pub plot_type: String, } +#[typeshare] #[derive(Debug, Serialize, Deserialize, Clone)] +#[serde(rename_all = "kebab-case")] pub struct DataPointsString { pub x: String, pub y: String, @@ -111,13 +163,6 @@ impl TryFrom for ConfigString { } } -impl TryFrom<&str> for ConfigString { - type Error = serde_yaml::Error; - fn try_from(val: &str) -> Result { - serde_yaml::from_str(val) - } -} - #[cfg(test)] mod tests { use super::*; @@ -128,15 +173,15 @@ mod tests { networks: mainnet: rpc: https://mainnet.node - chain_id: 1 + chain-id: 1 label: Mainnet - network_id: 1 + network-id: 1 currency: ETH testnet: rpc: https://testnet.node - chain_id: 2 + chain-id: 2 label: Testnet - network_id: 2 + network-id: 2 currency: ETH subgraphs: @@ -145,12 +190,12 @@ subgraphs: orderbooks: mainnetOrderbook: - address: 0x123 + address: 0xabc0000000000000000000000000000000000001 network: mainnet subgraph: mainnet label: Mainnet Orderbook testnetOrderbook: - address: 0x456 + address: 0xabc0000000000000000000000000000000000002 network: testnet subgraph: testnet label: Testnet Orderbook @@ -158,24 +203,24 @@ orderbooks: tokens: eth: network: mainnet - address: 0xdef + address: 0xabc0000000000000000000000000000000000003 decimals: 18 label: Ethereum symbol: ETH dai: network: mainnet - address: 0xghi + address: 0xabc0000000000000000000000000000000000004 decimals: 18 label: Dai symbol: DAI deployers: mainDeployer: - address: 0xjkl + address: 0xabc0000000000000000000000000000000000005 network: mainnet label: Main Deployer testDeployer: - address: 0xmnop + address: 0xabc0000000000000000000000000000000000006 network: testnet label: Test Deployer @@ -183,12 +228,12 @@ orders: buyETH: inputs: - token: eth - vault_id: 2 + vault-id: 2 - token: dai - vault_id: 0x1 + vault-id: 0x1 outputs: - token: dai - vault_id: 3 + vault-id: 3 network: mainnet deployer: mainDeployer orderbook: mainnetOrderbook @@ -216,26 +261,27 @@ charts: data: x: dataX y: dataY - plot_type: line + plot-type: line plot2: data: x: dataX2 y: dataY2 - plot_type: bar + plot-type: bar deployments: first-deployment: scenario: mainScenario - order: bytETH + order: sellETH second-deployment: scenario: mainScenario - order: buyETH"#; + order: buyETH"# + .to_string(); let config: ConfigString = yaml_data.try_into().unwrap(); // Asserting a few values to verify successful parsing assert_eq!( config.clone().networks.get("mainnet").unwrap().rpc, - "https://mainnet.node".to_string() + Url::parse("https://mainnet.node").unwrap() ); assert_eq!( config.networks.get("mainnet").unwrap().label, @@ -243,15 +289,14 @@ deployments: ); assert_eq!( config.subgraphs.get("mainnet"), - Some(&"https://mainnet.subgraph".to_string()) + Some(&Url::parse("https://mainnet.subgraph").unwrap()) ); assert_eq!( config.orderbooks.get("mainnetOrderbook").unwrap().address, - "0x123".to_string() - ); - assert_eq!( - config.tokens.get("eth").unwrap().decimals, - Some("18".to_string()) + "0xabc0000000000000000000000000000000000001" + .parse::
() + .unwrap() ); + assert_eq!(config.tokens.get("eth").unwrap().decimals, Some(18)); } } diff --git a/crates/settings/src/token.rs b/crates/settings/src/token.rs index 6f0decb30..6a56dabbb 100644 --- a/crates/settings/src/token.rs +++ b/crates/settings/src/token.rs @@ -6,7 +6,8 @@ use thiserror::Error; use typeshare::typeshare; #[typeshare] -#[derive(Debug, PartialEq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +#[serde(rename_all = "kebab-case")] pub struct Token { #[typeshare(typescript(type = "Network"))] pub network: Arc, @@ -41,18 +42,8 @@ impl TokenString { Ok(Token { network: network_ref, - address: self - .address - .parse() - .map_err(ParseTokenStringError::AddressParseError)?, - decimals: self - .decimals - .map(|decimals| { - decimals - .parse() - .map_err(ParseTokenStringError::DecimalsParseError) - }) - .transpose()?, + address: self.address, + decimals: self.decimals, label: self.label, symbol: self.symbol, }) @@ -77,8 +68,8 @@ mod token_tests { let networks = setup_networks(); let token_string = TokenString { network: "TestNetwork".to_string(), - address: Address::repeat_byte(0x01).to_string(), - decimals: Some("18".to_string()), + address: Address::repeat_byte(0x01), + decimals: Some(18), label: Some("TestToken".to_string()), symbol: Some("TTK".to_string()), }; @@ -103,7 +94,7 @@ mod token_tests { let networks = setup_networks(); let token_string = TokenString { network: "TestNetwork".to_string(), - address: Address::repeat_byte(0x01).to_string(), + address: Address::repeat_byte(0x01), decimals: None, label: None, symbol: None, @@ -129,7 +120,7 @@ mod token_tests { let networks = setup_networks(); let token_string = TokenString { network: "InvalidNetwork".to_string(), - address: "0x1234".to_string(), + address: Address::repeat_byte(0x01), decimals: None, label: None, symbol: None, @@ -143,44 +134,4 @@ mod token_tests { ParseTokenStringError::NetworkNotFoundError("InvalidNetwork".to_string()) ); } - - #[test] - fn test_token_creation_failure_due_to_invalid_address() { - let networks = setup_networks(); - let token_string = TokenString { - network: "TestNetwork".to_string(), - address: "invalid".to_string(), - decimals: None, - label: None, - symbol: None, - }; - - let token = token_string.try_into_token(&networks); - - assert!(token.is_err()); - match token.unwrap_err() { - ParseTokenStringError::AddressParseError(_) => (), - _ => panic!("Expected AddressParseError"), - } - } - - #[test] - fn test_token_creation_failure_due_to_invalid_decimals() { - let networks = setup_networks(); - let token_string = TokenString { - network: "TestNetwork".to_string(), - address: Address::repeat_byte(0x03).to_string(), - decimals: Some("invalid".to_string()), - label: None, - symbol: None, - }; - - let token = token_string.try_into_token(&networks); - - assert!(token.is_err()); - match token.unwrap_err() { - ParseTokenStringError::DecimalsParseError(_) => (), - _ => panic!("Expected DecimalsParseError"), - } - } } diff --git a/flake.nix b/flake.nix index b50131e4a..0710aa052 100644 --- a/flake.nix +++ b/flake.nix @@ -21,7 +21,12 @@ set -euxo pipefail # Generate Typescript types from rust types - mkdir -p tauri-app/src/lib/typeshare; + mkdir -p tauri-app/src/lib/typeshare + + mkdir /tmp/cargo + export CARGO_HOME=/tmp/cargo/ + cargo install --git https://github.com/1Password/typeshare --rev 556b44aafd5304eedf17206800f69834e3820b7c + export PATH=$PATH:$CARGO_HOME/bin typeshare crates/subgraph/src/types/vault_balance_changes_list.rs crates/subgraph/src/types/vault_balance_change.rs --lang=typescript --output-file=tauri-app/src/lib/typeshare/vaultBalanceChangesList.ts; typeshare crates/subgraph/src/types/order_detail.rs crates/common/src/types/order_detail_extended.rs --lang=typescript --output-file=tauri-app/src/lib/typeshare/orderDetail.ts; @@ -35,18 +40,16 @@ typeshare crates/common/src/fuzz/mod.rs --lang=typescript --output-file=tauri-app/src/lib/typeshare/fuzz.ts; typeshare crates/settings/src/parse.rs --lang=typescript --output-file=tauri-app/src/lib/typeshare/appSettings.ts; - typeshare crates/settings/src/config.rs crates/settings/src/chart.rs crates/settings/src/deployer.rs crates/settings/src/deployment.rs crates/settings/src/network.rs crates/settings/src/order.rs crates/settings/src/orderbook.rs crates/settings/src/scenario.rs crates/settings/src/token.rs --lang=typescript --output-file=tauri-app/src/lib/typeshare/config.ts; + typeshare crates/settings/src/config.rs crates/settings/src/chart.rs crates/settings/src/deployer.rs crates/settings/src/network.rs crates/settings/src/order.rs crates/settings/src/orderbook.rs crates/settings/src/scenario.rs crates/settings/src/token.rs crates/settings/src/deployment.rs --lang=typescript --output-file=tauri-app/src/lib/typeshare/config.ts; + typeshare crates/settings/src/string_structs.rs --lang=typescript --output-file=tauri-app/src/lib/typeshare/configString.ts; typeshare tauri-app/src-tauri/src/toast.rs --lang=typescript --output-file=tauri-app/src/lib/typeshare/toast.ts; typeshare tauri-app/src-tauri/src/transaction_status.rs --lang=typescript --output-file=tauri-app/src/lib/typeshare/transactionStatus.ts; - node tauri-app/src/scripts/typeshareFix.cjs - # Fix linting of generated types cd tauri-app && npm i && npm run lint ''; additionalBuildInputs = [ - pkgs.typeshare pkgs.wasm-bindgen-cli rainix.rust-toolchain.${system} rainix.rust-build-inputs.${system} diff --git a/tauri-app/.eslintrc.cjs b/tauri-app/.eslintrc.cjs index dd5816746..b805d8ba8 100644 --- a/tauri-app/.eslintrc.cjs +++ b/tauri-app/.eslintrc.cjs @@ -29,7 +29,7 @@ module.exports = { } ], rules: { - // 'no-console': 'error', + 'no-console': 'error', 'no-trailing-spaces': 'error' } }; diff --git a/tauri-app/src-tauri/Cargo.lock b/tauri-app/src-tauri/Cargo.lock index 7e3093426..e846f637d 100644 --- a/tauri-app/src-tauri/Cargo.lock +++ b/tauri-app/src-tauri/Cargo.lock @@ -45,9 +45,9 @@ dependencies = [ [[package]] name = "aes" -version = "0.8.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" dependencies = [ "cfg-if", "cipher", @@ -70,9 +70,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.7.8" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" dependencies = [ "getrandom 0.2.12", "once_cell", @@ -81,9 +81,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.11" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ "cfg-if", "getrandom 0.2.12", @@ -131,13 +131,13 @@ checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "alloy-chains" -version = "0.1.15" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96c81b05c893348760f232c4cc6a6a77fd91cfb09885d4eaad25cd03bd7732e" +checksum = "206e825321d0ed5b6e3907e6ddf70c2139cfdc6274e83a1ca2f4784bd0abc0c9" dependencies = [ "num_enum 0.7.2", "serde", - "strum 0.26.1", + "strum 0.25.0", ] [[package]] @@ -349,7 +349,7 @@ checksum = "1a047897373be4bbb0224c1afdabca92648dc57a9c9ef6e7b0be3aff7a859c83" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -420,11 +420,11 @@ dependencies = [ "const-hex", "dunce", "heck 0.4.1", - "indexmap 2.2.5", + "indexmap 2.2.1", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", "syn-solidity 0.5.4", "tiny-keccak", ] @@ -439,12 +439,12 @@ dependencies = [ "const-hex", "dunce", "heck 0.4.1", - "indexmap 2.2.5", + "indexmap 2.2.1", "proc-macro-error", "proc-macro2", "quote", "serde_json", - "syn 2.0.52", + "syn 2.0.48", "syn-solidity 0.6.4", "tiny-keccak", ] @@ -455,7 +455,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c82c1ed2d61e982cef4c4d709f4aeef5f39a6a6a7c59b6e54c9ed4f3f7e3741b" dependencies = [ - "winnow 0.5.40", + "winnow 0.5.35", ] [[package]] @@ -573,9 +573,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" dependencies = [ "anstyle", "anstyle-parse", @@ -587,9 +587,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "2faccea4cc4ab4a667ce676a30e8ec13922a692c99bb8f5b11f1502c72e04220" [[package]] name = "anstyle-parse" @@ -621,9 +621,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.80" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "ar" @@ -784,13 +784,13 @@ dependencies = [ [[package]] name = "async-channel" -version = "2.2.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" +checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" dependencies = [ "concurrent-queue", - "event-listener 5.2.0", - "event-listener-strategy 0.5.0", + "event-listener", + "event-listener-strategy", "futures-core", "pin-project-lite", ] @@ -801,8 +801,8 @@ version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ - "event-listener 4.0.3", - "event-listener-strategy 0.4.0", + "event-listener", + "event-listener-strategy", "pin-project-lite", ] @@ -814,7 +814,7 @@ checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -831,7 +831,7 @@ checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -902,7 +902,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -1149,9 +1149,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.9.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" +checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" dependencies = [ "memchr", "serde", @@ -1165,9 +1165,9 @@ checksum = "b4ae4235e6dac0694637c763029ecea1a2ec9e4e06ec2729bd21ba4d9c863eb7" [[package]] name = "bumpalo" -version = "3.15.4" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byte-slice-cast" @@ -1177,9 +1177,9 @@ checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] name = "bytecheck" -version = "0.6.12" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" +checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" dependencies = [ "bytecheck_derive", "ptr_meta", @@ -1188,9 +1188,9 @@ dependencies = [ [[package]] name = "bytecheck_derive" -version = "0.6.12" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" +checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" dependencies = [ "proc-macro2", "quote", @@ -1205,9 +1205,9 @@ checksum = "e1e5f035d16fc623ae5f74981db80a439803888314e3a555fd6f04acd51a3205" [[package]] name = "bytemuck" -version = "1.14.3" +version = "1.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ef034f05691a48569bd920a96c81b9d91bbad1ab5ac7c4616c1f6ef36cb79f" +checksum = "ed2490600f404f2b94c167e31d3ed1d5f3c225a0f3b80230053b3e0b7b962bd9" [[package]] name = "byteorder" @@ -1294,9 +1294,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.7" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" +checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" dependencies = [ "serde", ] @@ -1309,7 +1309,7 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.22", + "semver 1.0.21", "serde", "serde_json", "thiserror", @@ -1327,9 +1327,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.90" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", "libc", @@ -1363,9 +1363,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.15.7" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa50868b64a9a6fda9d593ce778849ea8715cd2a3d2cc17ffdb4a2f2f2f1961d" +checksum = "6100bc57b6209840798d95cb2775684849d332f7bd788db2a8c8caf7ef82a41a" dependencies = [ "smallvec", "target-lexicon", @@ -1379,9 +1379,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.35" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" +checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" dependencies = [ "android-tzdata", "iana-time-zone", @@ -1389,7 +1389,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.4", + "windows-targets 0.52.0", ] [[package]] @@ -1404,9 +1404,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.2" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b230ab84b0ffdf890d5a10abdbc8b83ae1c4918275daea1ab8801f71536b2651" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ "clap_builder", "clap_derive", @@ -1414,14 +1414,14 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.0", + "strsim", "terminal_size", "unicase", "unicode-width", @@ -1429,30 +1429,30 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.1" +version = "4.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "885e4d7d5af40bfb99ae6f9433e292feac98d452dcb3ec3d25dfe7552b77da8c" +checksum = "df631ae429f6613fcd3a7c1adbdb65f637271e561b03680adaa6573015dfb106" dependencies = [ "clap", ] [[package]] name = "clap_derive" -version = "4.5.0" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "cocoa" @@ -1646,9 +1646,9 @@ dependencies = [ [[package]] name = "const-hex" -version = "1.11.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbd12d49ab0eaf8193ba9175e45f56bbc2e4b27d57b8cfe62aa47942a46b9a9" +checksum = "a5104de16b218eddf8e34ffe2f86f74bfa4e61e95a1b89732fccf6325efd0557" dependencies = [ "cfg-if", "cpufeatures", @@ -1715,6 +1715,15 @@ dependencies = [ "libc", ] +[[package]] +name = "core2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" +dependencies = [ + "memchr", +] + [[package]] name = "counter" version = "0.5.7" @@ -1735,18 +1744,18 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-channel" -version = "0.5.12" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" +checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" dependencies = [ "crossbeam-utils", ] @@ -1861,7 +1870,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -1887,12 +1896,12 @@ dependencies = [ [[package]] name = "ctor" -version = "0.2.7" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad291aa74992b9b7a7e88c38acbbf6ad7e107f1d90ee8775b7bc1fc3394f485c" +checksum = "30d2b3721e861707777e3195b0158f950ae6dc4a27e4d02ff9f67e3eb3de199e" dependencies = [ "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -1934,15 +1943,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a11d6119f9f0f55c9d7cff5189a7b318f35a7d2d6faa4872441ee521f65420b6" dependencies = [ "counter", - "darling 0.20.8", + "darling 0.20.6", "graphql-parser", "once_cell", "ouroboros", "proc-macro2", "quote", "rkyv", - "strsim 0.10.0", - "syn 2.0.52", + "strsim", + "syn 2.0.48", "thiserror", ] @@ -1953,9 +1962,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb81a5872a7774daf11caefb2ebe7166d9da12b1b69cf35661130b3c3fccbd61" dependencies = [ "cynic-codegen", - "darling 0.20.8", + "darling 0.20.6", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -1970,12 +1979,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.8" +version = "0.20.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" +checksum = "c376d08ea6aa96aafe61237c7200d1241cb177b7d3a542d791f2d118e9cbb955" dependencies = [ - "darling_core 0.20.8", - "darling_macro 0.20.8", + "darling_core 0.20.6", + "darling_macro 0.20.6", ] [[package]] @@ -1988,22 +1997,22 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.10.0", + "strsim", "syn 1.0.109", ] [[package]] name = "darling_core" -version = "0.20.8" +version = "0.20.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" +checksum = "33043dcd19068b8192064c704b3f83eb464f91f1ff527b44a4e2b08d9cdb8855" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim 0.10.0", - "syn 2.0.52", + "strsim", + "syn 2.0.48", ] [[package]] @@ -2019,15 +2028,21 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.8" +version = "0.20.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +checksum = "c5a91391accf613803c2a9bf9abccdbaa07c54b4244a5b64883f9c3c137c86be" dependencies = [ - "darling_core 0.20.8", + "darling_core 0.20.6", "quote", - "syn 2.0.52", + "syn 2.0.48", ] +[[package]] +name = "dary_heap" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7762d17f1241643615821a8455a0b2c3e803784b058693d990b11f2dce25a0ca" + [[package]] name = "data-encoding" version = "2.5.0" @@ -2083,7 +2098,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -2122,10 +2137,10 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d48cda787f839151732d396ac69e3473923d54312c070ee21e9effcaa8ca0b1d" dependencies = [ - "darling 0.20.8", + "darling 0.20.6", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -2145,7 +2160,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" dependencies = [ "derive_builder_core 0.20.0", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -2174,6 +2189,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + [[package]] name = "digest" version = "0.9.0" @@ -2243,27 +2264,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" -[[package]] -name = "dotrain" -version = "6.0.1-alpha.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08708f5a322925647d011431a93bc015cccfaa42b267d6ce1167f77a7dd44952" -dependencies = [ - "alloy-primitives 0.5.4", - "anyhow", - "async-recursion", - "futures", - "getrandom 0.2.12", - "magic_string", - "once_cell", - "rain-metadata 0.0.2-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)", - "regex", - "serde", - "serde_bytes", - "serde_json", - "serde_repr", -] - [[package]] name = "dotrain" version = "6.0.1-alpha.10" @@ -2291,7 +2291,7 @@ source = "git+https://github.com/rainlanguage/dotrain?rev=b813542cb1c9a2399664a6 dependencies = [ "alloy-primitives 0.6.4", "anyhow", - "dotrain 6.0.1-alpha.10 (git+https://github.com/rainlanguage/dotrain?rev=b813542cb1c9a2399664a606761f3a3db7b842af)", + "dotrain", "lsp-types", "once_cell", "regex", @@ -2320,9 +2320,9 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "dyn-clone" -version = "1.0.17" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" [[package]] name = "ecdsa" @@ -2340,9 +2340,9 @@ dependencies = [ [[package]] name = "either" -version = "1.10.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "elliptic-curve" @@ -2366,16 +2366,16 @@ dependencies = [ [[package]] name = "embed-resource" -version = "2.4.2" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6985554d0688b687c5cb73898a34fbe3ad6c24c58c238a4d91d5e840670ee9d" +checksum = "3bde55e389bea6a966bd467ad1ad7da0ae14546a5bc794d16d1e55e7fca44881" dependencies = [ "cc", "memchr", "rustc_version 0.4.0", - "toml 0.8.10", + "toml 0.8.8", "vswhom", - "winreg 0.52.0", + "winreg 0.51.0", ] [[package]] @@ -2410,17 +2410,17 @@ dependencies = [ [[package]] name = "enr" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a3d8dc56e02f954cac8eb489772c552c473346fc34f67412bb6244fd647f7e4" +checksum = "2dc3eabaca59dc39ea5ed15062e4abc5bba9723b1cff7a4fea3faae0647f04c0" dependencies = [ + "alloy-rlp", "base64 0.21.7", "bytes", "hex", "k256", "log", "rand 0.8.5", - "rlp", "serde", "sha3", "zeroize", @@ -2434,7 +2434,7 @@ checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -2458,9 +2458,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "erased-serde" -version = "0.4.3" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388979d208a049ffdfb22fa33b9c81942215b940910bccfe258caeb25d125cb3" +checksum = "55d05712b2d8d88102bc9868020c9e5c7a1f5527c452b9b97450a1d006140ba7" dependencies = [ "serde", ] @@ -2622,8 +2622,8 @@ dependencies = [ "reqwest", "serde", "serde_json", - "syn 2.0.52", - "toml 0.8.10", + "syn 2.0.48", + "toml 0.8.8", "walkdir", ] @@ -2640,7 +2640,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -2665,8 +2665,8 @@ dependencies = [ "rlp", "serde", "serde_json", - "strum 0.26.1", - "syn 2.0.52", + "strum 0.26.2", + "syn 2.0.48", "tempfile", "thiserror", "tiny-keccak", @@ -2682,7 +2682,7 @@ dependencies = [ "chrono", "ethers-core", "reqwest", - "semver 1.0.22", + "semver 1.0.21", "serde", "serde_json", "thiserror", @@ -2775,7 +2775,7 @@ dependencies = [ "rand 0.8.5", "rusoto_core", "rusoto_kms", - "semver 1.0.22", + "semver 1.0.21", "sha2 0.10.8", "spki", "thiserror", @@ -2802,7 +2802,7 @@ dependencies = [ "path-slash", "rayon", "regex", - "semver 1.0.22", + "semver 1.0.21", "serde", "serde_json", "solang-parser", @@ -2826,46 +2826,25 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "event-listener" -version = "5.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b5fb89194fa3cad959b833185b3063ba881dbfc7030680b314250779fb4cc91" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - [[package]] name = "event-listener-strategy" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" dependencies = [ - "event-listener 4.0.3", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291" -dependencies = [ - "event-listener 5.2.0", + "event-listener", "pin-project-lite", ] [[package]] name = "exr" -version = "1.72.0" +version = "1.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "887d93f60543e9a9362ef8a21beedd0a833c5d9610e18c67abe15a5963dcb1a4" +checksum = "832a761f35ab3e6664babfbdc6cef35a4860e816ec3916dcfd0882954e98a8a8" dependencies = [ "bit_field", "flume", - "half 2.4.0", + "half 2.2.1", "lebe", "miniz_oxide", "rayon-core", @@ -2875,9 +2854,9 @@ dependencies = [ [[package]] name = "eyre" -version = "0.6.12" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" +checksum = "b6267a1fa6f59179ea4afc8e50fd8612a3cc60bc858f786ff877a4a8cb042799" dependencies = [ "indenter", "once_cell", @@ -2948,7 +2927,7 @@ dependencies = [ "atomic", "pear", "serde", - "toml 0.8.10", + "toml 0.8.8", "uncased", "version_check", ] @@ -3044,7 +3023,7 @@ dependencies = [ "alloy-primitives 0.6.4", "foundry-compilers", "reqwest", - "semver 1.0.22", + "semver 1.0.21", "serde", "serde_json", "thiserror", @@ -3081,7 +3060,7 @@ dependencies = [ "revm", "serde_json", "thiserror", - "toml 0.8.10", + "toml 0.8.8", "tracing", "walkdir", ] @@ -3133,7 +3112,7 @@ dependencies = [ "once_cell", "rand 0.8.5", "reqwest", - "semver 1.0.22", + "semver 1.0.21", "serde", "serde_json", "tempfile", @@ -3165,7 +3144,7 @@ dependencies = [ "path-slash", "rayon", "regex", - "semver 1.0.22", + "semver 1.0.21", "serde", "serde_json", "sha2 0.10.8", @@ -3200,13 +3179,13 @@ dependencies = [ "regex", "reqwest", "revm-primitives", - "semver 1.0.22", + "semver 1.0.21", "serde", "serde_json", "serde_regex", "thiserror", - "toml 0.8.10", - "toml_edit 0.21.1", + "toml 0.8.8", + "toml_edit 0.21.0", "tracing", "walkdir", ] @@ -3289,7 +3268,7 @@ dependencies = [ "foundry-compilers", "foundry-evm-core", "revm", - "semver 1.0.22", + "semver 1.0.21", "tracing", ] @@ -3355,7 +3334,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -3504,7 +3483,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -3521,9 +3500,9 @@ checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" -version = "3.0.3" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" dependencies = [ "gloo-timers", "send_wrapper 0.4.0", @@ -3692,9 +3671,9 @@ dependencies = [ [[package]] name = "ghash" -version = "0.5.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" +checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" dependencies = [ "opaque-debug", "polyval", @@ -3702,9 +3681,9 @@ dependencies = [ [[package]] name = "gif" -version = "0.13.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb2d69b19215e18bb912fa30f7ce15846e301408695e44e0ef719f1da9e19f2" +checksum = "80792593675e051cf94a4b111980da2ba60d4a83e43e0048c5693baab3977045" dependencies = [ "color_quant", "weezl", @@ -3806,7 +3785,7 @@ dependencies = [ "aho-corasick", "bstr", "log", - "regex-automata 0.4.6", + "regex-automata 0.4.5", "regex-syntax 0.8.2", ] @@ -3969,7 +3948,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.2.5", + "indexmap 2.2.1", "slab", "tokio", "tokio-util", @@ -3978,17 +3957,16 @@ dependencies = [ [[package]] name = "half" -version = "1.8.3" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "half" -version = "2.4.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5eceaaeec696539ddaf7b333340f1af35a5aa87ae3e4f3ead0532f72affab2e" +checksum = "02b4af3693f1b705df946e9fe5631932443781d0aabb423b62fcd4d73f6d2fd0" dependencies = [ - "cfg-if", "crunchy", ] @@ -4012,7 +3990,16 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.8", + "ahash 0.7.7", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.7", ] [[package]] @@ -4021,7 +4008,7 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash 0.8.11", + "ahash 0.8.7", "allocator-api2", "serde", ] @@ -4055,9 +4042,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.9" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" [[package]] name = "hex" @@ -4130,9 +4117,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.12" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -4242,9 +4229,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -4315,7 +4302,7 @@ dependencies = [ "globset", "log", "memchr", - "regex-automata 0.4.6", + "regex-automata 0.4.5", "same-file", "walkdir", "winapi-util", @@ -4323,9 +4310,9 @@ dependencies = [ [[package]] name = "image" -version = "0.24.9" +version = "0.24.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" +checksum = "034bbe799d1909622a74d1193aa50147769440040ff36cb2baa947609b0a4e23" dependencies = [ "bytemuck", "byteorder", @@ -4415,9 +4402,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.5" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" +checksum = "433de089bd45971eecf4668ee0ee8f4cec17db4f8bd8f7bc3197a6ce37aa7d9b" dependencies = [ "equivalent", "hashbrown 0.14.3", @@ -4521,12 +4508,12 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" -version = "0.4.12" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ "hermit-abi", - "libc", + "rustix", "windows-sys 0.52.0", ] @@ -4623,9 +4610,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "jobserver" -version = "0.1.28" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" dependencies = [ "libc", ] @@ -4641,9 +4628,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] @@ -4688,7 +4675,7 @@ version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a071f4f7efc9a9118dfb627a0a94ef247986e1ab8606a4c806ae2b3aa3b6978" dependencies = [ - "ahash 0.8.11", + "ahash 0.8.7", "anyhow", "base64 0.21.7", "bytecount", @@ -4794,33 +4781,31 @@ dependencies = [ [[package]] name = "lalrpop" -version = "0.20.2" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca" +checksum = "da4081d44f4611b66c6dd725e6de3169f9f63905421e8626fcb86b6a898998b8" dependencies = [ "ascii-canvas", "bit-set", + "diff", "ena", - "itertools 0.11.0", + "is-terminal", + "itertools 0.10.5", "lalrpop-util", "petgraph", "regex", - "regex-syntax 0.8.2", + "regex-syntax 0.7.5", "string_cache", "term", "tiny-keccak", "unicode-xid", - "walkdir", ] [[package]] name = "lalrpop-util" -version = "0.20.2" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" -dependencies = [ - "regex-automata 0.4.6", -] +checksum = "3f35c735096c0293d313e8f2a641627472b83d01b937177fe76e5e2708d31e0d" [[package]] name = "lazy_static" @@ -4839,9 +4824,33 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" + +[[package]] +name = "libflate" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7d5654ae1795afc7ff76f4365c2c8791b0feb18e8996a96adad8ffd7c3b2bf" +dependencies = [ + "adler32", + "core2", + "crc32fast", + "dary_heap", + "libflate_lz77", +] + +[[package]] +name = "libflate_lz77" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be5f52fb8c451576ec6b79d3f4deb327398bc05bbdbd99021a6e77a4c855d524" +dependencies = [ + "core2", + "hashbrown 0.13.2", + "rle-decode-fast", +] [[package]] name = "libm" @@ -5088,9 +5097,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", "simd-adler32", @@ -5098,9 +5107,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.11" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "log", @@ -5273,33 +5282,28 @@ checksum = "63335b2e2c34fae2fb0aa2cecfd9f0832a1e24b3b32ecec612c3426d46dc8aaa" [[package]] name = "num-complex" -version = "0.4.5" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" +checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" dependencies = [ "num-traits", ] -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - [[package]] name = "num-integer" -version = "0.1.46" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ + "autocfg", "num-traits", ] [[package]] name = "num-iter" -version = "0.1.44" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" dependencies = [ "autocfg", "num-integer", @@ -5320,9 +5324,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", "libm", @@ -5377,7 +5381,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -5442,9 +5446,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "open" @@ -5483,9 +5487,9 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.64" +version = "0.10.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" dependencies = [ "bitflags 2.4.2", "cfg-if", @@ -5504,7 +5508,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -5515,9 +5519,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.101" +version = "0.9.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dda2b0f344e78efc2facf7d195d098df0dd72151b26ab98da807afc26c198dff" +checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" dependencies = [ "cc", "libc", @@ -5583,7 +5587,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -5743,7 +5747,7 @@ checksum = "4ccca0f6c17acc81df8e242ed473ec144cbf5c98037e69aa6d144780aad103c8" dependencies = [ "inlinable_string", "pear_codegen", - "yansi 1.0.0", + "yansi 1.0.0-rc.1", ] [[package]] @@ -5755,7 +5759,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -5784,9 +5788,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.8" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f8023d0fb78c8e03784ea1c7f3fa36e68a723138990b8d5a47d916b651e7a8" +checksum = "1f200d8d83c44a45b21764d1916299752ca035d15ecd46faca3e9a2a2bf6ad06" dependencies = [ "memchr", "thiserror", @@ -5795,9 +5799,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.8" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0d24f72393fd16ab6ac5738bc33cdb6a9aa73f8b902e8fe29cf4e67d7dd1026" +checksum = "bcd6ab1236bbdb3a49027e920e693192ebfe8913f6d60e294de57463a493cfde" dependencies = [ "pest", "pest_generator", @@ -5805,22 +5809,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.8" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc17e2a6c7d0a492f0158d7a4bd66cc17280308bbaff78d5bef566dca35ab80" +checksum = "2a31940305ffc96863a735bef7c7994a00b325a7138fdbc5bda0f1a0476d3275" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] name = "pest_meta" -version = "2.7.8" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "934cd7631c050f4674352a6e835d5f6711ffbfb9345c2fc0107155ac495ae293" +checksum = "a7ff62f5259e53b78d1af898941cdcdccfae7385cf7d793a6e55de5d05bb4b7d" dependencies = [ "once_cell", "pest", @@ -5834,7 +5838,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.2.5", + "indexmap 2.2.1", ] [[package]] @@ -5951,7 +5955,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -5983,22 +5987,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -6036,9 +6040,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" [[package]] name = "plist" @@ -6047,7 +6051,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5699cc8a63d1aa2b1ee8e12b9ad70ac790d65788cd36101fa37f87ea46c4cef" dependencies = [ "base64 0.21.7", - "indexmap 2.2.5", + "indexmap 2.2.1", "line-wrap", "quick-xml", "serde", @@ -6056,9 +6060,9 @@ dependencies = [ [[package]] name = "png" -version = "0.17.13" +version = "0.17.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" +checksum = "1f6c3c3e617595665b8ea2ff95a86066be38fb121ff920a9c0eb282abcd1da5a" dependencies = [ "bitflags 1.3.2", "crc32fast", @@ -6069,9 +6073,9 @@ dependencies = [ [[package]] name = "polyval" -version = "0.6.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" +checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" dependencies = [ "cfg-if", "cpufeatures", @@ -6104,7 +6108,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" dependencies = [ "proc-macro2", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -6155,7 +6159,7 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "toml_edit 0.21.1", + "toml_edit 0.21.0", ] [[package]] @@ -6205,9 +6209,9 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", "version_check", - "yansi 1.0.0", + "yansi 1.0.0-rc.1", ] [[package]] @@ -6449,7 +6453,7 @@ dependencies = [ "serde_yaml", "strict-yaml-rust", "thiserror", - "typeshare", + "typeshare 1.0.1 (git+https://github.com/1password/typeshare?rev=556b44aafd5304eedf17206800f69834e3820b7c)", "url", ] @@ -6459,6 +6463,7 @@ version = "0.1.0" dependencies = [ "alloy-primitives 0.6.4", "alloy-sol-types 0.6.4", + "serde", ] [[package]] @@ -6472,7 +6477,7 @@ dependencies = [ "alloy-sol-types 0.6.4", "chrono", "csv", - "dotrain 6.0.1-alpha.10 (git+https://github.com/rainlanguage/dotrain?rev=b813542cb1c9a2399664a606761f3a3db7b842af)", + "dotrain", "dotrain-lsp", "futures", "once_cell", @@ -6494,7 +6499,7 @@ dependencies = [ "thiserror", "tokio", "tracing", - "typeshare", + "typeshare 1.0.1 (git+https://github.com/1password/typeshare?rev=556b44aafd5304eedf17206800f69834e3820b7c)", "url", ] @@ -6510,7 +6515,7 @@ dependencies = [ "reqwest", "serde", "thiserror", - "typeshare", + "typeshare 1.0.1 (git+https://github.com/1password/typeshare?rev=556b44aafd5304eedf17206800f69834e3820b7c)", ] [[package]] @@ -6611,9 +6616,9 @@ checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" [[package]] name = "rayon" -version = "1.9.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" dependencies = [ "either", "rayon-core", @@ -6666,7 +6671,7 @@ checksum = "5fddb4f8d99b0a2ebafc65a87a69a7b9875e4b1ae1f00db265d300ef7f28bccc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -6677,7 +6682,7 @@ checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", + "regex-automata 0.4.5", "regex-syntax 0.8.2", ] @@ -6692,9 +6697,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -6707,6 +6712,12 @@ version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +[[package]] +name = "regex-syntax" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + [[package]] name = "regex-syntax" version = "0.8.2" @@ -6715,18 +6726,18 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rend" -version = "0.4.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" +checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" dependencies = [ "bytecheck", ] [[package]] name = "reqwest" -version = "0.11.25" +version = "0.11.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eea5a9eb898d3783f17c6407670e3592fd174cb81a10e51d4c37f49450b9946" +checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ "base64 0.21.7", "bytes", @@ -6752,7 +6763,6 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", "system-configuration", "tokio", "tokio-native-tls", @@ -6891,17 +6901,16 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.8" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", - "cfg-if", "getrandom 0.2.12", "libc", "spin 0.9.8", "untrusted 0.9.0", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -6915,9 +6924,9 @@ dependencies = [ [[package]] name = "rkyv" -version = "0.7.44" +version = "0.7.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cba464629b3394fc4dbc6f940ff8f5b4ff5c7aef40f29166fd4ad12acbc99c0" +checksum = "527a97cdfef66f65998b5f3b637c26f5a5ec09cc52a3f9932313ac645f4190f5" dependencies = [ "bitvec", "bytecheck", @@ -6933,15 +6942,21 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.7.44" +version = "0.7.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7dddfff8de25e6f62b9d64e6e432bf1c6736c57d20323e15ee10435fbda7c65" +checksum = "b5c462a1328c8e67e4d6dbad1eb0355dd43e8ab432c6e227a43657f16ade5033" dependencies = [ "proc-macro2", "quote", "syn 1.0.109", ] +[[package]] +name = "rle-decode-fast" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3582f63211428f83597b51b2ddb88e2a91a9d52d12831f9d08f5e624e8977422" + [[package]] name = "rlp" version = "0.5.2" @@ -6987,9 +7002,9 @@ dependencies = [ [[package]] name = "ruint" -version = "1.12.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49b1d9521f889713d1221270fdd63370feca7e5c71a18745343402fa86e4f04f" +checksum = "608a5726529f2f0ef81b8fde9873c4bb829d6b5b5ca6be4d97345ddf0749c825" dependencies = [ "alloy-rlp", "arbitrary", @@ -7012,9 +7027,9 @@ dependencies = [ [[package]] name = "ruint-macro" -version = "1.2.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f86854cf50259291520509879a5c294c3c9a4c334e9ff65071c51e42ef1e2343" +checksum = "e666a5496a0b2186dbcd0ff6106e29e093c15591bde62c20d3842007c6978a09" [[package]] name = "rusb" @@ -7136,14 +7151,14 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.22", + "semver 1.0.21", ] [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ "bitflags 2.4.2", "errno", @@ -7171,7 +7186,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", - "ring 0.17.8", + "ring 0.17.7", "rustls-webpki", "sct", ] @@ -7203,7 +7218,7 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.8", + "ring 0.17.7", "untrusted 0.9.0", ] @@ -7227,9 +7242,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "safemem" @@ -7354,7 +7369,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.8", + "ring 0.17.7", "untrusted 0.9.0", ] @@ -7450,9 +7465,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" dependencies = [ "serde", ] @@ -7512,7 +7527,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" dependencies = [ - "half 1.8.3", + "half 1.8.2", "serde", ] @@ -7524,7 +7539,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -7549,11 +7564,11 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.114" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ - "indexmap 2.2.5", + "indexmap 2.2.1", "itoa 1.0.10", "ryu", "serde", @@ -7587,7 +7602,7 @@ checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -7613,17 +7628,16 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.6.1" +version = "3.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15d167997bd841ec232f5b2b8e0e26606df2e7caa4c31b95ea9ca52b200bd270" +checksum = "f5c9fdb6b00a489875b22efd4b78fe2b363b72265cc5f6eb2e2b9ee270e6140c" dependencies = [ "base64 0.21.7", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.5", + "indexmap 2.2.1", "serde", - "serde_derive", "serde_json", "serde_with_macros", "time", @@ -7631,14 +7645,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.6.1" +version = "3.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "865f9743393e638991566a8b7a479043c2c8da94a33e0a31f18214c9cae0a64d" +checksum = "dbff351eb4b33600a2e138dfa0b10b65a238ea8ff8fb2387c422c5022a3e8298" dependencies = [ - "darling 0.20.8", + "darling 0.20.6", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -7647,7 +7661,7 @@ version = "0.9.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fd075d994154d4a774f95b51fb96bdc2832b0ea48425c92546073816cda1f2f" dependencies = [ - "indexmap 2.2.5", + "indexmap 2.2.1", "itoa 1.0.10", "ryu", "serde", @@ -7844,23 +7858,12 @@ checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "socket2" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "socks" -version = "0.3.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c3dbbd9ae980613c6dd8e28a9407b50509d3803b57624d5dfe8315218cd58b" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ - "byteorder", "libc", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -8001,12 +8004,6 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" -[[package]] -name = "strsim" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" - [[package]] name = "strum" version = "0.24.1" @@ -8021,14 +8018,17 @@ name = "strum" version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +dependencies = [ + "strum_macros 0.25.3", +] [[package]] name = "strum" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "723b93e8addf9aa965ebe2d11da6d7540fa2283fcea14b3371ff055f7ba13f5f" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" dependencies = [ - "strum_macros 0.26.1", + "strum_macros 0.26.2", ] [[package]] @@ -8054,20 +8054,20 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] name = "strum_macros" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a3417fc93d76740d974a01654a09777cb500428cc874ca9f45edfe0c4d4cd18" +checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" dependencies = [ "heck 0.4.1", "proc-macro2", "quote", "rustversion", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -8091,15 +8091,15 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "sval" -version = "2.11.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82a2386bea23a121e4e72450306b1dd01078b6399af11b93897bf84640a28a59" +checksum = "1604e9ab506f4805bc62d2868c6d20f23fa6ced4c7cfe695a1d20589ba5c63d0" [[package]] name = "sval_buffer" -version = "2.11.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16c047898a0e19002005512243bc9ef1c1037aad7d03d6c594e234efec80795" +checksum = "2831b6451148d344f612016d4277348f7721b78a0869a145fd34ef8b06b3fa2e" dependencies = [ "sval", "sval_ref", @@ -8107,18 +8107,18 @@ dependencies = [ [[package]] name = "sval_dynamic" -version = "2.11.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a74fb116e2ecdcb280b0108aa2ee4434df50606c3208c47ac95432730eaac20c" +checksum = "238ac5832a23099a413ffd22e66f7e6248b9af4581b64c758ca591074be059fc" dependencies = [ "sval", ] [[package]] name = "sval_fmt" -version = "2.11.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10837b4f0feccef271b2b1c03784e08f6d0bb6d23272ec9e8c777bfadbb8f1b8" +checksum = "c8474862431bac5ac7aee8a12597798e944df33f489c340e17e886767bda0c4e" dependencies = [ "itoa 1.0.10", "ryu", @@ -8127,9 +8127,9 @@ dependencies = [ [[package]] name = "sval_json" -version = "2.11.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891f5ecdf34ce61a8ab2d10f9cfdc303347b0afec4dad6702757419d2d8312a9" +checksum = "d8f348030cc3d2a11eb534145600601f080cf16bf9ec0783efecd2883f14c21e" dependencies = [ "itoa 1.0.10", "ryu", @@ -8138,9 +8138,9 @@ dependencies = [ [[package]] name = "sval_nested" -version = "2.11.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63fcffb4b79c531f38e3090788b64f3f4d54a180aacf02d69c42fa4e4bf284c3" +checksum = "6659c3f6be1e5e99dc7c518877f48a8a39088ace2504b046db789bd78ce5969d" dependencies = [ "sval", "sval_buffer", @@ -8149,18 +8149,18 @@ dependencies = [ [[package]] name = "sval_ref" -version = "2.11.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af725f9c2aa7cec4ca9c47da2cc90920c4c82d3fa537094c66c77a5459f5809d" +checksum = "829ad319bd82d0da77be6f3d547623686c453502f8eebdeb466cfa987972bd28" dependencies = [ "sval", ] [[package]] name = "sval_serde" -version = "2.11.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d7589c649a03d21df40b9a926787d2c64937fa1dccec8d87c6cd82989a2e0a4" +checksum = "1a9da6c3efaedf8b8c0861ec5343e8e8c51d838f326478623328bd8728b79bca" dependencies = [ "serde", "sval", @@ -8178,7 +8178,7 @@ dependencies = [ "hex", "once_cell", "reqwest", - "semver 1.0.22", + "semver 1.0.21", "serde", "serde_json", "sha2 0.10.8", @@ -8195,7 +8195,7 @@ checksum = "5b8d3c94c4d3337336f58493471b98d712c267c66977b0fbe48efd6cbf69ffd0" dependencies = [ "build_const", "hex", - "semver 1.0.22", + "semver 1.0.21", "serde_json", "svm-rs", ] @@ -8213,9 +8213,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.52" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -8231,7 +8231,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -8243,7 +8243,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -8267,20 +8267,20 @@ dependencies = [ [[package]] name = "system-configuration" -version = "0.6.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bc6ee10a9b4fcf576e9b0819d95ec16f4d2c02d39fd83ac1c8789785c4a42" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ - "bitflags 2.4.2", + "bitflags 1.3.2", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.6.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" dependencies = [ "core-foundation-sys", "libc", @@ -8305,10 +8305,10 @@ version = "6.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a2d580ff6a20c55dfb86be5f9c238f67835d0e81cbdea8bf5680e0897320331" dependencies = [ - "cfg-expr 0.15.7", + "cfg-expr 0.15.6", "heck 0.4.1", "pkg-config", - "toml 0.8.10", + "toml 0.8.8", "version-compare 0.1.1", ] @@ -8389,20 +8389,19 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.14" +version = "0.12.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" +checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" [[package]] name = "tauri" -version = "1.6.1" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f078117725e36d55d29fafcbb4b1e909073807ca328ae8deb8c0b3843aac0fed" +checksum = "fd27c04b9543776a972c86ccf70660b517ecabbeced9fb58d8b961a13ad129af" dependencies = [ "anyhow", "cocoa", "dirs-next", - "dunce", "embed_plist", "encoding_rs", "flate2", @@ -8422,7 +8421,7 @@ dependencies = [ "raw-window-handle", "regex", "rfd", - "semver 1.0.22", + "semver 1.0.21", "serde", "serde_json", "serde_repr", @@ -8453,7 +8452,7 @@ dependencies = [ "alloy-primitives 0.6.4", "alloy-sol-types 0.6.4", "chrono", - "dotrain 6.0.1-alpha.10 (registry+https://github.com/rust-lang/crates.io-index)", + "dotrain", "rain_orderbook_app_settings", "rain_orderbook_common", "rain_orderbook_subgraph_client", @@ -8466,7 +8465,7 @@ dependencies = [ "tauri-build", "tauri-cli", "thiserror", - "typeshare", + "typeshare 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "url", "uuid 1.7.0", ] @@ -8482,7 +8481,7 @@ dependencies = [ "dirs-next", "heck 0.4.1", "json-patch", - "semver 1.0.22", + "semver 1.0.21", "serde", "serde_json", "tauri-utils", @@ -8492,31 +8491,31 @@ dependencies = [ [[package]] name = "tauri-bundler" -version = "1.5.1" +version = "1.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "657d0d0b2e820978ee51109bd75f03cee23dc1a83388d08f82fd368635c14e04" +checksum = "f4693930d30c4836ef41f51097502fd77a0ae9f54c3af6aafb8997b2a81f40b4" dependencies = [ "anyhow", "ar", "dirs-next", "dunce", - "flate2", "glob", "handlebars", "heck 0.4.1", "hex", "image", + "libflate", "log", "md5", "os_pipe", "plist", "regex", - "semver 1.0.22", + "semver 1.0.21", "serde", "serde_json", "sha1", "sha2 0.10.8", - "strsim 0.10.0", + "strsim", "tar", "tauri-icns", "tauri-utils", @@ -8533,9 +8532,9 @@ dependencies = [ [[package]] name = "tauri-cli" -version = "1.5.11" +version = "1.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90b2a88fd572b14c0ca224675aaad590e38d95e53846df55459edbdc910795eb" +checksum = "064946ba007aebc4901af5c027e2274bad212e3ad4d810101919ba140b579abd" dependencies = [ "anyhow", "axum", @@ -8568,7 +8567,7 @@ dependencies = [ "os_info", "os_pipe", "regex", - "semver 1.0.22", + "semver 1.0.21", "serde", "serde-value", "serde_json", @@ -8577,8 +8576,8 @@ dependencies = [ "tauri-icns", "tauri-utils", "tokio", - "toml 0.8.10", - "toml_edit 0.21.1", + "toml 0.8.8", + "toml_edit 0.21.0", "unicode-width", "ureq", "url", @@ -8601,7 +8600,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "semver 1.0.22", + "semver 1.0.21", "serde", "serde_json", "sha2 0.10.8", @@ -8659,9 +8658,9 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "0.14.5" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "067c56fc153b3caf406d7cd6de4486c80d1d66c0f414f39e94cb2f5543f6445f" +checksum = "6cae61fbc731f690a4899681c9052dde6d05b159b44563ace8186fc1bfb7d158" dependencies = [ "cocoa", "gtk", @@ -8679,9 +8678,9 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "1.5.3" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75ad0bbb31fccd1f4c56275d0a5c3abdf1f59999f72cb4ef8b79b4ed42082a21" +checksum = "ece74810b1d3d44f29f732a7ae09a63183d63949bbdd59c61f8ed2a1b70150db" dependencies = [ "aes-gcm", "brotli", @@ -8701,7 +8700,7 @@ dependencies = [ "proc-macro2", "quote", "schemars", - "semver 1.0.22", + "semver 1.0.21", "serde", "serde_json", "serde_with", @@ -8725,12 +8724,13 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.10.1" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ "cfg-if", "fastrand", + "redox_syscall", "rustix", "windows-sys 0.52.0", ] @@ -8784,29 +8784,29 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" [[package]] name = "thiserror" -version = "1.0.57" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.57" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] name = "thread_local" -version = "1.1.8" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ "cfg-if", "once_cell", @@ -8834,13 +8834,12 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", "itoa 1.0.10", - "num-conv", "powerfmt", "serde", "time-core", @@ -8855,11 +8854,10 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" dependencies = [ - "num-conv", "time-core", ] @@ -8895,9 +8893,9 @@ checksum = "c7c4ceeeca15c8384bbc3e011dbd8fccb7f068a440b752b7d9b32ceb0ca0e2e8" [[package]] name = "tokio" -version = "1.36.0" +version = "1.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" dependencies = [ "backtrace", "bytes", @@ -8920,7 +8918,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -9007,15 +9005,15 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.10" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" +checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" dependencies = [ - "indexmap 2.2.5", + "indexmap 2.2.1", "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.6", + "toml_edit 0.21.0", ] [[package]] @@ -9033,11 +9031,11 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.5", + "indexmap 2.2.1", "serde", "serde_spanned", "toml_datetime", - "winnow 0.5.40", + "winnow 0.5.35", ] [[package]] @@ -9046,33 +9044,22 @@ version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ - "indexmap 2.2.5", + "indexmap 2.2.1", "toml_datetime", - "winnow 0.5.40", + "winnow 0.5.35", ] [[package]] name = "toml_edit" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap 2.2.5", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.22.6" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" dependencies = [ - "indexmap 2.2.5", + "indexmap 2.2.1", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.5", + "winnow 0.5.35", ] [[package]] @@ -9123,7 +9110,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -9177,9 +9164,9 @@ dependencies = [ [[package]] name = "treediff" -version = "4.0.3" +version = "4.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d127780145176e2b5d16611cc25a900150e86e9fd79d3bde6ff3a37359c9cb5" +checksum = "52984d277bdf2a751072b5df30ec0377febdb02f7696d64c2d7d54630bac4303" dependencies = [ "serde_json", ] @@ -9232,24 +9219,44 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "typeshare" -version = "1.0.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99877a66770b25072a67101e80790fd7fe9ed9eff8c69ffb81e9bf5cbea7733f" +checksum = "f44d1a2f454cb35fbe05b218c410792697e76bd868f48d3a418f2cd1a7d527d6" dependencies = [ "chrono", "serde", "serde_json", - "typeshare-annotation", + "typeshare-annotation 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "typeshare" +version = "1.0.1" +source = "git+https://github.com/1password/typeshare?rev=556b44aafd5304eedf17206800f69834e3820b7c#556b44aafd5304eedf17206800f69834e3820b7c" +dependencies = [ + "chrono", + "serde", + "serde_json", + "typeshare-annotation 1.0.2 (git+https://github.com/1password/typeshare?rev=556b44aafd5304eedf17206800f69834e3820b7c)", ] [[package]] name = "typeshare-annotation" -version = "1.0.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecce25dea8aeaadc44909f4c1226d22d84512fccd07d22447ecbad176bc09545" +checksum = "fc670d0e358428857cc3b4bf504c691e572fccaec9542ff09212d3f13d74b7a9" dependencies = [ "quote", - "syn 2.0.52", + "syn 1.0.109", +] + +[[package]] +name = "typeshare-annotation" +version = "1.0.2" +source = "git+https://github.com/1password/typeshare?rev=556b44aafd5304eedf17206800f69834e3820b7c#556b44aafd5304eedf17206800f69834e3820b7c" +dependencies = [ + "quote", + "syn 1.0.109", ] [[package]] @@ -9309,18 +9316,18 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.11.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" @@ -9383,7 +9390,6 @@ dependencies = [ "once_cell", "rustls 0.21.10", "rustls-webpki", - "socks", "url", "webpki-roots", ] @@ -9483,9 +9489,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "value-bag" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126e423afe2dd9ac52142e7e9d5ce4135d7e13776c529d27fd6bc49f19e3280b" +checksum = "8fec26a25bd6fca441cdd0f769fd7f891bae119f996de31f86a5eddccef54c1d" dependencies = [ "value-bag-serde1", "value-bag-sval2", @@ -9493,9 +9499,9 @@ dependencies = [ [[package]] name = "value-bag-serde1" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ede32f342edc46e84bd41fd394ce2192b553de11725dd83b6223150610c21b44" +checksum = "ead5b693d906686203f19a49e88c477fb8c15798b68cf72f60b4b5521b4ad891" dependencies = [ "erased-serde", "serde", @@ -9504,9 +9510,9 @@ dependencies = [ [[package]] name = "value-bag-sval2" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0024e44b25144c2f4d0ed35d39688e0090d57753e20fef38d08e0c1a40bdf23d" +checksum = "3b9d0f4a816370c3a0d7d82d603b62198af17675b12fe5e91de6b47ceb505882" dependencies = [ "sval", "sval_buffer", @@ -9584,9 +9590,9 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.5.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", "winapi-util", @@ -9615,9 +9621,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -9625,24 +9631,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" dependencies = [ "cfg-if", "js-sys", @@ -9652,9 +9658,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -9662,28 +9668,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ "js-sys", "wasm-bindgen", @@ -9742,15 +9748,15 @@ version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring 0.17.8", + "ring 0.17.7", "untrusted 0.9.0", ] [[package]] name = "webpki-roots" -version = "0.25.4" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" +checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" [[package]] name = "webview2-com" @@ -9879,7 +9885,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.0", ] [[package]] @@ -9937,7 +9943,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.0", ] [[package]] @@ -9972,17 +9978,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] @@ -9997,7 +10003,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75aa004c988e080ad34aff5739c39d0312f4684699d6d71fc8a198d057b8b9b4" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.0", ] [[package]] @@ -10014,9 +10020,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" @@ -10044,9 +10050,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" @@ -10074,9 +10080,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" @@ -10104,9 +10110,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" @@ -10134,9 +10140,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" @@ -10152,9 +10158,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" @@ -10182,15 +10188,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.40" +version = "0.5.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +checksum = "1931d78a9c73861da0134f453bb1f790ce49b2e30eba8410b4b79bac72b46a2d" dependencies = [ "memchr", ] @@ -10224,16 +10230,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "winreg" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - [[package]] name = "wry" version = "0.24.7" @@ -10346,9 +10342,9 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "yansi" -version = "1.0.0" +version = "1.0.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c2861d76f58ec8fc95708b9b1e417f7b12fd72ad33c01fa6886707092dea0d3" +checksum = "1367295b8f788d371ce2dbc842c7b709c73ee1364d30351dd300ec2203b12377" [[package]] name = "zerocopy" @@ -10367,7 +10363,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] @@ -10387,7 +10383,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.48", ] [[package]] diff --git a/tauri-app/src-tauri/Cargo.toml b/tauri-app/src-tauri/Cargo.toml index c16d7a157..ead81bf3d 100644 --- a/tauri-app/src-tauri/Cargo.toml +++ b/tauri-app/src-tauri/Cargo.toml @@ -29,7 +29,7 @@ serde_bytes = "0.11.14" thiserror = "1.0.56" url = "2.5.0" serde_yaml = "0.9.32" -dotrain = "6.0.1-alpha.10" +dotrain = { git = "https://github.com/rainlanguage/dotrain", rev = "b813542cb1c9a2399664a606761f3a3db7b842af" } [features] # this feature is used for production builds or when `devPath` points to the filesystem diff --git a/tauri-app/src-tauri/src/commands/charts.rs b/tauri-app/src-tauri/src/commands/charts.rs index 6ea4a3478..978c1d2b2 100644 --- a/tauri-app/src-tauri/src/commands/charts.rs +++ b/tauri-app/src-tauri/src/commands/charts.rs @@ -1,22 +1,14 @@ +use crate::commands::config::merge_configstrings; use crate::error::CommandResult; -use rain_orderbook_common::fuzz::*; -use rain_orderbook_app_settings::string_structs::*; use rain_orderbook_app_settings::config::*; -use dotrain::RainDocument; +use rain_orderbook_common::fuzz::*; #[tauri::command] -pub async fn make_charts(dotrain: &str, settings: Option<&str>) -> CommandResult> { - let frontmatter = RainDocument::get_front_matter(dotrain).unwrap(); - let mut config = serde_yaml::from_str::(frontmatter)?; - let settings = settings.map(|s| serde_yaml::from_str::(s)); - match settings { - Some(Ok(s)) => config.merge(s)?, - _ => (), - }; - +pub async fn make_charts(dotrain: String, settings: String) -> CommandResult> { + let config = merge_configstrings(dotrain.clone(), settings)?; let final_config: Config = config.try_into()?; - let mut fuzzer = FuzzRunner::new(dotrain, final_config, None).await; + let mut fuzzer = FuzzRunner::new(dotrain.as_str(), final_config, None).await; let chart_data = fuzzer.build_chart_datas().await?; Ok(chart_data) -} \ No newline at end of file +} diff --git a/tauri-app/src-tauri/src/commands/config.rs b/tauri-app/src-tauri/src/commands/config.rs new file mode 100644 index 000000000..7aed666ab --- /dev/null +++ b/tauri-app/src-tauri/src/commands/config.rs @@ -0,0 +1,21 @@ +use crate::error::CommandResult; +use rain_orderbook_app_settings::{config::Config, string_structs::ConfigString}; +use rain_orderbook_common::frontmatter::parse_frontmatter; + +#[tauri::command] +pub fn parse_configstring(text: String) -> CommandResult { + Ok(text.try_into()?) +} + +#[tauri::command] +pub fn merge_configstrings(dotrain: String, config_text: String) -> CommandResult { + let mut dotrain_config = parse_frontmatter(dotrain)?; + let config: ConfigString = config_text.try_into()?; + dotrain_config.merge(config)?; + Ok(dotrain_config) +} + +#[tauri::command] +pub fn convert_configstring_to_config(config_string: ConfigString) -> CommandResult { + Ok(config_string.try_into()?) +} diff --git a/tauri-app/src-tauri/src/commands/dotrain.rs b/tauri-app/src-tauri/src/commands/dotrain.rs index 8a734adfc..31ddd48a3 100644 --- a/tauri-app/src-tauri/src/commands/dotrain.rs +++ b/tauri-app/src-tauri/src/commands/dotrain.rs @@ -1,13 +1,13 @@ use crate::error::CommandResult; -use alloy_primitives::bytes::Bytes; +use alloy_primitives::{bytes::Bytes, Address}; use rain_orderbook_common::rainlang::parse_rainlang_on_fork; #[tauri::command] pub async fn parse_dotrain( - frontmatter: &str, rainlang: &str, rpc_url: &str, block_number: u64, + deployer: Address, ) -> CommandResult { - Ok(parse_rainlang_on_fork(frontmatter, rainlang, rpc_url, Some(block_number)).await?) + Ok(parse_rainlang_on_fork(rainlang, rpc_url, Some(block_number), deployer).await?) } diff --git a/tauri-app/src-tauri/src/commands/dotrain_add_order_lsp.rs b/tauri-app/src-tauri/src/commands/dotrain_add_order_lsp.rs index 90eb019fa..3bd390298 100644 --- a/tauri-app/src-tauri/src/commands/dotrain_add_order_lsp.rs +++ b/tauri-app/src-tauri/src/commands/dotrain_add_order_lsp.rs @@ -1,21 +1,28 @@ use crate::error::CommandResult; +use alloy_primitives::Address; use rain_orderbook_common::{ dotrain::types::ast::Problem, dotrain_add_order_lsp::DotrainAddOrderLsp, dotrain_lsp::lsp_types::{CompletionItem, Hover, Position, TextDocumentItem}, }; +use std::collections::HashMap; #[tauri::command] -pub fn call_lsp_hover(text_document: TextDocumentItem, position: Position) -> Option { - DotrainAddOrderLsp::new(text_document).hover(position) +pub fn call_lsp_hover( + text_document: TextDocumentItem, + position: Position, + bindings: HashMap, +) -> Option { + DotrainAddOrderLsp::new(text_document, bindings).hover(position) } #[tauri::command] pub fn call_lsp_completion( text_document: TextDocumentItem, position: Position, + bindings: HashMap, ) -> Option> { - DotrainAddOrderLsp::new(text_document).completion(position) + DotrainAddOrderLsp::new(text_document, bindings).completion(position) } #[tauri::command] @@ -23,8 +30,10 @@ pub async fn call_lsp_problems( text_document: TextDocumentItem, rpc_url: &str, block_number: Option, + bindings: HashMap, + deployer: Option
, ) -> CommandResult> { - Ok(DotrainAddOrderLsp::new(text_document) - .problems(rpc_url, block_number) + Ok(DotrainAddOrderLsp::new(text_document, bindings) + .problems(rpc_url, block_number, deployer) .await) } diff --git a/tauri-app/src-tauri/src/commands/mod.rs b/tauri-app/src-tauri/src/commands/mod.rs index 994742258..471f43562 100644 --- a/tauri-app/src-tauri/src/commands/mod.rs +++ b/tauri-app/src-tauri/src/commands/mod.rs @@ -1,9 +1,9 @@ pub mod chain; pub mod charts; +pub mod config; pub mod dotrain; pub mod dotrain_add_order_lsp; pub mod order; pub mod order_take; -pub mod settings; pub mod vault; pub mod wallet; diff --git a/tauri-app/src-tauri/src/commands/order.rs b/tauri-app/src-tauri/src/commands/order.rs index 9e319d796..c2ba418da 100644 --- a/tauri-app/src-tauri/src/commands/order.rs +++ b/tauri-app/src-tauri/src/commands/order.rs @@ -1,5 +1,6 @@ use crate::error::CommandResult; use crate::{toast::toast_error, transaction_status::TransactionStatusNoticeRwLock}; +use rain_orderbook_app_settings::deployment::Deployment; use rain_orderbook_common::{ add_order::AddOrderArgs, csv::TryIntoCsv, remove_order::RemoveOrderArgs, subgraph::SubgraphArgs, transaction::TransactionArgs, types::OrderDetailExtended, @@ -61,10 +62,12 @@ pub async fn order_detail( #[tauri::command] pub async fn order_add( app_handle: AppHandle, - add_order_args: AddOrderArgs, + dotrain: String, + deployment: Deployment, transaction_args: TransactionArgs, ) -> CommandResult<()> { let tx_status_notice = TransactionStatusNoticeRwLock::new("Add order".into(), None); + let add_order_args = AddOrderArgs::new_from_deployment(dotrain, deployment).await?; add_order_args .execute(transaction_args, |status| { tx_status_notice.update_status_and_emit(app_handle.clone(), status); diff --git a/tauri-app/src-tauri/src/commands/settings.rs b/tauri-app/src-tauri/src/commands/settings.rs deleted file mode 100644 index cae78e516..000000000 --- a/tauri-app/src-tauri/src/commands/settings.rs +++ /dev/null @@ -1,7 +0,0 @@ -use crate::error::CommandResult; -use rain_orderbook_app_settings::AppSettings; - -#[tauri::command] -pub fn parse_settings(text: String) -> CommandResult { - Ok(text.try_into()?) -} diff --git a/tauri-app/src-tauri/src/error.rs b/tauri-app/src-tauri/src/error.rs index 67d73ba47..fa20e89fa 100644 --- a/tauri-app/src-tauri/src/error.rs +++ b/tauri-app/src-tauri/src/error.rs @@ -2,7 +2,6 @@ use alloy_ethers_typecast::{client::LedgerClientError, transaction::ReadableClie use alloy_primitives::ruint::FromUintError; use rain_orderbook_app_settings::config::ParseConfigStringError; use rain_orderbook_app_settings::merge::MergeError; -use rain_orderbook_app_settings::AppSettingsParseError; use rain_orderbook_common::fuzz::FuzzRunnerError; use rain_orderbook_common::{ add_order::AddOrderArgsError, csv::TryIntoCsvError, meta::TryDecodeRainlangSourceError, @@ -48,9 +47,6 @@ pub enum CommandError { #[error(transparent)] TryDecodeRainlangSourceError(#[from] TryDecodeRainlangSourceError), - #[error(transparent)] - AppSettingsParseError(#[from] AppSettingsParseError), - #[error(transparent)] FuzzRunnerError(#[from] FuzzRunnerError), diff --git a/tauri-app/src-tauri/src/main.rs b/tauri-app/src-tauri/src/main.rs index efd1a5f64..1aaeb37ea 100644 --- a/tauri-app/src-tauri/src/main.rs +++ b/tauri-app/src-tauri/src/main.rs @@ -8,11 +8,11 @@ pub mod transaction_status; mod commands; use commands::chain::{get_block_number, get_chainid}; use commands::charts::make_charts; +use commands::config::{convert_configstring_to_config, merge_configstrings, parse_configstring}; use commands::dotrain::parse_dotrain; use commands::dotrain_add_order_lsp::{call_lsp_completion, call_lsp_hover, call_lsp_problems}; use commands::order::{order_add, order_detail, order_remove, orders_list, orders_list_write_csv}; use commands::order_take::{order_takes_list, order_takes_list_write_csv}; -use commands::settings::parse_settings; use commands::vault::{ vault_balance_changes_list, vault_balance_changes_list_write_csv, vault_deposit, vault_detail, vault_withdraw, vaults_list, vaults_list_write_csv, @@ -55,7 +55,9 @@ fn run_tauri_app() { call_lsp_completion, call_lsp_hover, call_lsp_problems, - parse_settings, + parse_configstring, + merge_configstrings, + convert_configstring_to_config, make_charts ]) .run(tauri::generate_context!()) diff --git a/tauri-app/src/lib/components/CodeMirrorYaml.svelte b/tauri-app/src/lib/components/CodeMirrorConfigString.svelte similarity index 54% rename from tauri-app/src/lib/components/CodeMirrorYaml.svelte rename to tauri-app/src/lib/components/CodeMirrorConfigString.svelte index 7744917fa..8eba1c203 100644 --- a/tauri-app/src/lib/components/CodeMirrorYaml.svelte +++ b/tauri-app/src/lib/components/CodeMirrorConfigString.svelte @@ -2,14 +2,23 @@ import CodeMirror from 'svelte-codemirror-editor'; import { codeMirrorTheme } from '$lib/stores/darkMode'; import { yaml } from '@codemirror/lang-yaml'; + import { parseConfigStringProblems } from '$lib/services/config'; + import { RawRainlangExtension } from 'codemirror-rainlang'; export let value: string; export let disabled = false; export let styles = {}; + + const configStringExtension = new RawRainlangExtension({ + hover: async () => null, + completion: async () => null, + diagnostics: async (textDocument) => parseConfigStringProblems(textDocument.text), + }); import CodeMirror from 'svelte-codemirror-editor'; - import { completionCallback, hoverCallback, problemsCallback } from '$lib/services/langServices'; - import { RawRainlangExtension, type RawLanguageServicesCallbacks } from 'codemirror-rainlang'; + import { RawRainlangExtension } from 'codemirror-rainlang'; import { codeMirrorTheme } from '$lib/stores/darkMode'; export let value: string; export let disabled = false; export let styles = {}; - - const callbacks: RawLanguageServicesCallbacks = { - hover: hoverCallback, - completion: completionCallback, - diagnostics: problemsCallback - } - const rainlangExtension = new RawRainlangExtension(callbacks); + export let rainlangExtension: RawRainlangExtension; - import { Helper, Label } from 'flowbite-svelte'; - import { settings, activeChainSettingsIndex } from '$lib/stores/settings'; - import DropdownRadio from '$lib/components/DropdownRadio.svelte'; - import SkeletonRow from '$lib/components/SkeletonRow.svelte'; - - - -{#if $settings === undefined || $settings.chains.length === 0} - -{:else} - - - {selected.label ? selected.label : selected.rpc_url} - - - - {#if option.label} -
-
{option.label}
- {option.rpc_url} -
- {:else} -
- {option.rpc_url} -
- {/if} -
-
-{/if} diff --git a/tauri-app/src/lib/components/DropdownActiveNetwork.svelte b/tauri-app/src/lib/components/DropdownActiveNetwork.svelte new file mode 100644 index 000000000..05ea508dc --- /dev/null +++ b/tauri-app/src/lib/components/DropdownActiveNetwork.svelte @@ -0,0 +1,30 @@ + + + +{#if $settings?.networks === undefined || Object.keys($settings?.networks).length === 0} + +{:else} + + + {#if selectedRef === undefined} + Select a network + {:else if selectedOption?.label} + {selectedOption.label} + {:else} + {selectedRef} + {/if} + + + +
+
{option.label ? option.label : ref}
+ {option.rpc} +
+
+
+{/if} diff --git a/tauri-app/src/lib/components/DropdownActiveOrderbook.svelte b/tauri-app/src/lib/components/DropdownActiveOrderbook.svelte new file mode 100644 index 000000000..2611cd9ef --- /dev/null +++ b/tauri-app/src/lib/components/DropdownActiveOrderbook.svelte @@ -0,0 +1,30 @@ + + + +{#if $activeNetworkOrderbooks === undefined || Object.keys($activeNetworkOrderbooks).length === 0} + +{:else} + + + {#if selectedRef === undefined} + Select an orderbook + {:else if selectedOption?.label} + {selectedOption.label} + {:else} + {selectedRef} + {/if} + + + +
+
{option.label ? option.label : ref}
+ {option.address} +
+
+
+{/if} \ No newline at end of file diff --git a/tauri-app/src/lib/components/DropdownActiveOrderbookSettings.svelte b/tauri-app/src/lib/components/DropdownActiveOrderbookSettings.svelte deleted file mode 100644 index 75bffcc39..000000000 --- a/tauri-app/src/lib/components/DropdownActiveOrderbookSettings.svelte +++ /dev/null @@ -1,30 +0,0 @@ - - - -{#if $activeChainSettings === undefined || $activeChainSettings.orderbooks.length === 0} - -{:else} - - - {selected.label ? selected.label : selected.address} - - - - {#if option.label} -
-
{option.label}
- {option.address} -
- {:else} -
- {option.address} -
- {/if} -
-
-{/if} \ No newline at end of file diff --git a/tauri-app/src/lib/components/DropdownProperty.svelte b/tauri-app/src/lib/components/DropdownProperty.svelte new file mode 100644 index 000000000..34bc5252e --- /dev/null +++ b/tauri-app/src/lib/components/DropdownProperty.svelte @@ -0,0 +1,13 @@ + + +
+
+ {key} +
+

+ {value} +

+
diff --git a/tauri-app/src/lib/components/DropdownRadio.svelte b/tauri-app/src/lib/components/DropdownRadio.svelte index 291c82ea5..2e0808159 100644 --- a/tauri-app/src/lib/components/DropdownRadio.svelte +++ b/tauri-app/src/lib/components/DropdownRadio.svelte @@ -3,23 +3,23 @@ import { ChevronDownSolid } from 'flowbite-svelte-icons'; // eslint-disable-next-line no-undef - export let options: Array = []; - export let value: number = 0; + export let options: Record = {}; + export let value: string | undefined = undefined; let open = false; $: value, open = false; - - {#each options as option, index} - + + {#each Object.entries(options) as [ref, option]} +
- +
{/each} diff --git a/tauri-app/src/lib/components/FileTextarea.svelte b/tauri-app/src/lib/components/FileTextarea.svelte index 430bcb2a9..22f73ba92 100644 --- a/tauri-app/src/lib/components/FileTextarea.svelte +++ b/tauri-app/src/lib/components/FileTextarea.svelte @@ -43,6 +43,10 @@ +
+ +
+
\ No newline at end of file diff --git a/tauri-app/src/lib/components/Sidebar.svelte b/tauri-app/src/lib/components/Sidebar.svelte index d0bfc0cde..5eb74d750 100644 --- a/tauri-app/src/lib/components/Sidebar.svelte +++ b/tauri-app/src/lib/components/Sidebar.svelte @@ -12,8 +12,8 @@ import IconExternalLink from '$lib/components/IconExternalLink.svelte'; import { page } from '$app/stores'; import ButtonDarkMode from '$lib/components/ButtonDarkMode.svelte'; - import DropdownActiveChainSettings from '$lib/components/DropdownActiveChainSettings.svelte'; - import DropdownActiveOrderbookSettings from '$lib/components/DropdownActiveOrderbookSettings.svelte'; + import DropdownActiveNetwork from '$lib/components/DropdownActiveNetwork.svelte'; + import DropdownActiveOrderbook from '$lib/components/DropdownActiveOrderbook.svelte'; export let hasRequiredSettings = false; @@ -49,8 +49,8 @@ - - + + diff --git a/tauri-app/src/lib/components/SkeletonRow.svelte b/tauri-app/src/lib/components/SkeletonRow.svelte index 682b5e330..4c8cf5442 100644 --- a/tauri-app/src/lib/components/SkeletonRow.svelte +++ b/tauri-app/src/lib/components/SkeletonRow.svelte @@ -2,4 +2,4 @@ export let divClass = ''; -
\ No newline at end of file +
\ No newline at end of file diff --git a/tauri-app/src/lib/services/chart.ts b/tauri-app/src/lib/services/chart.ts index e6a4b0344..2078a519c 100644 --- a/tauri-app/src/lib/services/chart.ts +++ b/tauri-app/src/lib/services/chart.ts @@ -1,9 +1,4 @@ import type { ChartData } from '$lib/typeshare/fuzz'; import { invoke } from '@tauri-apps/api'; -export async function makeChartData(dotrain: string, settings: string): Promise { - console.log('makeChartData') - return await invoke("make_charts", { - dotrain, settings - }); -} \ No newline at end of file +export const makeChartData = async (dotrain: string, settings: string): Promise => invoke("make_charts", { dotrain, settings }); \ No newline at end of file diff --git a/tauri-app/src/lib/services/config.ts b/tauri-app/src/lib/services/config.ts new file mode 100644 index 000000000..8391fdfed --- /dev/null +++ b/tauri-app/src/lib/services/config.ts @@ -0,0 +1,44 @@ +import { settingsText } from "$lib/stores/settings"; +import type { Config } from "$lib/typeshare/config"; +import type { ConfigString } from "$lib/typeshare/configString"; +import { invoke } from "@tauri-apps/api"; +import { get } from "svelte/store"; +import { ErrorCode, type Problem } from 'codemirror-rainlang'; + +export const parseConfigString = async (text: string): Promise => invoke("parse_configstring", {text}); + +export const mergeDotrainConfigWithSettings = async (dotrain: string): Promise => invoke("merge_configstrings", {dotrain, configText: get(settingsText)}); + +export const convertConfigstringToConfig = async (configString: ConfigString): Promise => invoke("convert_configstring_to_config", {configString}); + +export async function parseConfigStringProblems(text: string) { + const problems: Problem[] = []; + + try { + await parseConfigString(text); + } catch(e) { + problems.push(convertErrorToProblem(e)); + } + + return problems; +} + +export async function mergeDotrainConfigWithSettingsProblems(dotrain: string) { + const problems: Problem[] = []; + + try { + await mergeDotrainConfigWithSettings(dotrain); + } catch(e) { + problems.push(convertErrorToProblem(e)); + } + + return problems; +} + +function convertErrorToProblem(e: unknown) { + return { + msg: typeof e === "string" ? e : e instanceof Error ? e.message : "something went wrong!", + position: [0, 0], + code: ErrorCode.InvalidRainDocument + } as Problem +} \ No newline at end of file diff --git a/tauri-app/src/lib/services/langServices.ts b/tauri-app/src/lib/services/langServices.ts index 1db82ef91..2179f910f 100644 --- a/tauri-app/src/lib/services/langServices.ts +++ b/tauri-app/src/lib/services/langServices.ts @@ -7,9 +7,9 @@ import { forkBlockNumber } from '$lib/stores/forkBlockNumber'; /** * Provides problems callback by invoking related tauri command */ -export async function problemsCallback(textDocument: TextDocumentItem): Promise { +export async function problemsCallback(textDocument: TextDocumentItem, bindings: Record, deployerAddress: string | undefined): Promise { try { - return await invoke('call_lsp_problems', { textDocument, rpcUrl: get(rpcUrl), blockNumber: get(forkBlockNumber).value }); + return await invoke('call_lsp_problems', { textDocument, rpcUrl: get(rpcUrl), blockNumber: get(forkBlockNumber).value, bindings, deployer: deployerAddress }); } catch (err) { return [{ @@ -23,13 +23,11 @@ export async function problemsCallback(textDocument: TextDocumentItem): Promise< /** * Provides hover callback by invoking related tauri command */ -export async function hoverCallback(textDocument: TextDocumentItem, position: Position): Promise { - return await invoke('call_lsp_hover', { textDocument, position }); -} +export const hoverCallback = (textDocument: TextDocumentItem, position: Position, bindings: Record): Promise => + invoke('call_lsp_hover', { textDocument, position, bindings }); /** * Provides completion callback by invoking related tauri command */ -export async function completionCallback(textDocument: TextDocumentItem, position: Position): Promise { - return await invoke('call_lsp_completion', { textDocument, position }); -} \ No newline at end of file +export const completionCallback = async (textDocument: TextDocumentItem, position: Position, bindings: Record): Promise => + invoke('call_lsp_completion', { textDocument, position, bindings }); diff --git a/tauri-app/src/lib/services/order.ts b/tauri-app/src/lib/services/order.ts index 5d9cfd8c4..3829ce29d 100644 --- a/tauri-app/src/lib/services/order.ts +++ b/tauri-app/src/lib/services/order.ts @@ -2,12 +2,12 @@ import { get } from 'svelte/store'; import { invoke } from '@tauri-apps/api'; import { rpcUrl, orderbookAddress,chainId, subgraphUrl } from '$lib/stores/settings'; import { walletDerivationIndex } from '$lib/stores/wallets'; +import type { Deployment } from '$lib/typeshare/config'; -export async function orderAdd(dotrain: string) { +export async function orderAdd(dotrain: string, deployment: Deployment) { await invoke("order_add", { - addOrderArgs: { - dotrain, - }, + dotrain, + deployment, transactionArgs: { rpc_url: get(rpcUrl), orderbook_address: get(orderbookAddress), diff --git a/tauri-app/src/lib/stores/forkBlockNumber.ts b/tauri-app/src/lib/stores/forkBlockNumber.ts index 73e0e395c..6992613ed 100644 --- a/tauri-app/src/lib/stores/forkBlockNumber.ts +++ b/tauri-app/src/lib/stores/forkBlockNumber.ts @@ -3,7 +3,12 @@ import { fetchableIntStore } from "$lib/storesGeneric/fetchableStore"; import { get } from "svelte/store"; import { rpcUrl } from "./settings"; -export const forkBlockNumber = fetchableIntStore("forkBlockNumber", async () => await getBlockNumberFromRpc(get(rpcUrl))); +export const forkBlockNumber = fetchableIntStore("forkBlockNumber", async () => { + const $rpcUrl = get(rpcUrl); + if(!$rpcUrl) return 0; + + return getBlockNumberFromRpc($rpcUrl); +}); // When active chain updated, reset active orderbook rpcUrl.subscribe(async () => { diff --git a/tauri-app/src/lib/stores/settings.ts b/tauri-app/src/lib/stores/settings.ts index 9bdf9ba8a..0b35b0013 100644 --- a/tauri-app/src/lib/stores/settings.ts +++ b/tauri-app/src/lib/stores/settings.ts @@ -1,62 +1,113 @@ import { asyncDerived, derived, get } from '@square/svelte-store'; -import { cachedWritableInt, cachedWritableStore } from '$lib/storesGeneric/cachedWritableStore'; +import { cachedWritableStore, cachedWritableStringOptional } from '$lib/storesGeneric/cachedWritableStore'; import find from 'lodash/find'; import * as chains from 'viem/chains'; import { textFileStore } from '$lib/storesGeneric/textFileStore'; -import { invoke } from '@tauri-apps/api'; -import { type AppSettings, type ChainSettings } from '$lib/typeshare/appSettings'; -import { getBlockNumberFromRpc, getChainIdFromRpc } from '$lib/services/chain'; +import { type ConfigString, type OrderbookRef, type OrderbookString } from '$lib/typeshare/configString'; +import { getBlockNumberFromRpc } from '$lib/services/chain'; +import { toasts } from './toasts'; +import { pickBy } from 'lodash'; +import { parseConfigString } from '$lib/services/config'; -interface ChainSettingsExtended extends ChainSettings { - chain_id: number, -} - -interface AppSettingsExtended { - chains: Array; -} +const emptyConfig = { + deployments: {}, + networks: {}, + orderbooks: {}, + orders: {}, + subgraphs: {}, + tokens: {}, + deployers: {}, + scenarios: {}, + charts: {} +} as ConfigString; // general export const settingsText = cachedWritableStore('settings', "", (s) => s, (s) => s); export const settingsFile = textFileStore('Orderbook Settings Yaml', ['yml', 'yaml'], get(settingsText)); -export const settings = asyncDerived(settingsText, async ($settingsText): Promise => { - const data: AppSettings = await invoke("parse_settings", {text: $settingsText}); - const chains = await Promise.all(data.chains.map(async (c): Promise => { - const chainId: number = await getChainIdFromRpc(c.rpc_url); - return { - ...c, - chain_id: chainId, - }; - })); - return { chains }; -}); +export const settings = asyncDerived(settingsText, async ($settingsText): Promise => { + try { + const config: ConfigString = await parseConfigString($settingsText); + return config; + } catch(e) { + toasts.error(e as string); + return emptyConfig; + } +}, { initial: emptyConfig }); -// chain -export const activeChainSettingsIndex = cachedWritableInt("settings.activeChainIndex", 0); -export const activeChainSettings = derived([settings, activeChainSettingsIndex], ([$settingsData, $activeChainSettingsIndex]) => $settingsData?.chains[$activeChainSettingsIndex]); -export const rpcUrl = derived(activeChainSettings, ($activeChainSettings) => $activeChainSettings?.rpc_url); -export const chainId = derived(activeChainSettings, ($activeChainSettings) => $activeChainSettings?.chain_id); +// networks +export const activeNetworkRef = cachedWritableStringOptional("settings.activeNetworkRef"); +export const activeNetwork = asyncDerived([settings, activeNetworkRef], async ([$settings, $activeNetworkRef]) => { + await settings.load(); + return ($activeNetworkRef !== undefined && $settings.networks !== undefined) ? $settings.networks[$activeNetworkRef] : undefined; +}); +export const rpcUrl = derived(activeNetwork, ($activeNetwork) => $activeNetwork?.rpc); +export const chainId = derived(activeNetwork, ($activeNetwork) => $activeNetwork?.['chain-id']); export const activeChain = derived(chainId, ($activeChainId) => find(Object.values(chains), (c) => c.id === $activeChainId)); export const activeChainHasBlockExplorer = derived(activeChain, ($activeChain) => { - return $activeChain && $activeChain.blockExplorers?.default !== undefined; + return $activeChain && $activeChain?.blockExplorers?.default !== undefined; }); -export const activeChainLatestBlockNumber = derived(activeChainSettings, ($activeChainSettings) => getBlockNumberFromRpc($activeChainSettings.rpc_url)); +export const activeChainLatestBlockNumber = derived(activeNetwork, ($activeNetwork) => $activeNetwork !== undefined ? getBlockNumberFromRpc($activeNetwork.rpc) : 0); // orderbook -export const activeOrderbookSettingsIndex = cachedWritableInt("settings.activeOrderbookIndex", 0); -export const activeOrderbookSettings = derived([activeChainSettings, activeOrderbookSettingsIndex], ([$activeChainSettings, $activeOrderbookSettingsIndex]) => $activeChainSettings?.orderbooks[$activeOrderbookSettingsIndex]); -export const subgraphUrl = derived(activeOrderbookSettings, ($activeOrderbookSettings) => $activeOrderbookSettings?.subgraph_url); -export const orderbookAddress = derived(activeOrderbookSettings, ($activeOrderbookSettings) => $activeOrderbookSettings?.address); +export const activeOrderbookRef = cachedWritableStringOptional("settings.activeOrderbookRef"); +export const activeNetworkOrderbooks = derived([settings, activeNetworkRef], ([$settings, $activeNetworkRef]) => $settings?.orderbooks ? pickBy($settings.orderbooks, (orderbook) => orderbook.network === $activeNetworkRef) as Record : {} as Record); +export const activeOrderbook = derived([settings, activeOrderbookRef], ([$settings, $activeOrderbookRef]) => ($settings?.orderbooks !== undefined && $activeOrderbookRef !== undefined) ? $settings.orderbooks[$activeOrderbookRef] : undefined); +export const subgraphUrl = derived([settings, activeOrderbook], ([$settings, $activeOrderbook]) => ($settings?.subgraphs !== undefined && $activeOrderbook?.subgraph !== undefined) ? $settings.subgraphs[$activeOrderbook.subgraph] : undefined); +export const orderbookAddress = derived(activeOrderbook, ($activeOrderbook) => $activeOrderbook?.address); -export const hasRequiredSettings = derived([activeChainSettings, activeOrderbookSettings], ([$activeChainSettings, $activeOrderbookSettings]) => $activeChainSettings !== undefined && $activeOrderbookSettings !== undefined); +export const hasRequiredSettings = derived([activeNetworkRef, activeOrderbookRef], ([$activeNetworkRef, $activeOrderbookRef]) => $activeNetworkRef !== undefined && $activeOrderbookRef !== undefined); + +// When networks / orderbooks settings updated, reset active network / orderbook +settings.subscribe(async ($settings) => { + await settings.load(); + const $activeNetworkRef = get(activeNetworkRef); + const $activeOrderbookRef = get(activeOrderbookRef); + + if(!$settings.networks || $activeNetworkRef === undefined || !Object.keys($settings.networks).includes($activeNetworkRef)) { + resetActiveNetworkRef(); + } + + if(!$settings.orderbooks || $activeOrderbookRef === undefined || !Object.keys($settings.orderbooks).includes($activeOrderbookRef)) { + resetActiveOrderbookRef(); + } +}); -// When settings data updated, reset active chain -settings.subscribe((val) => { - if(val && val.chains.length < get(activeChainSettingsIndex)) { - activeChainSettingsIndex.set(0); +// When active network is updated to undefined, reset active orderbook +activeNetworkRef.subscribe(($activeNetworkRef) => { + if($activeNetworkRef === undefined) { + resetActiveOrderbookRef(); } }); -// When active chain updated, reset active orderbook -activeChainSettings.subscribe(async () => { - activeOrderbookSettingsIndex.set(0); +// When active network is updated to not include active orderbook, reset active orderbook +activeNetworkOrderbooks.subscribe(async ($activeNetworkOrderbooks) => { + const $activeOrderbookRef = get(activeOrderbookRef); + + if($activeOrderbookRef !== undefined && !Object.keys($activeNetworkOrderbooks).includes($activeOrderbookRef)) { + resetActiveOrderbookRef(); + } }); + +// reset active orderbook to first available, otherwise undefined +function resetActiveOrderbookRef() { + const $activeNetworkOrderbooks = get(activeNetworkOrderbooks); + const $activeNetworkOrderbookRefs = Object.keys($activeNetworkOrderbooks); + + if($activeNetworkOrderbookRefs.length > 0) { + activeOrderbookRef.set($activeNetworkOrderbookRefs[0]); + } else { + activeOrderbookRef.set(undefined); + } +} + + +// reset active orderbook to first available, otherwise undefined +function resetActiveNetworkRef() { + const $networks = get(settings).networks; + + if($networks !== undefined && Object.keys($networks).length > 0) { + activeNetworkRef.set(Object.keys($networks)[0]); + } else { + activeNetworkRef.set(undefined); + } +} \ No newline at end of file diff --git a/tauri-app/src/lib/storesGeneric/cachedWritableStore.ts b/tauri-app/src/lib/storesGeneric/cachedWritableStore.ts index 9ec1ed716..c07582ecc 100644 --- a/tauri-app/src/lib/storesGeneric/cachedWritableStore.ts +++ b/tauri-app/src/lib/storesGeneric/cachedWritableStore.ts @@ -39,3 +39,4 @@ export const cachedWritableOptionalStore = ( ) => cachedWritableStore(key, defaultValue, (v) => v ? serialize(v) : '', (v) => v ? deserialize(v) : undefined); export const cachedWritableIntOptional = (key: string, defaultValue = undefined) => cachedWritableOptionalStore(key, defaultValue, (v) => v.toString(), (v) => parseInt(v)); +export const cachedWritableStringOptional = (key: string, defaultValue = undefined) => cachedWritableOptionalStore(key, defaultValue, (v) => v, (v) => v); diff --git a/tauri-app/src/routes/+layout.svelte b/tauri-app/src/routes/+layout.svelte index 3a9defbff..e61e748f1 100644 --- a/tauri-app/src/routes/+layout.svelte +++ b/tauri-app/src/routes/+layout.svelte @@ -13,11 +13,12 @@ import TransactionStatusNotice from '$lib/components/TransactionStatusNotice.svelte'; import WindowDraggableArea from '$lib/components/WindowDraggableArea.svelte'; import { goto } from '$app/navigation'; - import { hasRequiredSettings } from '$lib/stores/settings'; + import { hasRequiredSettings, settings } from '$lib/stores/settings'; $: $hasRequiredSettings, redirectIfMissingSettings(); async function redirectIfMissingSettings() { + await settings.load(); const hasRequiredSettingsVal = await hasRequiredSettings.load(); if (!hasRequiredSettingsVal) goto('/settings'); } diff --git a/tauri-app/src/routes/orders/add/+page.svelte b/tauri-app/src/routes/orders/add/+page.svelte index dd3f17558..ec9bbac35 100644 --- a/tauri-app/src/routes/orders/add/+page.svelte +++ b/tauri-app/src/routes/orders/add/+page.svelte @@ -2,27 +2,74 @@ import PageHeader from '$lib/components/PageHeader.svelte'; import CodeMirrorDotrain from '$lib/components/CodeMirrorDotrain.svelte'; import ButtonLoading from '$lib/components/ButtonLoading.svelte'; - import { textFileStore } from '$lib/storesGeneric/textFileStore'; import { orderAdd } from '$lib/services/order'; import FileTextarea from '$lib/components/FileTextarea.svelte'; - import { Helper, Label, Button, Spinner } from 'flowbite-svelte'; + import { Helper, Label, Button, Spinner} from 'flowbite-svelte'; import InputBlockNumber from '$lib/components/InputBlockNumber.svelte'; import { forkBlockNumber } from '$lib/stores/forkBlockNumber'; + import { RawRainlangExtension, type Problem } from 'codemirror-rainlang'; + import { completionCallback, hoverCallback, problemsCallback } from '$lib/services/langServices'; import { makeChartData } from '$lib/services/chart'; - import { settingsText } from '$lib/stores/settings'; - import type { ChartData } from '$lib/typeshare/fuzz'; - import Charts from '$lib/components/Charts.svelte'; + import { settingsText, activeNetworkRef } from '$lib/stores/settings'; + import type { ChartData } from '$lib/typeshare/fuzz'; + import Charts from '$lib/components/Charts.svelte'; + import { textFileStore } from '$lib/storesGeneric/textFileStore'; + import { pickBy } from 'lodash'; + import { convertConfigstringToConfig, mergeDotrainConfigWithSettings, mergeDotrainConfigWithSettingsProblems } from '$lib/services/config'; + import type { Config } from '$lib/typeshare/config'; + import DropdownRadio from '$lib/components/DropdownRadio.svelte'; + import { toasts } from '$lib/stores/toasts'; + import type { ConfigString } from '$lib/typeshare/configString'; + import DropdownProperty from '$lib/components/DropdownProperty.svelte'; let isSubmitting = false; let isCharting = false; let chartData: ChartData[]; + let dotrainFile = textFileStore('Rain', ['rain']); + let deploymentRef: string | undefined = undefined; + let mergedConfigString: ConfigString | undefined = undefined; + let mergedConfig: Config | undefined = undefined; + + $: deployments = (mergedConfigString !== undefined && mergedConfigString?.deployments !== undefined && mergedConfigString?.orders !== undefined) ? + pickBy(mergedConfigString.deployments, (d) => mergedConfigString?.orders?.[d.order]?.network === $activeNetworkRef) : {}; + $: deployment = (deploymentRef !== undefined && mergedConfig !== undefined) ? mergedConfig.deployments[deploymentRef] : undefined; + $: bindings = deployment ? deployment.scenario.bindings : {}; + $: $dotrainFile.text, updateMergedConfig(); + + $: rainlangExtension = new RawRainlangExtension({ + hover: (text, position) => hoverCallback.apply(null, [text, position, bindings]), + diagnostics: async (text) => { + // get problems with merging settings config with frontmatter + const configProblems = await mergeDotrainConfigWithSettingsProblems(text.text); + + // get problems with dotrain + const problems = await problemsCallback.apply(null, [text, bindings, deployment?.scenario.deployer.address]); - const dotrainFile = textFileStore('Rain', ['rain']); + return [...configProblems, ...problems] as Problem[]; + }, + completion: (text, position) => completionCallback.apply(null, [text, position, bindings]), + }); + + $: { + if(deploymentRef === undefined && deployments !== undefined && Object.keys(deployments).length > 0) { + deploymentRef = Object.keys(deployments)[0]; + } + } + + async function updateMergedConfig() { + try { + mergedConfigString = await mergeDotrainConfigWithSettings($dotrainFile.text); + mergedConfig = await convertConfigstringToConfig(mergedConfigString); + // eslint-disable-next-line no-empty + } catch(e) {} + } async function execute() { isSubmitting = true; try { - await orderAdd($dotrainFile.text); + if(!deployment) throw Error("Select a deployment to add order"); + + await orderAdd($dotrainFile.text, deployment); // eslint-disable-next-line no-empty } catch (e) {} isSubmitting = false; @@ -30,11 +77,13 @@ async function chart() { isCharting = true; - chartData = await makeChartData($dotrainFile.text, $settingsText); + try { + chartData = await makeChartData($dotrainFile.text, $settingsText); + } catch(e) { + toasts.error(e as string, {break_text: true}); + } isCharting = false; } - - $: console.log(chartData) @@ -45,9 +94,35 @@ bind:value={$dotrainFile.text} disabled={isSubmitting} styles={{ '&': { minHeight: '400px' } }} + {rainlangExtension} /> + +
+
+ + {#if deployments === undefined || Object.keys(deployments).length === 0} + No deployments found for the selected network + {:else} + + + {selectedRef !== undefined ? selectedRef : 'Select a deployment'} + + + +
+
{ref}
+ + +
+
+
+ {/if} +
+
+
+ - diff --git a/tauri-app/src/scripts/typeshareFix.cjs b/tauri-app/src/scripts/typeshareFix.cjs deleted file mode 100644 index b05702620..000000000 --- a/tauri-app/src/scripts/typeshareFix.cjs +++ /dev/null @@ -1,26 +0,0 @@ -// eslint-disable-next-line @typescript-eslint/no-var-requires -const fs = require("fs"); - -let config_content = fs.readFileSync("./tauri-app/src/lib/typeshare/config.ts", { encoding: "utf-8" }); -config_content = config_content.replace(`export interface Network { - rpc: string; - label?: string; - currency?: string; -}`, `export interface Network { - rpc: string; - chain_id: number; - label?: string; - network_id?: number; - currency?: string; -}`); -config_content = config_content.replace(`export interface Scenario { - bindings: Record; - deployer: Deployer; - orderbook?: Orderbook; -}`, `export interface Scenario { - bindings: Record; - runs?: number; - deployer: Deployer; - orderbook?: Orderbook; -}`); -fs.writeFileSync("./tauri-app/src/lib/typeshare/config.ts", config_content); diff --git a/typeshare.toml b/typeshare.toml index d685ac4cb..b748fc4a6 100644 --- a/typeshare.toml +++ b/typeshare.toml @@ -5,3 +5,5 @@ "Bytes" = "string" "Uuid" = "string" "DateTime" = "string" +"Address" = "string" +"Url" = "string" \ No newline at end of file