From 18f851da53b1b389a6be32848bd94a86400934a8 Mon Sep 17 00:00:00 2001 From: Andrew Plaza Date: Mon, 12 Feb 2024 13:53:01 -0500 Subject: [PATCH] Remove references to `gateway` in-code (#57) --- Cargo.lock | 333 ++++++++++-------- Cargo.toml | 12 +- Dockerfile | 6 +- {xps-gateway => lib-xps}/Cargo.toml | 5 +- {xps-gateway => lib-xps}/src/lib.rs | 4 +- {xps-gateway => lib-xps}/src/rpc.rs | 0 {xps-gateway => lib-xps}/src/rpc/api.rs | 5 +- {xps-gateway => lib-xps}/src/rpc/methods.rs | 7 +- {xps-gateway => lib-xps}/src/types.rs | 0 {xps-gateway => lib-xps}/src/util.rs | 0 .../tests/integration_test.rs | 4 +- .../tests/integration_util/mod.rs | 2 +- messaging/Cargo.toml | 2 +- messaging/src/lib.rs | 2 +- prod/Dockerfile | 10 +- registry/Cargo.toml | 2 +- registry/src/lib.rs | 2 +- {gateway-types => xps-types}/Cargo.toml | 2 +- {gateway-types => xps-types}/src/error.rs | 0 {gateway-types => xps-types}/src/lib.rs | 0 xps/Cargo.toml | 12 + {xps-gateway => xps}/src/main.rs | 18 +- 22 files changed, 237 insertions(+), 191 deletions(-) rename {xps-gateway => lib-xps}/Cargo.toml (89%) rename {xps-gateway => lib-xps}/src/lib.rs (91%) rename {xps-gateway => lib-xps}/src/rpc.rs (100%) rename {xps-gateway => lib-xps}/src/rpc/api.rs (99%) rename {xps-gateway => lib-xps}/src/rpc/methods.rs (97%) rename {xps-gateway => lib-xps}/src/types.rs (100%) rename {xps-gateway => lib-xps}/src/util.rs (100%) rename {xps-gateway => lib-xps}/tests/integration_test.rs (99%) rename {xps-gateway => lib-xps}/tests/integration_util/mod.rs (99%) rename {gateway-types => xps-types}/Cargo.toml (92%) rename {gateway-types => xps-types}/src/error.rs (100%) rename {gateway-types => xps-types}/src/lib.rs (100%) create mode 100644 xps/Cargo.toml rename {xps-gateway => xps}/src/main.rs (75%) diff --git a/Cargo.lock b/Cargo.lock index 62c5eec..26a09ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -78,9 +78,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" @@ -361,9 +361,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" +checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" dependencies = [ "serde", ] @@ -400,9 +400,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.33" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" +checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" dependencies = [ "android-tzdata", "iana-time-zone", @@ -424,9 +424,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.18" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" +checksum = "80c21025abd42669a92efc996ef13cfb2c5c627858421ea58d5c3b331a6c134f" dependencies = [ "clap_builder", "clap_derive", @@ -434,9 +434,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.18" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" +checksum = "458bf1f341769dfcf849846f65dffdf9146daa56bcd2a47cb4e1de9915567c99" dependencies = [ "anstream", "anstyle", @@ -446,9 +446,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" dependencies = [ "heck", "proc-macro2", @@ -458,9 +458,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "coins-bip32" @@ -531,9 +531,9 @@ dependencies = [ [[package]] name = "const-hex" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5104de16b218eddf8e34ffe2f86f74bfa4e61e95a1b89732fccf6325efd0557" +checksum = "18d59688ad0945eaf6b84cb44fedbe93484c81b48970e98f09db8a22832d7961" dependencies = [ "cfg-if", "cpufeatures", @@ -581,9 +581,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" dependencies = [ "cfg-if", ] @@ -787,9 +787,9 @@ dependencies = [ [[package]] name = "either" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] name = "elliptic-curve" @@ -934,9 +934,9 @@ dependencies = [ [[package]] name = "ethers" -version = "2.0.11" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a5344eea9b20effb5efeaad29418215c4d27017639fd1f908260f59cbbd226e" +checksum = "6c7cd562832e2ff584fa844cd2f6e5d4f35bbe11b28c7c9b8df957b2e1d0c701" dependencies = [ "ethers-addressbook", "ethers-contract", @@ -950,9 +950,9 @@ dependencies = [ [[package]] name = "ethers-addressbook" -version = "2.0.12" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bf35eb7d2e2092ad41f584951e08ec7c077b142dba29c4f1b8f52d2efddc49c" +checksum = "35dc9a249c066d17e8947ff52a4116406163cf92c7f0763cb8c001760b26403f" dependencies = [ "ethers-core", "once_cell", @@ -962,9 +962,9 @@ dependencies = [ [[package]] name = "ethers-contract" -version = "2.0.11" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0111ead599d17a7bff6985fd5756f39ca7033edc79a31b23026a8d5d64fa95cd" +checksum = "43304317c7f776876e47f2f637859f6d0701c1ec7930a150f169d5fbe7d76f5a" dependencies = [ "const-hex", "ethers-contract-abigen", @@ -981,9 +981,9 @@ dependencies = [ [[package]] name = "ethers-contract-abigen" -version = "2.0.12" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbdfb952aafd385b31d316ed80d7b76215ce09743c172966d840e96924427e0c" +checksum = "f9f96502317bf34f6d71a3e3d270defaa9485d754d789e15a8e04a84161c95eb" dependencies = [ "Inflector", "const-hex", @@ -1005,9 +1005,9 @@ dependencies = [ [[package]] name = "ethers-contract-derive" -version = "2.0.12" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7465c814a2ecd0de0442160da13584205d1cdc08f4717a6511cad455bd5d7dc4" +checksum = "452ff6b0a64507ce8d67ffd48b1da3b42f03680dcf5382244e9c93822cbbf5de" dependencies = [ "Inflector", "const-hex", @@ -1021,9 +1021,9 @@ dependencies = [ [[package]] name = "ethers-core" -version = "2.0.12" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "918b1a9ba585ea61022647def2f27c29ba19f6d2a4a4c8f68a9ae97fd5769737" +checksum = "aab3cef6cc1c9fd7f787043c81ad3052eff2b96a3878ef1526aa446311bdbfc9" dependencies = [ "arrayvec", "bytes", @@ -1051,9 +1051,9 @@ dependencies = [ [[package]] name = "ethers-etherscan" -version = "2.0.12" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "facabf8551b4d1a3c08cb935e7fca187804b6c2525cc0dafb8e5a6dd453a24de" +checksum = "16d45b981f5fa769e1d0343ebc2a44cfa88c9bc312eb681b676318b40cef6fb1" dependencies = [ "chrono", "ethers-core", @@ -1067,9 +1067,9 @@ dependencies = [ [[package]] name = "ethers-middleware" -version = "2.0.11" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681ece6eb1d10f7cf4f873059a77c04ff1de4f35c63dd7bccde8f438374fcb93" +checksum = "145211f34342487ef83a597c1e69f0d3e01512217a7c72cc8a25931854c7dca0" dependencies = [ "async-trait", "auto_impl", @@ -1094,9 +1094,9 @@ dependencies = [ [[package]] name = "ethers-providers" -version = "2.0.11" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25d6c0c9455d93d4990c06e049abf9b30daf148cf461ee939c11d88907c60816" +checksum = "fb6b15393996e3b8a78ef1332d6483c11d839042c17be58decc92fa8b1c3508a" dependencies = [ "async-trait", "auto_impl", @@ -1132,9 +1132,9 @@ dependencies = [ [[package]] name = "ethers-signers" -version = "2.0.11" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cb1b714e227bbd2d8c53528adb580b203009728b17d0d0e4119353aa9bc5532" +checksum = "b3b125a103b56aef008af5d5fb48191984aa326b50bfd2557d231dc499833de3" dependencies = [ "async-trait", "coins-bip32", @@ -1151,9 +1151,9 @@ dependencies = [ [[package]] name = "ethers-solc" -version = "2.0.12" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2e46e3ec8ef0c986145901fa9864205dc4dcee701f9846be2d56112d34bdea" +checksum = "d21df08582e0a43005018a858cc9b465c5fff9cf4056651be64f844e57d1f55f" dependencies = [ "cfg-if", "const-hex", @@ -1204,9 +1204,9 @@ dependencies = [ [[package]] name = "eyre" -version = "0.6.11" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6267a1fa6f59179ea4afc8e50fd8612a3cc60bc858f786ff877a4a8cb042799" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" dependencies = [ "indenter", "once_cell", @@ -1405,17 +1405,6 @@ dependencies = [ "byteorder", ] -[[package]] -name = "gateway-types" -version = "0.1.0" -dependencies = [ - "ethers", - "jsonrpsee 0.22.0", - "lib-didethresolver", - "serde", - "thiserror", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -1549,9 +1538,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" +checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" [[package]] name = "hex" @@ -1653,9 +1642,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.59" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1734,9 +1723,9 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "indexmap" -version = "2.2.2" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" +checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" dependencies = [ "equivalent", "hashbrown", @@ -1768,12 +1757,12 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ "hermit-abi", - "rustix", + "libc", "windows-sys 0.52.0", ] @@ -1803,18 +1792,18 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jobserver" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.67" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" dependencies = [ "wasm-bindgen", ] @@ -1872,7 +1861,7 @@ dependencies = [ "tokio-util", "tracing", "url", - "webpki-roots 0.26.0", + "webpki-roots 0.26.1", ] [[package]] @@ -2142,7 +2131,7 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "lib-didethresolver" version = "0.1.0" -source = "git+https://github.com/xmtp/didethresolver?branch=main#02a0e915755430cc7c47470f48dd581bca7bda4a" +source = "git+https://github.com/xmtp/didethresolver?branch=main#dd724ed9fcf18b464e57bcccfd44d8b6a7475dec" dependencies = [ "async-trait", "base64 0.21.7", @@ -2165,11 +2154,37 @@ dependencies = [ "url", ] +[[package]] +name = "lib-xps" +version = "0.1.0" +dependencies = [ + "anyhow", + "async-trait", + "ctor", + "ethers", + "futures", + "hex", + "jsonrpsee 0.22.0", + "lib-didethresolver", + "log", + "messaging", + "rand", + "registry", + "serde", + "serde_json", + "thiserror", + "tokio", + "tokio-stream", + "tracing", + "tracing-subscriber", + "xps-types", +] + [[package]] name = "libc" -version = "0.2.152" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libm" @@ -2241,12 +2256,12 @@ version = "0.1.0" dependencies = [ "async-trait", "ethers", - "gateway-types", "log", "serde", "thiserror", "tokio", "tracing", + "xps-types", ] [[package]] @@ -2257,9 +2272,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] @@ -2302,21 +2317,26 @@ 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.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", "libm", @@ -2730,7 +2750,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" dependencies = [ - "toml_edit 0.20.2", + "toml_edit 0.20.7", ] [[package]] @@ -2917,20 +2937,20 @@ version = "0.1.0" dependencies = [ "async-trait", "ethers", - "gateway-types", "lib-didethresolver", "log", "rustc-hex", "thiserror", "tokio", "tracing", + "xps-types", ] [[package]] name = "reqwest" -version = "0.11.23" +version = "0.11.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" +checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" dependencies = [ "base64 0.21.7", "bytes", @@ -2954,6 +2974,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", "tokio-rustls 0.24.1", @@ -2962,7 +2983,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 0.25.3", + "webpki-roots 0.25.4", "winreg", ] @@ -3071,9 +3092,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.30" +version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ "bitflags 2.4.2", "errno", @@ -3103,7 +3124,7 @@ dependencies = [ "log", "ring 0.17.7", "rustls-pki-types", - "rustls-webpki 0.102.1", + "rustls-webpki 0.102.2", "subtle", "zeroize", ] @@ -3154,9 +3175,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e9d979b3ce68192e42760c7810125eb6cf2ea10efae545a156063e61f314e2a" +checksum = "0a716eb65e3158e90e17cd93d855216e27bde02745ab842f2cab4a39dba1bacf" [[package]] name = "rustls-webpki" @@ -3170,9 +3191,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.1" +version = "0.102.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef4ca26037c909dedb327b48c3327d0ba91d3dd3c4e05dad328f210ffb68e95b" +checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" dependencies = [ "ring 0.17.7", "rustls-pki-types", @@ -3571,9 +3592,9 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" [[package]] name = "strum" @@ -3645,6 +3666,12 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "system-configuration" version = "0.5.1" @@ -3674,13 +3701,12 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.9.0" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" dependencies = [ "cfg-if", "fastrand", - "redox_syscall", "rustix", "windows-sys 0.52.0", ] @@ -3698,18 +3724,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", @@ -3728,12 +3754,13 @@ dependencies = [ [[package]] name = "time" -version = "0.3.31" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" +checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" dependencies = [ "deranged", "itoa", + "num-conv", "powerfmt", "serde", "time-core", @@ -3748,10 +3775,11 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" +checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" dependencies = [ + "num-conv", "time-core", ] @@ -3781,9 +3809,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.35.1" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ "backtrace", "bytes", @@ -3852,7 +3880,7 @@ dependencies = [ "tokio", "tokio-rustls 0.24.1", "tungstenite", - "webpki-roots 0.25.3", + "webpki-roots 0.25.4", ] [[package]] @@ -3872,14 +3900,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.2" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" +checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.20.2", + "toml_edit 0.22.4", ] [[package]] @@ -3904,13 +3932,11 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.20.2" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ "indexmap", - "serde", - "serde_spanned", "toml_datetime", "winnow", ] @@ -3926,6 +3952,19 @@ dependencies = [ "winnow", ] +[[package]] +name = "toml_edit" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9ffdf896f8daaabf9b66ba8e77ea1ed5ed0f72821b398aba62352e95062951" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + [[package]] name = "tower" version = "0.4.13" @@ -4187,9 +4226,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -4197,9 +4236,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" dependencies = [ "bumpalo", "log", @@ -4212,9 +4251,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.40" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" dependencies = [ "cfg-if", "js-sys", @@ -4224,9 +4263,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4234,9 +4273,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", @@ -4247,15 +4286,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" +checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" [[package]] name = "web-sys" -version = "0.3.67" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" dependencies = [ "js-sys", "wasm-bindgen", @@ -4263,15 +4302,15 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.3" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "0.26.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de2cfda980f21be5a7ed2eadb3e6fe074d56022bea2cdeb1a62eb220fc04188" +checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" dependencies = [ "rustls-pki-types", ] @@ -4450,9 +4489,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.35" +version = "0.5.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1931d78a9c73861da0134f453bb1f790ce49b2e30eba8410b4b79bac72b46a2d" +checksum = "5389a154b01683d28c77f8f68f49dea75f0a4da32557a58f68ee51ebba472d29" dependencies = [ "memchr", ] @@ -4496,30 +4535,24 @@ dependencies = [ ] [[package]] -name = "xps_gateway" +name = "xps" version = "0.1.0" dependencies = [ "anyhow", - "async-trait", "clap", - "ctor", + "lib-xps", + "tokio", +] + +[[package]] +name = "xps-types" +version = "0.1.0" +dependencies = [ "ethers", - "futures", - "gateway-types", - "hex", "jsonrpsee 0.22.0", "lib-didethresolver", - "log", - "messaging", - "rand", - "registry", "serde", - "serde_json", "thiserror", - "tokio", - "tokio-stream", - "tracing", - "tracing-subscriber", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index eb9acd3..52c9eab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,12 @@ [workspace] - -members = ["xps-gateway", "messaging", "inbox", "registry", "gateway-types"] +members = [ + "xps", + "lib-xps", + "messaging", + "inbox", + "registry", + "xps-types", +] exclude = [] @@ -22,6 +28,6 @@ thiserror = "1.0" ethers = { version = "2.0.11", features = ["abigen"] } ctor = "0.2" lib-didethresolver = { git = "https://github.com/xmtp/didethresolver", branch = "main" } -gateway-types = { path = "./gateway-types" } +xps-types = { path = "./xps-types" } rustc-hex = "2.1" hex = "0.4" diff --git a/Dockerfile b/Dockerfile index d202c15..76ea398 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ RUN sudo apt update && sudo apt install -y pkg-config openssl libssl-dev COPY --from=ghcr.io/xmtp/foundry:latest /usr/local/bin/anvil /usr/local/bin/anvil -ARG PROJECT=xps-gateway +ARG PROJECT=xps WORKDIR /workspaces/${PROJECT} COPY --chown=xmtp:xmtp . . @@ -22,8 +22,8 @@ RUN cargo check RUN cargo fmt --check RUN cargo clippy --all-features --no-deps -- -D warnings RUN cargo test --workspace --all-features -RUN CARGO_TARGET_DIR=/workspaces/${PROJECT}/target cargo install --path xps-gateway --bin=xps_gateway --root=~${USER}/.cargo/ -RUN valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose ~${USER}/.cargo/bin/xps_gateway --help +RUN CARGO_TARGET_DIR=/workspaces/${PROJECT}/target cargo install --path xps --bin=xps --root=~${USER}/.cargo/ +RUN valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose ~${USER}/.cargo/bin/xps --help CMD RUST_LOG=info cargo run -- --host 0.0.0.0 --port 8080 diff --git a/xps-gateway/Cargo.toml b/lib-xps/Cargo.toml similarity index 89% rename from xps-gateway/Cargo.toml rename to lib-xps/Cargo.toml index aa01e00..667d3b7 100644 --- a/xps-gateway/Cargo.toml +++ b/lib-xps/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "xps_gateway" +name = "lib-xps" version = "0.1.0" edition = "2021" resolver = "2" @@ -19,9 +19,8 @@ thiserror.workspace = true ethers = { workspace = true, features = ["ws"] } ctor.workspace = true lib-didethresolver.workspace = true -gateway-types.workspace = true +xps-types.workspace = true hex.workspace = true -clap = { version = "4.4.18", features = ["derive"] } rand = "0.8.5" tokio-stream = { version = "0.1", features = ["net"] } registry = { path = "../registry" } diff --git a/xps-gateway/src/lib.rs b/lib-xps/src/lib.rs similarity index 91% rename from xps-gateway/src/lib.rs rename to lib-xps/src/lib.rs index 0530979..3fd478e 100644 --- a/xps-gateway/src/lib.rs +++ b/lib-xps/src/lib.rs @@ -7,11 +7,11 @@ use ethers::{ abi::Address, providers::{Provider, Ws}, }; -use gateway_types::{CONVERSATION, DID_ETH_REGISTRY}; use jsonrpsee::server::Server; use std::str::FromStr; +use xps_types::{CONVERSATION, DID_ETH_REGISTRY}; -pub use crate::rpc::{XpsMethods, XpsServer}; +pub use crate::rpc::{XpsClient, XpsMethods, XpsServer}; use crate::types::GatewayContext; /// Entrypoint for the xps Gateway diff --git a/xps-gateway/src/rpc.rs b/lib-xps/src/rpc.rs similarity index 100% rename from xps-gateway/src/rpc.rs rename to lib-xps/src/rpc.rs diff --git a/xps-gateway/src/rpc/api.rs b/lib-xps/src/rpc/api.rs similarity index 99% rename from xps-gateway/src/rpc/api.rs rename to lib-xps/src/rpc/api.rs index 20f4cdc..d099955 100644 --- a/xps-gateway/src/rpc/api.rs +++ b/lib-xps/src/rpc/api.rs @@ -4,9 +4,10 @@ use ethers::core::types::Signature; use ethers::prelude::*; use jsonrpsee::{proc_macros::rpc, types::ErrorObjectOwned}; -use gateway_types::{GrantInstallationResult, KeyPackageResult, WalletBalance}; -use gateway_types::{Message, SendMessageResult}; use lib_didethresolver::types::XmtpAttribute; +use xps_types::{ + GrantInstallationResult, KeyPackageResult, Message, SendMessageResult, WalletBalance, +}; /// XPS JSON-RPC Interface Methods #[rpc(server, client, namespace = "xps")] diff --git a/xps-gateway/src/rpc/methods.rs b/lib-xps/src/rpc/methods.rs similarity index 97% rename from xps-gateway/src/rpc/methods.rs rename to lib-xps/src/rpc/methods.rs index 23f4abb..89aa19e 100644 --- a/xps-gateway/src/rpc/methods.rs +++ b/lib-xps/src/rpc/methods.rs @@ -10,17 +10,16 @@ use ethers::{ core::types::Signature, providers::{Middleware, ProviderError}, }; -use gateway_types::{ - GrantInstallationResult, KeyPackageResult, SendMessageResult, Unit, WalletBalance, -}; use jsonrpsee::types::ErrorObjectOwned; use lib_didethresolver::types::XmtpAttribute; use messaging::MessagingOperations; use rand::{rngs::StdRng, SeedableRng}; use std::sync::Arc; use thiserror::Error; +use xps_types::{ + GrantInstallationResult, KeyPackageResult, Message, SendMessageResult, Unit, WalletBalance, +}; -use gateway_types::Message; use messaging::error::MessagingOperationError; use registry::{error::ContactOperationError, ContactOperations}; diff --git a/xps-gateway/src/types.rs b/lib-xps/src/types.rs similarity index 100% rename from xps-gateway/src/types.rs rename to lib-xps/src/types.rs diff --git a/xps-gateway/src/util.rs b/lib-xps/src/util.rs similarity index 100% rename from xps-gateway/src/util.rs rename to lib-xps/src/util.rs diff --git a/xps-gateway/tests/integration_test.rs b/lib-xps/tests/integration_test.rs similarity index 99% rename from xps-gateway/tests/integration_test.rs rename to lib-xps/tests/integration_test.rs index 8788674..79f1d56 100644 --- a/xps-gateway/tests/integration_test.rs +++ b/lib-xps/tests/integration_test.rs @@ -8,15 +8,15 @@ use ethers::providers::Middleware; use ethers::types::{Address, Bytes, TransactionRequest, U256}; use ethers::utils::keccak256; use ethers::{signers::LocalWallet, signers::Signer}; -use gateway_types::{Message, Status, Unit}; use integration_util::*; use jsonrpsee::core::ClientError; use lib_didethresolver::{ did_registry::RegistrySignerExt, types::{DidUrl, KeyEncoding, XmtpAttribute, XmtpKeyPurpose, NULL_ADDRESS}, }; +use lib_xps::rpc::{XpsClient, DEFAULT_ATTRIBUTE_VALIDITY}; use messaging::ConversationSignerExt; -use xps_gateway::rpc::{XpsClient, DEFAULT_ATTRIBUTE_VALIDITY}; +use xps_types::{Message, Status, Unit}; #[tokio::test] async fn test_say_hello() -> Result<(), Error> { diff --git a/xps-gateway/tests/integration_util/mod.rs b/lib-xps/tests/integration_util/mod.rs similarity index 99% rename from xps-gateway/tests/integration_util/mod.rs rename to lib-xps/tests/integration_util/mod.rs index e6711ce..c418681 100644 --- a/xps-gateway/tests/integration_util/mod.rs +++ b/lib-xps/tests/integration_util/mod.rs @@ -28,7 +28,7 @@ use std::{ use tokio::time::timeout as timeout_tokio; use tracing_subscriber::{fmt, layer::SubscriberExt, util::SubscriberInitExt, EnvFilter, Registry}; -use xps_gateway::{ +use lib_xps::{ types::{GatewayContext, GatewaySigner}, XpsMethods, XpsServer, }; diff --git a/messaging/Cargo.toml b/messaging/Cargo.toml index e43cd1e..9adc9c4 100644 --- a/messaging/Cargo.toml +++ b/messaging/Cargo.toml @@ -13,4 +13,4 @@ async-trait.workspace = true ethers = { workspace = true, features = ["ws"] } serde.workspace = true thiserror.workspace = true -gateway-types.workspace = true +xps-types.workspace = true diff --git a/messaging/src/lib.rs b/messaging/src/lib.rs index e9d6e44..88a3174 100644 --- a/messaging/src/lib.rs +++ b/messaging/src/lib.rs @@ -11,7 +11,7 @@ use ethers::{ types::H256, utils::keccak256, }; -use gateway_types::{error::ExtSignerError, Message, SendMessageResult, Status}; +use xps_types::{error::ExtSignerError, Message, SendMessageResult, Status}; abigen!( Conversation, diff --git a/prod/Dockerfile b/prod/Dockerfile index ff83592..eef1d40 100644 --- a/prod/Dockerfile +++ b/prod/Dockerfile @@ -19,8 +19,8 @@ RUN cargo clippy --all-features --no-deps -- -D warnings RUN cargo test --lib RUN cargo test --doc RUN cargo build --release -RUN CARGO_TARGET_DIR=/build/target cargo install --root /xmtp --path xps-gateway --bin=xps_gateway -RUN strip /xmtp/bin/xps_gateway +RUN CARGO_TARGET_DIR=/build/target cargo install --root /xmtp --path xps --bin=xps +RUN strip /xmtp/bin/xps RUN cp CHANGELOG.md /xmtp/ RUN cp LICENSE /xmtp/ @@ -44,11 +44,11 @@ EXPOSE 8080 ENV USER=none USER none -CMD ["/xmtp/bin/xps_gateway", "--host", "0.0.0.0", "--port", "8080"] +CMD ["/xmtp/bin/xps", "--host", "0.0.0.0", "--port", "8080"] LABEL org.label-schema.build-date=$BUILD_DATE \ - org.label-schema.name="xps-gateway" \ - org.label-schema.description="xps-gateway" \ + org.label-schema.name="xps" \ + org.label-schema.description="xps" \ org.label-schema.url="https://github.com/xmtp/xps-gateway" \ org.label-schema.vcs-ref=$VCS_REF \ org.label-schema.vcs-url="git@github.com:xmtp/xps-gateway.git" \ diff --git a/registry/Cargo.toml b/registry/Cargo.toml index 0fe1573..74feccb 100644 --- a/registry/Cargo.toml +++ b/registry/Cargo.toml @@ -11,7 +11,7 @@ tracing.workspace = true tokio.workspace = true async-trait.workspace = true ethers = { workspace = true, features = ["ws"] } -gateway-types.workspace = true +xps-types.workspace = true lib-didethresolver.workspace = true rustc-hex.workspace = true thiserror.workspace = true diff --git a/registry/src/lib.rs b/registry/src/lib.rs index e54d422..2744b0e 100644 --- a/registry/src/lib.rs +++ b/registry/src/lib.rs @@ -5,10 +5,10 @@ use std::str::FromStr; use error::ContactOperationError; use ethers::types::{H160, U256}; use ethers::{core::types::Signature, providers::Middleware, types::Address}; -use gateway_types::{GrantInstallationResult, KeyPackageResult, Status}; use lib_didethresolver::types::VerificationMethodProperties; use lib_didethresolver::Resolver; use lib_didethresolver::{did_registry::DIDRegistry, types::XmtpAttribute}; +use xps_types::{GrantInstallationResult, KeyPackageResult, Status}; pub struct ContactOperations { registry: DIDRegistry, diff --git a/gateway-types/Cargo.toml b/xps-types/Cargo.toml similarity index 92% rename from gateway-types/Cargo.toml rename to xps-types/Cargo.toml index 54e9643..3996b38 100644 --- a/gateway-types/Cargo.toml +++ b/xps-types/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "gateway-types" +name = "xps-types" version = "0.1.0" edition = "2021" diff --git a/gateway-types/src/error.rs b/xps-types/src/error.rs similarity index 100% rename from gateway-types/src/error.rs rename to xps-types/src/error.rs diff --git a/gateway-types/src/lib.rs b/xps-types/src/lib.rs similarity index 100% rename from gateway-types/src/lib.rs rename to xps-types/src/lib.rs diff --git a/xps/Cargo.toml b/xps/Cargo.toml new file mode 100644 index 0000000..5d3a1d9 --- /dev/null +++ b/xps/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "xps" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +anyhow.workspace = true +tokio.workspace = true +lib-xps = { path = "../lib-xps" } +clap = { version = "4.4.18", features = ["derive"] } diff --git a/xps-gateway/src/main.rs b/xps/src/main.rs similarity index 75% rename from xps-gateway/src/main.rs rename to xps/src/main.rs index 127d370..ebde1bc 100644 --- a/xps-gateway/src/main.rs +++ b/xps/src/main.rs @@ -1,13 +1,9 @@ use anyhow::Result; use clap::Parser; -use xps_gateway::run; +use lib_xps::run; #[derive(Parser, Debug)] -#[command( - name = "xps-gateway", - version = "0.1.0", - about = "XMTP Postal Service Gateway" -)] +#[command(name = "xps", version = "0.1.0", about = "XMTP Postal Service")] struct Args { #[arg(short = 'p', long = "port", default_value_t = 0)] port: u16, @@ -28,7 +24,7 @@ mod tests { #[test] fn test_port_0() -> Result<()> { - let arg_list = vec!["xps-gateway", "-p", "0"]; + let arg_list = vec!["xps", "-p", "0"]; let args = Args::parse_from(arg_list); assert_eq!(args.port, 0); Ok(()) @@ -36,7 +32,7 @@ mod tests { #[test] fn test_port_25() -> Result<()> { - let arg_list = vec!["xps-gateway", "--port", "25"]; + let arg_list = vec!["xps", "--port", "25"]; let args = Args::parse_from(arg_list); assert_eq!(args.port, 25); Ok(()) @@ -44,7 +40,7 @@ mod tests { #[test] fn test_host_test_net() -> Result<()> { - let arg_list = vec!["xps-gateway", "-s", "test.net"]; + let arg_list = vec!["xps", "-s", "test.net"]; let args = Args::parse_from(arg_list); assert_eq!(args.host, "test.net"); Ok(()) @@ -52,7 +48,7 @@ mod tests { #[test] fn test_host_test_0000() -> Result<()> { - let arg_list = vec!["xps-gateway", "--host", "0.0.0.0"]; + let arg_list = vec!["xps", "--host", "0.0.0.0"]; let args = Args::parse_from(arg_list); assert_eq!(args.host, "0.0.0.0"); Ok(()) @@ -60,7 +56,7 @@ mod tests { #[test] fn test_default() -> Result<()> { - let arg_list = vec!["xps-gateway"]; + let arg_list = vec!["xps"]; let args = Args::parse_from(arg_list); assert_eq!(args.port, 0); assert_eq!(args.host, "127.0.0.1");