From 7de39d28dc17a0b65ac95bfe7acfb97deaa5f9ea Mon Sep 17 00:00:00 2001 From: b-yap <2826165+b-yap@users.noreply.github.com> Date: Thu, 30 May 2024 17:19:12 +0800 Subject: [PATCH 01/15] initial project structure --- signer-service-rust/Cargo.lock | 1166 ++++++++++++++++++++ signer-service-rust/Cargo.toml | 27 + signer-service-rust/rust-toolchain.toml | 3 + signer-service-rust/src/config/database.rs | 55 + signer-service-rust/src/config/error.rs | 16 + signer-service-rust/src/config/mod.rs | 64 ++ signer-service-rust/src/config/server.rs | 53 + signer-service-rust/src/infra/db.rs | 30 + signer-service-rust/src/infra/error.rs | 8 + signer-service-rust/src/infra/mod.rs | 4 + signer-service-rust/src/main.rs | 42 + 11 files changed, 1468 insertions(+) create mode 100644 signer-service-rust/Cargo.lock create mode 100644 signer-service-rust/Cargo.toml create mode 100644 signer-service-rust/rust-toolchain.toml create mode 100644 signer-service-rust/src/config/database.rs create mode 100644 signer-service-rust/src/config/error.rs create mode 100644 signer-service-rust/src/config/mod.rs create mode 100644 signer-service-rust/src/config/server.rs create mode 100644 signer-service-rust/src/infra/db.rs create mode 100644 signer-service-rust/src/infra/error.rs create mode 100644 signer-service-rust/src/infra/mod.rs create mode 100644 signer-service-rust/src/main.rs diff --git a/signer-service-rust/Cargo.lock b/signer-service-rust/Cargo.lock new file mode 100644 index 00000000..8f578453 --- /dev/null +++ b/signer-service-rust/Cargo.lock @@ -0,0 +1,1166 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" + +[[package]] +name = "async-trait" +version = "0.1.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "axum" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" +dependencies = [ + "async-trait", + "axum-core", + "axum-macros", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper 1.0.1", + "tokio", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper 0.1.2", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00c055ee2d014ae5981ce1016374e8213682aa14d9bf40e48ab48b5f3ef20eaa" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "backtrace" +version = "0.3.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" + +[[package]] +name = "cc" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "deadpool" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6541a3916932fe57768d4be0b1ffb5ec7cbf74ca8c903fdfd5c0fe8aa958f0ed" +dependencies = [ + "deadpool-runtime", + "num_cpus", + "tokio", +] + +[[package]] +name = "deadpool-diesel" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "590573e9e29c5190a5ff782136f871e6e652e35d598a349888e028693601adf1" +dependencies = [ + "deadpool", + "deadpool-sync", + "diesel", +] + +[[package]] +name = "deadpool-runtime" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "092966b41edc516079bdf31ec78a2e0588d1d0c08f78b91d8307215928642b2b" +dependencies = [ + "tokio", +] + +[[package]] +name = "deadpool-sync" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cc213ac28dbe3eda41e1c1e40fad9a04b3ee3bb12f18dee5930a36aca7fa0e8" +dependencies = [ + "deadpool-runtime", +] + +[[package]] +name = "diesel" +version = "2.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff236accb9a5069572099f0b350a92e9560e8e63a9b8d546162f4a5e03026bb2" +dependencies = [ + "bitflags", + "byteorder", + "diesel_derives", + "itoa", + "pq-sys", + "serde_json", + "uuid", +] + +[[package]] +name = "diesel_derives" +version = "2.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14701062d6bed917b5c7103bdffaee1e4609279e240488ad24e7bd979ca6866c" +dependencies = [ + "diesel_table_macro_syntax", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "diesel_migrations" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6036b3f0120c5961381b570ee20a02432d7e2d27ea60de9578799cf9156914ac" +dependencies = [ + "diesel", + "migrations_internals", + "migrations_macros", +] + +[[package]] +name = "diesel_table_macro_syntax" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" +dependencies = [ + "syn", +] + +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "gimli" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "http" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", +] + +[[package]] +name = "hyper-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" +dependencies = [ + "bytes", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "indexmap" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.155" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "migrations_internals" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f23f71580015254b020e856feac3df5878c2c7a8812297edd6c0a485ac9dada" +dependencies = [ + "serde", + "toml", +] + +[[package]] +name = "migrations_macros" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cce3325ac70e67bbab5bd837a31cae01f1a6db64e0e744a33cb03a543469ef08" +dependencies = [ + "migrations_internals", + "proc-macro2", + "quote", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "object" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pq-sys" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31c0052426df997c0cbd30789eb44ca097e3541717a7b8fa36b1c464ee7edebd" +dependencies = [ + "vcpkg", +] + +[[package]] +name = "proc-macro2" +version = "1.0.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "regex" +version = "1.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.3", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "serde" +version = "1.0.203" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.203" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" +dependencies = [ + "itoa", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "signer-service-rust" +version = "0.1.0" +dependencies = [ + "anyhow", + "axum", + "deadpool-diesel", + "diesel", + "diesel_migrations", + "dotenvy", + "serde", + "serde_json", + "tokio", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "socket2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "syn" +version = "2.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "tokio" +version = "1.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +dependencies = [ + "backtrace", + "libc", + "mio", + "num_cpus", + "pin-project-lite", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "toml" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "uuid" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +dependencies = [ + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" + +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] diff --git a/signer-service-rust/Cargo.toml b/signer-service-rust/Cargo.toml new file mode 100644 index 00000000..d1d043b0 --- /dev/null +++ b/signer-service-rust/Cargo.toml @@ -0,0 +1,27 @@ +[package] +name = "signer-service-rust" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +axum = { version = "0.7.5", features = ["macros"] } + +deadpool-diesel = { version = "0.6.1", features = ["postgres"] } +diesel = { version = "2.1.6", features = ["postgres", "serde_json", "uuid"]} +diesel_migrations = "2.1.0" + +# well-maintained fork of dotenv +dotenvy = "0.15.7" + +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" + +tokio = { version = "1.37.0", features = ["macros", "rt-multi-thread"]} + +tracing = "0.1.40" +tracing-subscriber = { version = "0.3.18", features = ["env-filter"]} + +[dev-dependencies] +anyhow = "1.0.86" \ No newline at end of file diff --git a/signer-service-rust/rust-toolchain.toml b/signer-service-rust/rust-toolchain.toml new file mode 100644 index 00000000..f3ac570b --- /dev/null +++ b/signer-service-rust/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "1.77.0" +components = ["rustfmt", "rls", "clippy"] diff --git a/signer-service-rust/src/config/database.rs b/signer-service-rust/src/config/database.rs new file mode 100644 index 00000000..37cb51ad --- /dev/null +++ b/signer-service-rust/src/config/database.rs @@ -0,0 +1,55 @@ +use std::env; +use std::fmt::{Debug, Formatter}; +use deadpool_diesel::Manager; +use crate::config::{Error, get_env_port}; +use crate::infra; + +pub struct DatabaseConfig { + host: String, + port: u16, + user: String, + pass: String +} + +impl Debug for DatabaseConfig { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + f.debug_struct("DatabaseConfig") + .field("host",&self.host) + .field("port", &self.port) + // display the first 2 letters of the username + // and fill the remaining characters with ellipsis + .field("user", &format!("{}...", &self.user.split_at(2).0)) + // password should be debug protected + .field("pass",&"******") + .finish() + } +} + +impl DatabaseConfig { + pub fn from_env() -> Result { + Ok(DatabaseConfig{ + host: env::var("DATABASE_HOST").map_err(|_| Error::MissingDatabaseHost)?, + port: get_env_port("DATABASE_PORT",Error::MissingDatabasePort)?, + user: env::var("POSTGRES_USER").map_err(|_| Error::MissingDatabaseUser)?, + pass: env::var("POSTGRES_PASSWORD").map_err(|_| Error::MissingDatabaseUser)? + }) + } + + /// Create a connection pool to the PostgreSQL database + pub fn create_connection_pool(&self) -> Manager { + Manager::new( + self.url(), + deadpool_diesel::Runtime::Tokio1 + ) + } + + // set to private, so as not to accidentally print the username and password somewhere else + fn url(&self) -> String { + format!("postgres://{}:{}@{}:{}/postgres", + self.user, + self.pass, + self.host, + self.port + ) + } +} \ No newline at end of file diff --git a/signer-service-rust/src/config/error.rs b/signer-service-rust/src/config/error.rs new file mode 100644 index 00000000..de724cd9 --- /dev/null +++ b/signer-service-rust/src/config/error.rs @@ -0,0 +1,16 @@ + + +#[derive(Debug)] +pub enum Error { + FileDoesNotExist(String), + + MissingServerHost, + MissingServerPort, + + MissingDatabaseHost, + MissingDatabasePort, + MissingDatabaseUser, + MissingDatabasePassword, + + ParseFailed(String) +} \ No newline at end of file diff --git a/signer-service-rust/src/config/mod.rs b/signer-service-rust/src/config/mod.rs new file mode 100644 index 00000000..1573113c --- /dev/null +++ b/signer-service-rust/src/config/mod.rs @@ -0,0 +1,64 @@ +mod server; +mod database; +mod error; + +use std::env; +use serde_json::error::Category::Data; +pub use server::ServerConfig; +pub use database::DatabaseConfig; +pub use error::Error; + +#[derive(Debug)] +pub struct Config { + server:ServerConfig, + database: DatabaseConfig +} + +impl Config { + pub fn from_env_file(file_name:&str) -> Result { + // Load environment variables from .env file. + if let None = dotenvy::from_filename(file_name).ok() { + tracing::error!("Failed to read file {file_name}"); + return Err(Error::FileDoesNotExist(file_name.to_string())); + }; + + Ok(Config { + server: ServerConfig::from_env()?, + database: DatabaseConfig::from_env()? + }) + } + + pub fn server_config(&self) -> &ServerConfig { + &self.server + } + + pub fn database_config(&self) -> &DatabaseConfig { + &self.database + } +} + +#[doc(hidden)] +/// helper function to get any port defined in the environment and parse to u16 +fn get_env_port(env_var_name:&str, error:Error) -> Result { + let Ok(port_as_str) = env::var(env_var_name) else { + return Err(error) + }; + + port_as_str.parse::().map_err(|_| { + tracing::error!("Failed to convert {env_var_name} {port_as_str} to type u16."); + error + }) +} + +#[cfg(test)] +mod test { + use crate::config::Config; + + #[test] + fn read_env_file_success() { + let x = Config::from_env_file(".env"); + println!("The x value: {x:#?}"); + + assert!(true); + } +} \ No newline at end of file diff --git a/signer-service-rust/src/config/server.rs b/signer-service-rust/src/config/server.rs new file mode 100644 index 00000000..551f4ce4 --- /dev/null +++ b/signer-service-rust/src/config/server.rs @@ -0,0 +1,53 @@ +use std::{ + env::{self, VarError}, + net::SocketAddr, + path::Path +}; +use crate::config::{Error, get_env_port}; +use crate::config::Error::MissingServerPort; + +const DEFAULT_SERVER_HOST:&str = "127.0.0.1"; +const DEFAULT_SERVER_PORT:u16 = 3000; + +/// Holds the address of our server +#[derive(Debug)] +pub struct ServerConfig { + host: String, + port: u16 +} + +impl Default for ServerConfig { + fn default() -> Self { + ServerConfig { + host: DEFAULT_SERVER_HOST.to_string(), + port: DEFAULT_SERVER_PORT, + } + } +} + +impl ServerConfig { + pub fn from_env() -> Result { + Ok(ServerConfig { + host: env::var("SERVER_HOST").map_err(|_| Error::MissingServerHost)?, + port: get_env_port("SERVER_PORT", MissingServerPort)? + }) + } + + pub fn host(&self) -> &str { + &self.host + } + + pub fn port(&self) -> u16 { + self.port + } + + pub fn socket_address(&self) -> Result { + let address = format!("{}:{}", self.host, self.port); + // Parse the socket address + address.parse() + .map_err(|e| { + tracing::error!("Failed to parse address {address}: {e:?}"); + Error::ParseFailed("server address".to_string()) + }) + } +} diff --git a/signer-service-rust/src/infra/db.rs b/signer-service-rust/src/infra/db.rs new file mode 100644 index 00000000..d2d08744 --- /dev/null +++ b/signer-service-rust/src/infra/db.rs @@ -0,0 +1,30 @@ +use deadpool_diesel::postgres::Pool; +use diesel_migrations::{embed_migrations, EmbeddedMigrations, MigrationHarness}; +use crate::config::DatabaseConfig; +use crate::infra::Error; + +pub const MIGRATIONS: EmbeddedMigrations = embed_migrations!("migrations/"); + +pub async fn init_db(cfg: DatabaseConfig) { + // Create a connection pool to the PostgreSQL database + let manager = cfg.create_connection_pool(); + + let pool = Pool::builder(manager).build() + .map_err(|e| { + tracing::error!("Failed to create connection pool: {e:?}"); + Error::InternalServerError + })?; + +} + +async fn run_migrations(pool: &Pool) -> Result<(),Error> { + let conn = pool.get().await + .map_err(|e| { + tracing::error!("Failed to retrieve object from connection pool: {e:?}"); + Error::PoolError + })?; + + conn.interact(|conn| conn.run_pending_migrations()) + + Ok(()) +} \ No newline at end of file diff --git a/signer-service-rust/src/infra/error.rs b/signer-service-rust/src/infra/error.rs new file mode 100644 index 00000000..07d7adb0 --- /dev/null +++ b/signer-service-rust/src/infra/error.rs @@ -0,0 +1,8 @@ + +#[derive(Debug)] +pub enum Error { + InternalServerError, + NotFound, + PoolError + +} \ No newline at end of file diff --git a/signer-service-rust/src/infra/mod.rs b/signer-service-rust/src/infra/mod.rs new file mode 100644 index 00000000..00b6f539 --- /dev/null +++ b/signer-service-rust/src/infra/mod.rs @@ -0,0 +1,4 @@ +mod db; +mod error; + +pub use error::Error; \ No newline at end of file diff --git a/signer-service-rust/src/main.rs b/signer-service-rust/src/main.rs new file mode 100644 index 00000000..4dfeb11b --- /dev/null +++ b/signer-service-rust/src/main.rs @@ -0,0 +1,42 @@ +mod config; +pub mod infra; + +use axum::Router; +use axum::routing::get; +use tracing::info; +use tracing_subscriber::{ + filter::EnvFilter, + fmt, + layer::SubscriberExt, + util::SubscriberInitExt +}; + +pub struct State; +#[tokio::main] +async fn main() { + init_tracing(); + + // let server_config = config::ServerConfig::from_env_file(".env").unwrap(); + // let server_addr = server_config.socket_address().unwrap(); + // + // let listener = tokio::net::TcpListener::bind(server_addr).await.unwrap(); + // info!("🚀{:<12} - {:?}\n", "LISTENING", listener.local_addr()); + // + // let routes = Router::new().route("/", get(root)); + // axum::serve(listener,routes).await.unwrap(); +} + +async fn root() -> &'static str { + "Server is Running!" +} + +/// initialize for logging purposes +fn init_tracing() { + tracing_subscriber::registry() + .with(fmt::layer()) + // will use the value of whatever the RUST_LOG environment variable has been set to. + .with(EnvFilter::from_default_env()) + .init(); + + +} \ No newline at end of file From 51b529a17999d3961fe98832d33e31674531a353 Mon Sep 17 00:00:00 2001 From: b-yap <2826165+b-yap@users.noreply.github.com> Date: Fri, 31 May 2024 21:28:40 +0800 Subject: [PATCH 02/15] adding operations, models, comment out db first. --- signer-service-rust/Cargo.lock | 4551 +++++++++++++++-- signer-service-rust/Cargo.toml | 8 + signer-service-rust/src/config/database.rs | 18 +- signer-service-rust/src/config/error.rs | 3 + signer-service-rust/src/config/mod.rs | 35 +- signer-service-rust/src/config/server.rs | 16 +- signer-service-rust/src/domain/mod.rs | 2 + .../src/domain/models/token.rs | 99 + signer-service-rust/src/infra/db.rs | 48 +- signer-service-rust/src/main.rs | 25 +- signer-service-rust/src/utils/mod.rs | 3 + 11 files changed, 4265 insertions(+), 543 deletions(-) create mode 100644 signer-service-rust/src/domain/mod.rs create mode 100644 signer-service-rust/src/domain/models/token.rs create mode 100644 signer-service-rust/src/utils/mod.rs diff --git a/signer-service-rust/Cargo.lock b/signer-service-rust/Cargo.lock index 8f578453..691c003d 100644 --- a/signer-service-rust/Cargo.lock +++ b/signer-service-rust/Cargo.lock @@ -2,13 +2,32 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "addr2line" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +dependencies = [ + "gimli 0.26.2", +] + [[package]] name = "addr2line" version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ - "gimli", + "gimli 0.29.0", ] [[package]] @@ -17,6 +36,30 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "ahash" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +dependencies = [ + "getrandom 0.2.15", + "once_cell", + "version_check", +] + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "getrandom 0.2.15", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.3" @@ -26,12 +69,66 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + [[package]] name = "anyhow" version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +[[package]] +name = "array-bytes" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" + +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + [[package]] name = "async-trait" version = "0.1.80" @@ -40,9 +137,15 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.66", ] +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + [[package]] name = "axum" version = "0.7.5" @@ -54,10 +157,10 @@ dependencies = [ "axum-macros", "bytes", "futures-util", - "http", - "http-body", + "http 1.1.0", + "http-body 1.0.0", "http-body-util", - "hyper", + "hyper 1.3.1", "hyper-util", "itoa", "matchit", @@ -87,8 +190,8 @@ dependencies = [ "async-trait", "bytes", "futures-util", - "http", - "http-body", + "http 1.1.0", + "http-body 1.0.0", "http-body-util", "mime", "pin-project-lite", @@ -108,7 +211,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn", + "syn 2.0.66", ] [[package]] @@ -117,883 +220,4228 @@ version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11" dependencies = [ - "addr2line", + "addr2line 0.22.0", "cc", "cfg-if", "libc", "miniz_oxide", - "object", + "object 0.35.0", "rustc-demangle", ] [[package]] -name = "bitflags" -version = "2.5.0" +name = "base16ct" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] -name = "byteorder" -version = "1.5.0" +name = "base58" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" [[package]] -name = "bytes" -version = "1.6.0" +name = "base64" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] -name = "cc" -version = "1.0.98" +name = "base64" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] -name = "cfg-if" -version = "1.0.0" +name = "base64ct" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] -name = "deadpool" -version = "0.12.1" +name = "bincode" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6541a3916932fe57768d4be0b1ffb5ec7cbf74ca8c903fdfd5c0fe8aa958f0ed" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" dependencies = [ - "deadpool-runtime", - "num_cpus", - "tokio", + "serde", ] [[package]] -name = "deadpool-diesel" -version = "0.6.1" +name = "bitflags" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "590573e9e29c5190a5ff782136f871e6e652e35d598a349888e028693601adf1" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ - "deadpool", - "deadpool-sync", - "diesel", + "funty", + "radium", + "tap", + "wyz", ] [[package]] -name = "deadpool-runtime" -version = "0.1.4" +name = "blake2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "092966b41edc516079bdf31ec78a2e0588d1d0c08f78b91d8307215928642b2b" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "tokio", + "digest 0.10.7", ] [[package]] -name = "deadpool-sync" -version = "0.1.3" +name = "blake2b_simd" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc213ac28dbe3eda41e1c1e40fad9a04b3ee3bb12f18dee5930a36aca7fa0e8" +checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" dependencies = [ - "deadpool-runtime", + "arrayref", + "arrayvec 0.7.4", + "constant_time_eq", ] [[package]] -name = "diesel" -version = "2.1.6" +name = "block-buffer" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff236accb9a5069572099f0b350a92e9560e8e63a9b8d546162f4a5e03026bb2" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" dependencies = [ - "bitflags", + "block-padding", + "byte-tools", "byteorder", - "diesel_derives", - "itoa", - "pq-sys", - "serde_json", - "uuid", + "generic-array 0.12.4", ] [[package]] -name = "diesel_derives" -version = "2.1.4" +name = "block-buffer" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14701062d6bed917b5c7103bdffaee1e4609279e240488ad24e7bd979ca6866c" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "diesel_table_macro_syntax", - "proc-macro2", - "quote", - "syn", + "generic-array 0.14.7", ] [[package]] -name = "diesel_migrations" -version = "2.1.0" +name = "block-buffer" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6036b3f0120c5961381b570ee20a02432d7e2d27ea60de9578799cf9156914ac" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "diesel", - "migrations_internals", - "migrations_macros", + "generic-array 0.14.7", ] [[package]] -name = "diesel_table_macro_syntax" -version = "0.1.0" +name = "block-padding" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" dependencies = [ - "syn", + "byte-tools", ] [[package]] -name = "dotenvy" -version = "0.15.7" +name = "bounded-collections" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" +checksum = "ca548b6163b872067dc5eb82fd130c56881435e30367d2073594a3d9744120dd" +dependencies = [ + "log", + "parity-scale-codec", + "scale-info", + "serde", +] [[package]] -name = "equivalent" -version = "1.0.1" +name = "bs58" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] -name = "fnv" -version = "1.0.7" +name = "bstringify" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +checksum = "bd769563b4ea2953e2825c9e6b7470a5f55f67e0be00030bf3e390a2a6071f64" [[package]] -name = "form_urlencoded" -version = "1.2.1" +name = "bumpalo" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] -name = "futures-channel" -version = "0.3.30" +name = "byte-slice-cast" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" -dependencies = [ - "futures-core", -] +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] -name = "futures-core" -version = "0.3.30" +name = "byte-tools" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] -name = "futures-task" -version = "0.3.30" +name = "byteorder" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] -name = "futures-util" -version = "0.3.30" +name = "bytes" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" -dependencies = [ - "futures-core", - "futures-task", - "pin-project-lite", - "pin-utils", -] +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] -name = "gimli" -version = "0.29.0" +name = "cached" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "69b0116662497bc24e4b177c90eaf8870e39e2714c3fcfa296327a93f593fc21" +dependencies = [ + "ahash 0.8.11", + "async-trait", + "cached_proc_macro", + "cached_proc_macro_types", + "futures", + "hashbrown 0.14.5", + "instant", + "once_cell", + "thiserror", + "tokio", +] [[package]] -name = "hashbrown" -version = "0.14.5" +name = "cached_proc_macro" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "c878c71c2821aa2058722038a59a67583a4240524687c6028571c9b395ded61f" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] -name = "heck" -version = "0.4.1" +name = "cached_proc_macro_types" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "ade8366b8bd5ba243f0a58f036cc0ca8a2f069cff1a2351ef1cac6b083e16fc0" [[package]] -name = "hermit-abi" -version = "0.3.9" +name = "cc" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" [[package]] -name = "http" -version = "1.1.0" +name = "cfg-expr" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "0aacacf4d96c24b2ad6eb8ee6df040e4f27b0d0b39a5710c30091baa830485db" dependencies = [ - "bytes", - "fnv", - "itoa", + "smallvec", ] [[package]] -name = "http-body" +name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" -dependencies = [ - "bytes", - "http", -] +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "http-body-util" -version = "0.1.1" +name = "chrono" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ - "bytes", - "futures-core", - "http", - "http-body", - "pin-project-lite", + "android-tzdata", + "iana-time-zone", + "num-traits", + "windows-targets 0.52.5", ] [[package]] -name = "httparse" -version = "1.8.0" +name = "const-oid" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] -name = "httpdate" -version = "1.0.3" +name = "constant_time_eq" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] -name = "hyper" -version = "1.3.1" +name = "core-foundation" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", + "core-foundation-sys", + "libc", ] [[package]] -name = "hyper-util" -version = "0.1.5" +name = "core-foundation-sys" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "cpp_demangle" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" dependencies = [ - "bytes", - "futures-util", - "http", - "http-body", - "hyper", - "pin-project-lite", - "tokio", + "cfg-if", ] [[package]] -name = "indexmap" -version = "2.2.6" +name = "cpufeatures" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ - "equivalent", - "hashbrown", + "libc", ] [[package]] -name = "itoa" -version = "1.0.11" +name = "cranelift-entity" +version = "0.93.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "f42ea692c7b450ad18b8c9889661505d51c09ec4380cf1c2d278dbb2da22cae1" +dependencies = [ + "serde", +] [[package]] -name = "lazy_static" -version = "1.4.0" +name = "crc32fast" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] [[package]] -name = "libc" -version = "0.2.155" +name = "crunchy" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] -name = "log" -version = "0.4.21" +name = "crypto-bigint" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array 0.14.7", + "rand_core 0.6.4", + "subtle", + "zeroize", +] [[package]] -name = "matchers" -version = "0.1.0" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "regex-automata 0.1.10", + "generic-array 0.14.7", + "typenum", ] [[package]] -name = "matchit" -version = "0.7.3" +name = "crypto-mac" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array 0.14.7", + "subtle", +] [[package]] -name = "memchr" -version = "2.7.2" +name = "crypto-mac" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +dependencies = [ + "generic-array 0.14.7", + "subtle", +] [[package]] -name = "migrations_internals" -version = "2.1.0" +name = "curve25519-dalek" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f23f71580015254b020e856feac3df5878c2c7a8812297edd6c0a485ac9dada" +checksum = "4a9b85542f99a2dfa2a1b8e192662741c9859a846b296bef1c92ef9b58b5a216" dependencies = [ - "serde", - "toml", + "byteorder", + "digest 0.8.1", + "rand_core 0.5.1", + "subtle", + "zeroize", ] [[package]] -name = "migrations_macros" -version = "2.1.0" +name = "curve25519-dalek" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cce3325ac70e67bbab5bd837a31cae01f1a6db64e0e744a33cb03a543469ef08" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" dependencies = [ - "migrations_internals", - "proc-macro2", - "quote", + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle", + "zeroize", ] [[package]] -name = "mime" -version = "0.3.17" +name = "curve25519-dalek" +version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "platforms", + "rustc_version", + "subtle", + "zeroize", +] [[package]] -name = "miniz_oxide" -version = "0.7.3" +name = "curve25519-dalek-derive" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ - "adler", + "proc-macro2", + "quote", + "syn 2.0.66", ] [[package]] -name = "mio" -version = "0.8.11" +name = "darling" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" dependencies = [ - "libc", - "wasi", - "windows-sys 0.48.0", + "darling_core", + "darling_macro", ] [[package]] -name = "nu-ansi-term" -version = "0.46.0" +name = "darling_core" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" dependencies = [ - "overload", - "winapi", + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", ] [[package]] -name = "num_cpus" -version = "1.16.0" +name = "darling_macro" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" dependencies = [ - "hermit-abi", - "libc", + "darling_core", + "quote", + "syn 1.0.109", ] [[package]] -name = "object" -version = "0.35.0" +name = "deadpool" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" +checksum = "6541a3916932fe57768d4be0b1ffb5ec7cbf74ca8c903fdfd5c0fe8aa958f0ed" dependencies = [ - "memchr", + "deadpool-runtime", + "num_cpus", + "tokio", ] [[package]] -name = "once_cell" -version = "1.19.0" +name = "deadpool-diesel" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "590573e9e29c5190a5ff782136f871e6e652e35d598a349888e028693601adf1" +dependencies = [ + "deadpool", + "deadpool-sync", + "diesel", +] [[package]] -name = "overload" -version = "0.1.1" +name = "deadpool-runtime" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +checksum = "092966b41edc516079bdf31ec78a2e0588d1d0c08f78b91d8307215928642b2b" +dependencies = [ + "tokio", +] [[package]] -name = "percent-encoding" -version = "2.3.1" +name = "deadpool-sync" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "2cc213ac28dbe3eda41e1c1e40fad9a04b3ee3bb12f18dee5930a36aca7fa0e8" +dependencies = [ + "deadpool-runtime", +] [[package]] -name = "pin-project" -version = "1.1.5" +name = "der" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ - "pin-project-internal", + "const-oid", + "zeroize", ] [[package]] -name = "pin-project-internal" -version = "1.1.5" +name = "derive-syn-parse" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pq-sys" -version = "0.4.8" +name = "derive_more" +version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0052426df997c0cbd30789eb44ca097e3541717a7b8fa36b1c464ee7edebd" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ - "vcpkg", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] -name = "proc-macro2" -version = "1.0.84" +name = "diesel" +version = "2.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" +checksum = "ff236accb9a5069572099f0b350a92e9560e8e63a9b8d546162f4a5e03026bb2" dependencies = [ - "unicode-ident", + "bitflags 2.5.0", + "byteorder", + "diesel_derives", + "itoa", + "pq-sys", + "serde_json", + "uuid", ] [[package]] -name = "quote" -version = "1.0.36" +name = "diesel_derives" +version = "2.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "14701062d6bed917b5c7103bdffaee1e4609279e240488ad24e7bd979ca6866c" dependencies = [ + "diesel_table_macro_syntax", "proc-macro2", + "quote", + "syn 2.0.66", ] [[package]] -name = "regex" -version = "1.10.4" +name = "diesel_migrations" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "6036b3f0120c5961381b570ee20a02432d7e2d27ea60de9578799cf9156914ac" dependencies = [ - "aho-corasick", - "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", + "diesel", + "migrations_internals", + "migrations_macros", ] [[package]] -name = "regex-automata" -version = "0.1.10" +name = "diesel_table_macro_syntax" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" dependencies = [ - "regex-syntax 0.6.29", + "syn 2.0.66", ] [[package]] -name = "regex-automata" -version = "0.4.6" +name = "digest" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.8.3", + "generic-array 0.12.4", ] [[package]] -name = "regex-syntax" -version = "0.6.29" +name = "digest" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array 0.14.7", +] [[package]] -name = "regex-syntax" -version = "0.8.3" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "const-oid", + "crypto-common", + "subtle", +] [[package]] -name = "rustc-demangle" -version = "0.1.24" +name = "dotenv" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" [[package]] -name = "rustversion" -version = "1.0.17" +name = "dotenvy" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] -name = "ryu" -version = "1.0.18" +name = "downcast-rs" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] -name = "serde" -version = "1.0.203" +name = "dyn-clonable" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "4e9232f0e607a262ceb9bd5141a3dfb3e4db6994b31989bbfd845878cba59fd4" dependencies = [ - "serde_derive", + "dyn-clonable-impl", + "dyn-clone", ] [[package]] -name = "serde_derive" -version = "1.0.203" +name = "dyn-clonable-impl" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] -name = "serde_json" -version = "1.0.117" +name = "dyn-clone" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ - "itoa", - "ryu", - "serde", + "der", + "digest 0.10.7", + "elliptic-curve", + "rfc6979", + "signature 2.2.0", + "spki", ] [[package]] -name = "serde_path_to_error" -version = "0.1.16" +name = "ed25519" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" dependencies = [ - "itoa", - "serde", + "signature 1.6.4", ] [[package]] -name = "serde_spanned" -version = "0.6.6" +name = "ed25519-dalek" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" dependencies = [ - "serde", + "curve25519-dalek 3.2.0", + "ed25519", + "sha2 0.9.9", + "zeroize", ] [[package]] -name = "serde_urlencoded" -version = "0.7.1" +name = "ed25519-zebra" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" +dependencies = [ + "curve25519-dalek 3.2.0", + "hashbrown 0.12.3", + "hex", + "rand_core 0.6.4", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "either" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest 0.10.7", + "ff", + "generic-array 0.14.7", + "group", + "pkcs8", + "rand_core 0.6.4", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "encoding_rs" +version = "0.8.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "environmental" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "expander" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f360349150728553f92e4c997a16af8915f418d3a0f21b440d34c5632f16ed84" +dependencies = [ + "blake2", + "fs-err", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fastrand" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "fixed-hash" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +dependencies = [ + "byteorder", + "rand 0.8.5", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "frame-metadata" +version = "15.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "878babb0b136e731cc77ec2fd883ff02745ff21e6fb662729953d44923df009c" +dependencies = [ + "cfg-if", + "parity-scale-codec", + "scale-info", + "serde", +] + +[[package]] +name = "frame-support" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "bitflags 1.3.2", + "environmental", + "frame-metadata", + "frame-support-procedural", + "impl-trait-for-tuples", + "k256", + "log", + "once_cell", + "parity-scale-codec", + "paste", + "scale-info", + "serde", + "smallvec", + "sp-api", + "sp-arithmetic", + "sp-core", + "sp-core-hashing-proc-macro", + "sp-inherents", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-state-machine", + "sp-std", + "sp-tracing", + "sp-weights", + "tt-call", +] + +[[package]] +name = "frame-support-procedural" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "Inflector", + "cfg-expr", + "derive-syn-parse", + "frame-support-procedural-tools", + "itertools", + "proc-macro-warning", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "frame-support-procedural-tools" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "frame-support-procedural-tools-derive", + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "frame-support-procedural-tools-derive" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "fs-err" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", + "num_cpus", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom_or_panic" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "gimli" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +dependencies = [ + "fallible-iterator", + "stable_deref_trait", +] + +[[package]] +name = "gimli" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.12", + "indexmap 2.2.6", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hash-db" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e7d7786361d7425ae2fe4f9e407eb0efaa0840f5212d109cc018c40c35c6ab4" + +[[package]] +name = "hash256-std-hasher" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" +dependencies = [ + "crunchy", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.8", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.11", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash 0.8.11", + "allocator-api2", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac 0.8.0", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +dependencies = [ + "crypto-mac 0.11.1", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array 0.14.7", + "hmac 0.8.1", +] + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http 0.2.12", + "pin-project-lite", +] + +[[package]] +name = "http-body" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +dependencies = [ + "bytes", + "http 1.1.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +dependencies = [ + "bytes", + "futures-core", + "http 1.1.0", + "http-body 1.0.0", + "pin-project-lite", +] + +[[package]] +name = "http-range-header" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08a397c49fec283e3d6211adbe480be95aae5f304cfb923e9970e08956d5168a" + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "0.14.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http 0.2.12", + "http-body 0.4.6", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper 0.14.28", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "hyper-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" +dependencies = [ + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "hyper 1.3.1", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-serde" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" +dependencies = [ + "serde", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "index-fixed" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161ceaf2f41b6cd3f6502f5da085d4ad4393a51e0c70ed2fce1d5698d798fae" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +dependencies = [ + "equivalent", + "hashbrown 0.14.5", +] + +[[package]] +name = "instant" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "integer-sqrt" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" +dependencies = [ + "num-traits", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "js-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "k256" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "once_cell", + "sha2 0.10.8", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin", +] + +[[package]] +name = "libc" +version = "0.2.155" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "libsecp256k1" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" +dependencies = [ + "arrayref", + "base64 0.13.1", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.8.5", + "serde", + "sha2 0.9.9", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "mach" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +dependencies = [ + "libc", +] + +[[package]] +name = "matchers" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "memfd" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" +dependencies = [ + "rustix 0.38.34", +] + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memory-db" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" +dependencies = [ + "hash-db", +] + +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + +[[package]] +name = "merlin" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e261cf0f8b3c42ded9f7d2bb59dea03aa52bc8a1cbc7482f9fc3fd1229d3b42" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.5.1", + "zeroize", +] + +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.6.4", + "zeroize", +] + +[[package]] +name = "migrations_internals" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f23f71580015254b020e856feac3df5878c2c7a8812297edd6c0a485ac9dada" +dependencies = [ + "serde", + "toml", +] + +[[package]] +name = "migrations_macros" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cce3325ac70e67bbab5bd837a31cae01f1a6db64e0e744a33cb03a543469ef08" +dependencies = [ + "migrations_internals", + "proc-macro2", + "quote", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "miniz_oxide" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.48.0", +] + +[[package]] +name = "native-tls" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-bigint" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-format" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +dependencies = [ + "arrayvec 0.7.4", + "itoa", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "object" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +dependencies = [ + "crc32fast", + "hashbrown 0.12.3", + "indexmap 1.9.3", + "memchr", +] + +[[package]] +name = "object" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "openssl" +version = "0.10.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +dependencies = [ + "bitflags 2.5.0", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "parity-scale-codec" +version = "3.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" +dependencies = [ + "arrayvec 0.7.4", + "bitvec", + "byte-slice-cast", + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" +dependencies = [ + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "parity-wasm" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.5", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pbkdf2" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" +dependencies = [ + "crypto-mac 0.11.1", +] + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "platforms" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "pq-sys" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31c0052426df997c0cbd30789eb44ca097e3541717a7b8fa36b1c464ee7edebd" +dependencies = [ + "vcpkg", +] + +[[package]] +name = "primitive-types" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +dependencies = [ + "fixed-hash", + "impl-codec", + "impl-serde", + "scale-info", + "uint", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit 0.21.1", +] + +[[package]] +name = "proc-macro-warning" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e99670bafb56b9a106419397343bdbc8b8742c3cc449fec6345f86173f47cd4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "proc-macro2" +version = "1.0.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "psm" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +dependencies = [ + "cc", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.15", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "redox_syscall" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] + +[[package]] +name = "ref-cast" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "regex" +version = "1.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.3", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" + +[[package]] +name = "reqwest" +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "base64 0.21.7", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.28", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 0.1.2", + "system-configuration", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac 0.12.1", + "subtle", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.36.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.1.4", + "windows-sys 0.45.0", +] + +[[package]] +name = "rustix" +version = "0.38.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys 0.4.14", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "scale-info" +version = "2.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" +dependencies = [ + "bitvec", + "cfg-if", + "derive_more", + "parity-scale-codec", + "scale-info-derive", + "serde", +] + +[[package]] +name = "scale-info-derive" +version = "2.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" +dependencies = [ + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "schannel" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "schnellru" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9a8ef13a93c54d20580de1e5c413e624e53121d42fc7e2c11d10ef7f8b02367" +dependencies = [ + "ahash 0.8.11", + "cfg-if", + "hashbrown 0.13.2", +] + +[[package]] +name = "schnorrkel" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "curve25519-dalek 2.1.3", + "getrandom 0.1.16", + "merlin 2.0.1", + "rand 0.7.3", + "rand_core 0.5.1", + "sha2 0.8.2", + "subtle", + "zeroize", +] + +[[package]] +name = "schnorrkel" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de18f6d8ba0aad7045f5feae07ec29899c1112584a38509a84ad7b04451eaa0" +dependencies = [ + "arrayref", + "arrayvec 0.7.4", + "curve25519-dalek 4.1.2", + "getrandom_or_panic", + "merlin 3.0.0", + "rand_core 0.6.4", + "sha2 0.10.8", + "subtle", + "zeroize", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array 0.14.7", + "pkcs8", + "subtle", + "zeroize", +] + +[[package]] +name = "secp256k1" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" +dependencies = [ + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" +dependencies = [ + "cc", +] + +[[package]] +name = "secrecy" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "zeroize", +] + +[[package]] +name = "security-framework" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" +dependencies = [ + "bitflags 2.5.0", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.203" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.203" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "serde_json" +version = "1.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" +dependencies = [ + "itoa", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ - "form_urlencoded", - "itoa", - "ryu", + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" +dependencies = [ + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug 0.2.3", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.1", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest 0.10.7", + "rand_core 0.6.4", +] + +[[package]] +name = "signer-service-rust" +version = "0.1.0" +dependencies = [ + "anyhow", + "axum", + "deadpool-diesel", + "diesel", + "diesel_migrations", + "dotenvy", + "hex", + "serde", + "serde_json", + "substrate-stellar-sdk", + "tokio", + "tower-http", + "tracing", + "tracing-subscriber 0.3.18", + "wallet", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "socket2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "sodalite" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41784a359d15c58bba298cccb7f30a847a1a42d0620c9bdaa0aa42fdb3c280e0" +dependencies = [ + "index-fixed", +] + +[[package]] +name = "sp-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", + "scale-info", + "sp-api-proc-macro", + "sp-core", + "sp-metadata-ir", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-trie", + "sp-version", + "thiserror", +] + +[[package]] +name = "sp-api-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "Inflector", + "blake2", + "expander", + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "sp-application-crypto" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-std", +] + +[[package]] +name = "sp-arithmetic" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "integer-sqrt", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "sp-std", + "static_assertions", +] + +[[package]] +name = "sp-core" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "array-bytes", + "bitflags 1.3.2", + "blake2", + "bounded-collections", + "bs58", + "dyn-clonable", + "ed25519-zebra", + "futures", + "hash-db", + "hash256-std-hasher", + "impl-serde", + "lazy_static", + "libsecp256k1", + "log", + "merlin 2.0.1", + "parity-scale-codec", + "parking_lot", + "paste", + "primitive-types", + "rand 0.8.5", + "regex", + "scale-info", + "schnorrkel 0.9.1", + "secp256k1", + "secrecy", + "serde", + "sp-core-hashing", + "sp-debug-derive", + "sp-externalities", + "sp-runtime-interface", + "sp-std", + "sp-storage", + "ss58-registry", + "substrate-bip39", + "thiserror", + "tiny-bip39", + "zeroize", +] + +[[package]] +name = "sp-core-hashing" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "blake2b_simd", + "byteorder", + "digest 0.10.7", + "sha2 0.10.8", + "sha3", + "sp-std", + "twox-hash", +] + +[[package]] +name = "sp-core-hashing-proc-macro" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "proc-macro2", + "quote", + "sp-core-hashing", + "syn 2.0.66", +] + +[[package]] +name = "sp-debug-derive" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "sp-externalities" +version = "0.13.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-std", + "sp-storage", +] + +[[package]] +name = "sp-inherents" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "async-trait", + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", + "thiserror", +] + +[[package]] +name = "sp-io" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "bytes", + "ed25519", + "ed25519-dalek", + "futures", + "libsecp256k1", + "log", + "parity-scale-codec", + "rustversion", + "secp256k1", + "sp-core", + "sp-externalities", + "sp-keystore", + "sp-runtime-interface", + "sp-state-machine", + "sp-std", + "sp-tracing", + "sp-trie", + "tracing", + "tracing-core", +] + +[[package]] +name = "sp-keystore" +version = "0.13.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "futures", + "parity-scale-codec", + "parking_lot", + "sp-core", + "sp-externalities", + "thiserror", +] + +[[package]] +name = "sp-metadata-ir" +version = "0.1.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "frame-metadata", + "parity-scale-codec", + "scale-info", + "sp-std", +] + +[[package]] +name = "sp-panic-handler" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "backtrace", + "lazy_static", + "regex", +] + +[[package]] +name = "sp-runtime" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "either", + "hash256-std-hasher", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "paste", + "rand 0.8.5", + "scale-info", + "serde", + "sp-application-crypto", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-std", + "sp-weights", +] + +[[package]] +name = "sp-runtime-interface" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec", + "primitive-types", + "sp-externalities", + "sp-runtime-interface-proc-macro", + "sp-std", + "sp-storage", + "sp-tracing", + "sp-wasm-interface", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "Inflector", + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "sp-staking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-state-machine" +version = "0.13.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", + "parking_lot", + "rand 0.8.5", + "smallvec", + "sp-core", + "sp-externalities", + "sp-panic-handler", + "sp-std", + "sp-trie", + "thiserror", + "tracing", +] + +[[package]] +name = "sp-std" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" + +[[package]] +name = "sp-storage" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive", + "sp-std", +] + +[[package]] +name = "sp-tracing" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "parity-scale-codec", + "sp-std", + "tracing", + "tracing-core", + "tracing-subscriber 0.2.25", +] + +[[package]] +name = "sp-trie" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "ahash 0.8.11", + "hash-db", + "hashbrown 0.13.2", + "lazy_static", + "memory-db", + "nohash-hasher", + "parity-scale-codec", + "parking_lot", + "scale-info", + "schnellru", + "sp-core", + "sp-std", + "thiserror", + "tracing", + "trie-db", + "trie-root", +] + +[[package]] +name = "sp-version" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "parity-wasm", + "scale-info", + "serde", + "sp-core-hashing-proc-macro", + "sp-runtime", + "sp-std", + "sp-version-proc-macro", + "thiserror", +] + +[[package]] +name = "sp-version-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "parity-scale-codec", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "sp-wasm-interface" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "anyhow", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "sp-std", + "wasmi", + "wasmtime", +] + +[[package]] +name = "sp-weights" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "smallvec", + "sp-arithmetic", + "sp-core", + "sp-debug-derive", + "sp-std", +] + +[[package]] +name = "spacewalk-primitives" +version = "1.0.7" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=e7a672ba1e21c98a70df30a6ee458317951dd597#e7a672ba1e21c98a70df30a6ee458317951dd597" +dependencies = [ + "base58", + "bstringify", + "frame-support", + "hex", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-std", + "substrate-stellar-sdk", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "ss58-registry" +version = "1.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4743ce898933fbff7bbf414f497c459a782d496269644b3d650a398ae6a487ba" +dependencies = [ + "Inflector", + "num-format", + "proc-macro2", + "quote", + "serde", + "serde_json", + "unicode-xid", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "substrate-bip39" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a7590dc041b9bc2825e52ce5af8416c73dbe9d0654402bfd4b4941938b94d8f" +dependencies = [ + "hmac 0.11.0", + "pbkdf2 0.8.0", + "schnorrkel 0.11.4", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "substrate-stellar-sdk" +version = "0.2.4" +source = "git+https://github.com/pendulum-chain/substrate-stellar-sdk?branch=polkadot-v0.9.42#752c0fa27ffd244fc26fbf2e6988eedcba2cd497" +dependencies = [ + "base64 0.13.1", + "hex", + "lazy_static", + "num-rational", + "scale-info", + "serde", + "serde_json", + "sha2 0.9.9", + "sodalite", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "target-lexicon" +version = "0.12.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" + +[[package]] +name = "tempfile" +version = "3.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +dependencies = [ + "cfg-if", + "fastrand", + "rustix 0.38.34", + "windows-sys 0.52.0", +] + +[[package]] +name = "thiserror" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "tiny-bip39" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62cc94d358b5a1e84a5cb9109f559aa3c4d634d2b1b4de3d0fa4adc7c78e2861" +dependencies = [ + "anyhow", + "hmac 0.12.1", + "once_cell", + "pbkdf2 0.11.0", + "rand 0.8.5", + "rustc-hash", + "sha2 0.10.8", + "thiserror", + "unicode-normalization", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "tokio-metrics" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcb585a0069b53171684e22d5255984ec30d1c7304fd0a4a9a603ffd8c765cdd" +dependencies = [ + "futures-util", + "pin-project-lite", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", + "tokio-util", +] + +[[package]] +name = "tokio-util" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.19.15", +] + +[[package]] +name = "toml_datetime" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.2.6", "serde", + "serde_spanned", + "toml_datetime", + "winnow", ] [[package]] -name = "sharded-slab" -version = "0.1.7" +name = "toml_edit" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "lazy_static", + "indexmap 2.2.6", + "toml_datetime", + "winnow", ] [[package]] -name = "signer-service-rust" -version = "0.1.0" +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ - "anyhow", - "axum", - "deadpool-diesel", - "diesel", - "diesel_migrations", - "dotenvy", + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" +dependencies = [ + "bitflags 2.5.0", + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "http-range-header", + "httpdate", + "mime", + "mime_guess", + "percent-encoding", + "pin-project-lite", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + +[[package]] +name = "tracing-log" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-serde" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +dependencies = [ + "serde", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +dependencies = [ + "ansi_term", + "chrono", + "lazy_static", + "matchers 0.0.1", + "regex", "serde", "serde_json", - "tokio", + "sharded-slab", + "smallvec", + "thread_local", "tracing", - "tracing-subscriber", + "tracing-core", + "tracing-log 0.1.4", + "tracing-serde", ] [[package]] -name = "smallvec" -version = "1.13.2" +name = "tracing-subscriber" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers 0.1.0", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log 0.2.0", +] [[package]] -name = "socket2" -version = "0.5.7" +name = "trie-db" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "767abe6ffed88a1889671a102c2861ae742726f52e0a5a425b92c9fbfa7e9c85" dependencies = [ - "libc", - "windows-sys 0.52.0", + "hash-db", + "hashbrown 0.13.2", + "log", + "rustc-hex", + "smallvec", +] + +[[package]] +name = "trie-root" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4ed310ef5ab98f5fa467900ed906cb9232dd5376597e00fd4cba2a449d06c0b" +dependencies = [ + "hash-db", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "tt-call" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f195fd851901624eee5a58c4bb2b4f06399148fcd0ed336e6f1cb60a9881df" + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "digest 0.10.7", + "rand 0.8.5", + "static_assertions", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "uuid" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wallet" +version = "1.0.7" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=e7a672ba1e21c98a70df30a6ee458317951dd597#e7a672ba1e21c98a70df30a6ee458317951dd597" +dependencies = [ + "async-trait", + "cached", + "dotenv", + "futures", + "parity-scale-codec", + "rand 0.8.5", + "reqwest", + "serde", + "serde_json", + "spacewalk-primitives", + "thiserror", + "tokio", + "tokio-metrics", + "tokio-stream", + "tracing", + "tracing-futures", + "tracing-subscriber 0.2.25", ] [[package]] -name = "syn" -version = "2.0.66" +name = "want" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", + "try-lock", ] [[package]] -name = "sync_wrapper" -version = "0.1.2" +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] -name = "sync_wrapper" -version = "1.0.1" +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] -name = "thread_local" -version = "1.1.8" +name = "wasm-bindgen" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", - "once_cell", + "wasm-bindgen-macro", ] [[package]] -name = "tokio" -version = "1.37.0" +name = "wasm-bindgen-backend" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ - "backtrace", - "libc", - "mio", - "num_cpus", - "pin-project-lite", - "socket2", - "tokio-macros", - "windows-sys 0.48.0", + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.66", + "wasm-bindgen-shared", ] [[package]] -name = "tokio-macros" -version = "2.2.0" +name = "wasm-bindgen-futures" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ - "proc-macro2", - "quote", - "syn", + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", ] [[package]] -name = "toml" -version = "0.7.8" +name = "wasm-bindgen-macro" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", + "quote", + "wasm-bindgen-macro-support", ] [[package]] -name = "toml_datetime" -version = "0.6.6" +name = "wasm-bindgen-macro-support" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ - "serde", + "proc-macro2", + "quote", + "syn 2.0.66", + "wasm-bindgen-backend", + "wasm-bindgen-shared", ] [[package]] -name = "toml_edit" -version = "0.19.15" +name = "wasm-bindgen-shared" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" + +[[package]] +name = "wasmi" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06c326c93fbf86419608361a2c925a31754cf109da1b8b55737070b4d6669422" dependencies = [ - "indexmap", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", + "parity-wasm", + "wasmi-validation", + "wasmi_core", ] [[package]] -name = "tower" -version = "0.4.13" +name = "wasmi-validation" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +checksum = "91ff416ad1ff0c42e5a926ed5d5fab74c0f098749aa0ad8b2a34b982ce0e867b" dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", - "tracing", + "parity-wasm", ] [[package]] -name = "tower-layer" -version = "0.3.2" +name = "wasmi_core" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "57d20cb3c59b788653d99541c646c561c9dd26506f25c0cebfe810659c54c6d7" +dependencies = [ + "downcast-rs", + "libm", + "memory_units", + "num-rational", + "num-traits", +] [[package]] -name = "tower-service" -version = "0.3.2" +name = "wasmparser" +version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "64b20236ab624147dfbb62cf12a19aaf66af0e41b8398838b66e997d07d269d4" +dependencies = [ + "indexmap 1.9.3", + "url", +] [[package]] -name = "tracing" -version = "0.1.40" +name = "wasmtime" +version = "6.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "76a222f5fa1e14b2cefc286f1b68494d7a965f4bf57ec04c59bb62673d639af6" dependencies = [ + "anyhow", + "bincode", + "cfg-if", + "indexmap 1.9.3", + "libc", "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", + "object 0.29.0", + "once_cell", + "paste", + "psm", + "serde", + "target-lexicon", + "wasmparser", + "wasmtime-environ", + "wasmtime-jit", + "wasmtime-runtime", + "windows-sys 0.42.0", ] [[package]] -name = "tracing-attributes" -version = "0.1.27" +name = "wasmtime-asm-macros" +version = "6.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "4407a7246e7d2f3d8fb1cf0c72fda8dbafdb6dd34d555ae8bea0e5ae031089cc" dependencies = [ - "proc-macro2", - "quote", - "syn", + "cfg-if", ] [[package]] -name = "tracing-core" -version = "0.1.32" +name = "wasmtime-environ" +version = "6.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "47b8b50962eae38ee319f7b24900b7cf371f03eebdc17400c1dc8575fc10c9a7" dependencies = [ - "once_cell", - "valuable", + "anyhow", + "cranelift-entity", + "gimli 0.26.2", + "indexmap 1.9.3", + "log", + "object 0.29.0", + "serde", + "target-lexicon", + "thiserror", + "wasmparser", + "wasmtime-types", ] [[package]] -name = "tracing-log" -version = "0.2.0" +name = "wasmtime-jit" +version = "6.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +checksum = "ffaed4f9a234ba5225d8e64eac7b4a5d13b994aeb37353cde2cbeb3febda9eaa" dependencies = [ + "addr2line 0.17.0", + "anyhow", + "bincode", + "cfg-if", + "cpp_demangle", + "gimli 0.26.2", "log", - "once_cell", - "tracing-core", + "object 0.29.0", + "rustc-demangle", + "serde", + "target-lexicon", + "wasmtime-environ", + "wasmtime-jit-icache-coherence", + "wasmtime-runtime", + "windows-sys 0.42.0", ] [[package]] -name = "tracing-subscriber" -version = "0.3.18" +name = "wasmtime-jit-debug" +version = "6.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "eed41cbcbf74ce3ff6f1d07d1b707888166dc408d1a880f651268f4f7c9194b2" dependencies = [ - "matchers", - "nu-ansi-term", "once_cell", - "regex", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", ] [[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "uuid" -version = "1.8.0" +name = "wasmtime-jit-icache-coherence" +version = "6.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" +checksum = "43a28ae1e648461bfdbb79db3efdaee1bca5b940872e4175390f465593a2e54c" +dependencies = [ + "cfg-if", + "libc", + "windows-sys 0.42.0", +] [[package]] -name = "valuable" -version = "0.1.0" +name = "wasmtime-runtime" +version = "6.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "e704b126e4252788ccfc3526d4d4511d4b23c521bf123e447ac726c14545217b" +dependencies = [ + "anyhow", + "cc", + "cfg-if", + "indexmap 1.9.3", + "libc", + "log", + "mach", + "memfd", + "memoffset", + "paste", + "rand 0.8.5", + "rustix 0.36.17", + "wasmtime-asm-macros", + "wasmtime-environ", + "wasmtime-jit-debug", + "windows-sys 0.42.0", +] [[package]] -name = "vcpkg" -version = "0.2.15" +name = "wasmtime-types" +version = "6.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" +checksum = "83e5572c5727c1ee7e8f28717aaa8400e4d22dcbd714ea5457d85b5005206568" +dependencies = [ + "cranelift-entity", + "serde", + "thiserror", + "wasmparser", +] [[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +name = "web-sys" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +dependencies = [ + "js-sys", + "wasm-bindgen", +] [[package]] name = "winapi" @@ -1017,6 +4465,39 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -1035,6 +4516,21 @@ dependencies = [ "windows-targets 0.52.5", ] +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -1066,6 +4562,12 @@ dependencies = [ "windows_x86_64_msvc 0.52.5", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -1078,6 +4580,12 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -1090,6 +4598,12 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -1108,6 +4622,12 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -1120,6 +4640,12 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -1132,6 +4658,12 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -1144,6 +4676,12 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -1164,3 +4702,62 @@ checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ "memchr", ] + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "zerocopy" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] diff --git a/signer-service-rust/Cargo.toml b/signer-service-rust/Cargo.toml index d1d043b0..2265b5d6 100644 --- a/signer-service-rust/Cargo.toml +++ b/signer-service-rust/Cargo.toml @@ -15,11 +15,19 @@ diesel_migrations = "2.1.0" # well-maintained fork of dotenv dotenvy = "0.15.7" +hex = { version = "0.4.3", default-features = false, features = ['alloc'] } + serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" +# pendulum libs +wallet = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev ="e7a672ba1e21c98a70df30a6ee458317951dd597"} +substrate-stellar-sdk = {git = "https://github.com/pendulum-chain/substrate-stellar-sdk", branch = "polkadot-v0.9.42", default-features = false, features = ['all-types']} + tokio = { version = "1.37.0", features = ["macros", "rt-multi-thread"]} +tower-http = { version = "0.5.2", features = ["fs"]} + tracing = "0.1.40" tracing-subscriber = { version = "0.3.18", features = ["env-filter"]} diff --git a/signer-service-rust/src/config/database.rs b/signer-service-rust/src/config/database.rs index 37cb51ad..d0600e4b 100644 --- a/signer-service-rust/src/config/database.rs +++ b/signer-service-rust/src/config/database.rs @@ -1,8 +1,12 @@ use std::env; use std::fmt::{Debug, Formatter}; use deadpool_diesel::Manager; -use crate::config::{Error, get_env_port}; -use crate::infra; +use crate::config::{Error, try_get_port_from_env}; + +const DATABASE_HOST:&str = "DATABASE_HOST"; +const DATABASE_PORT:&str = "DATABASE_PORT"; +const POSTGRES_USER:&str = "POSTGRES_USER"; +const POSTGRES_PASSWORD:&str = "POSTGRES_PASSWORD"; pub struct DatabaseConfig { host: String, @@ -26,12 +30,12 @@ impl Debug for DatabaseConfig { } impl DatabaseConfig { - pub fn from_env() -> Result { + pub(super) fn try_from_env() -> Result { Ok(DatabaseConfig{ - host: env::var("DATABASE_HOST").map_err(|_| Error::MissingDatabaseHost)?, - port: get_env_port("DATABASE_PORT",Error::MissingDatabasePort)?, - user: env::var("POSTGRES_USER").map_err(|_| Error::MissingDatabaseUser)?, - pass: env::var("POSTGRES_PASSWORD").map_err(|_| Error::MissingDatabaseUser)? + host: env::var(DATABASE_HOST).map_err(|_| Error::MissingDatabaseHost)?, + port: try_get_port_from_env(DATABASE_PORT,Error::MissingDatabasePort)?, + user: env::var(POSTGRES_USER).map_err(|_| Error::MissingDatabaseUser)?, + pass: env::var(POSTGRES_PASSWORD).map_err(|_| Error::MissingDatabaseUser)? }) } diff --git a/signer-service-rust/src/config/error.rs b/signer-service-rust/src/config/error.rs index de724cd9..a8e1f9ef 100644 --- a/signer-service-rust/src/config/error.rs +++ b/signer-service-rust/src/config/error.rs @@ -12,5 +12,8 @@ pub enum Error { MissingDatabaseUser, MissingDatabasePassword, + MissingStellarSecretKey, + MissingStellarNetworkIdentifier, + CreateWalletFailed, ParseFailed(String) } \ No newline at end of file diff --git a/signer-service-rust/src/config/mod.rs b/signer-service-rust/src/config/mod.rs index 1573113c..016f0049 100644 --- a/signer-service-rust/src/config/mod.rs +++ b/signer-service-rust/src/config/mod.rs @@ -1,30 +1,36 @@ mod server; mod database; mod error; +mod wallet; use std::env; use serde_json::error::Category::Data; pub use server::ServerConfig; pub use database::DatabaseConfig; pub use error::Error; +use crate::config::wallet::WalletConfig; + +use tracing::error; #[derive(Debug)] pub struct Config { server:ServerConfig, - database: DatabaseConfig + database: DatabaseConfig, + wallet: WalletConfig } impl Config { - pub fn from_env_file(file_name:&str) -> Result { + pub fn try_from_env_file(file_name:&str) -> Result { // Load environment variables from .env file. if let None = dotenvy::from_filename(file_name).ok() { - tracing::error!("Failed to read file {file_name}"); + error!("‼️{:<3} - Reading file {file_name}", "FAILED"); return Err(Error::FileDoesNotExist(file_name.to_string())); }; Ok(Config { - server: ServerConfig::from_env()?, - database: DatabaseConfig::from_env()? + server: ServerConfig::try_from_env()?, + database: DatabaseConfig::try_from_env()?, + wallet: WalletConfig::try_from_env()? }) } @@ -35,30 +41,19 @@ impl Config { pub fn database_config(&self) -> &DatabaseConfig { &self.database } + + pub fn wallet_config(&self) -> &WalletConfig { &self.wallet } } #[doc(hidden)] /// helper function to get any port defined in the environment and parse to u16 -fn get_env_port(env_var_name:&str, error:Error) -> Result { +fn try_get_port_from_env(env_var_name:&str, error:Error) -> Result { let Ok(port_as_str) = env::var(env_var_name) else { return Err(error) }; port_as_str.parse::().map_err(|_| { - tracing::error!("Failed to convert {env_var_name} {port_as_str} to type u16."); + error!("‼️{:<3} - Convert {env_var_name} {port_as_str} to u16", "FAILED"); error }) -} - -#[cfg(test)] -mod test { - use crate::config::Config; - - #[test] - fn read_env_file_success() { - let x = Config::from_env_file(".env"); - println!("The x value: {x:#?}"); - - assert!(true); - } } \ No newline at end of file diff --git a/signer-service-rust/src/config/server.rs b/signer-service-rust/src/config/server.rs index 551f4ce4..0a4c5825 100644 --- a/signer-service-rust/src/config/server.rs +++ b/signer-service-rust/src/config/server.rs @@ -3,11 +3,13 @@ use std::{ net::SocketAddr, path::Path }; -use crate::config::{Error, get_env_port}; -use crate::config::Error::MissingServerPort; +use crate::config::{Error, try_get_port_from_env}; + +const SERVER_HOST:&str = "SERVER_HOST"; +const SERVER_PORT:&str = "SERVER_PORT"; const DEFAULT_SERVER_HOST:&str = "127.0.0.1"; -const DEFAULT_SERVER_PORT:u16 = 3000; +const DEFAULT_SERVER_PORT:u16 = 3001; /// Holds the address of our server #[derive(Debug)] @@ -26,10 +28,10 @@ impl Default for ServerConfig { } impl ServerConfig { - pub fn from_env() -> Result { + pub(super) fn try_from_env() -> Result { Ok(ServerConfig { - host: env::var("SERVER_HOST").map_err(|_| Error::MissingServerHost)?, - port: get_env_port("SERVER_PORT", MissingServerPort)? + host: env::var(SERVER_HOST).map_err(|_| Error::MissingServerHost)?, + port: try_get_port_from_env(SERVER_PORT, Error::MissingServerPort)? }) } @@ -46,7 +48,7 @@ impl ServerConfig { // Parse the socket address address.parse() .map_err(|e| { - tracing::error!("Failed to parse address {address}: {e:?}"); + tracing::error!("‼️{:<3} - Parsing Server Address:{address}: {e:?}", "FAILED"); Error::ParseFailed("server address".to_string()) }) } diff --git a/signer-service-rust/src/domain/mod.rs b/signer-service-rust/src/domain/mod.rs new file mode 100644 index 00000000..88b9624f --- /dev/null +++ b/signer-service-rust/src/domain/mod.rs @@ -0,0 +1,2 @@ +pub mod models; + diff --git a/signer-service-rust/src/domain/models/token.rs b/signer-service-rust/src/domain/models/token.rs new file mode 100644 index 00000000..890d5d18 --- /dev/null +++ b/signer-service-rust/src/domain/models/token.rs @@ -0,0 +1,99 @@ +use serde::{Deserialize, Serialize}; +use substrate_stellar_sdk::{Asset, PublicKey}; +use substrate_stellar_sdk::types::{AlphaNum12, AlphaNum4}; + +use tracing::{error, warn}; +use crate::domain::models::Error; + +#[derive(Debug, Serialize,Deserialize)] +pub struct Token { + pub toml_url: String, + pub asset_code: String, + pub asset_issuer: String, + pub vault_account_id: String, + pub min_withdrawal_amount: String, +} + +impl Token { + pub fn try_from_path(path: &str) -> Result { + let read_file = std::fs::read_to_string(path) + .map_err(|e| { + error!("‼️{:<3} - Reading file {path}", "FAILED"); + + Error::FileDoesNotExist(path.to_string()) + + })?; + + serde_json::from_str(&read_file) + .map_err(|e| { + error!("‼️{:<3} - Deserializing to Token struct in file {path}: {e:?}", "FAILED"); + + + Error::SerdeError(format!("Token struct in file {path}")) + }) + } + + pub fn try_by_asset_code(asset_code:&str) -> Result { + let asset_code = asset_code.to_uppercase(); + let path = format!("./resources/tokens/{asset_code}.json"); + + Self::try_from_path(&path).map_err(|e| { + match e { + Error::FileDoesNotExist(_) => { + Error::TokenDoesNotExist + } + _ => e + } + }) + } + + pub fn asset_code_hex(&self) -> String { + let mut hex = format!("0x{}", hex::encode(&self.asset_code)); + + for _ in self.asset_code.len()..4 { + hex = hex + "00"; + } + + hex + } + + fn asset_issuer(&self) -> Result { + PublicKey::from_encoding(&self.asset_issuer).map_err(|e|{ + error!("‼️{:<3} - Encoding asset issuer:{}: {e:?}", "FAILED", &self.asset_issuer); + + Error::EncodingFailed("asset issuer".to_string()) + }) + } + + pub fn get_asset_type(&self) -> Result { + Ok( + if self.asset_code.len() <= 4 { + Asset::AssetTypeCreditAlphanum4( + AlphaNum4 { + asset_code: self.asset_code.clone().into(), + issuer: self.asset_issuer()? + } + ) + } else { + Asset::AssetTypeCreditAlphanum12( + AlphaNum12 { + asset_code: self.asset_code.clone().into(), + issuer: self.asset_issuer()?, + } + ) + } + ) + } +} + +#[cfg(test)] +mod test { + use crate::domain::models::Token; + + #[test] + fn test_me() { + let cfg = Token::try_by_asset_code("BRL"); + println!("The value of cfg: {cfg:?}"); + assert!(true); + } +} \ No newline at end of file diff --git a/signer-service-rust/src/infra/db.rs b/signer-service-rust/src/infra/db.rs index d2d08744..d1fde0ee 100644 --- a/signer-service-rust/src/infra/db.rs +++ b/signer-service-rust/src/infra/db.rs @@ -3,28 +3,28 @@ use diesel_migrations::{embed_migrations, EmbeddedMigrations, MigrationHarness}; use crate::config::DatabaseConfig; use crate::infra::Error; -pub const MIGRATIONS: EmbeddedMigrations = embed_migrations!("migrations/"); +// pub const MIGRATIONS: EmbeddedMigrations = embed_migrations!("migrations/"); -pub async fn init_db(cfg: DatabaseConfig) { - // Create a connection pool to the PostgreSQL database - let manager = cfg.create_connection_pool(); - - let pool = Pool::builder(manager).build() - .map_err(|e| { - tracing::error!("Failed to create connection pool: {e:?}"); - Error::InternalServerError - })?; - -} - -async fn run_migrations(pool: &Pool) -> Result<(),Error> { - let conn = pool.get().await - .map_err(|e| { - tracing::error!("Failed to retrieve object from connection pool: {e:?}"); - Error::PoolError - })?; - - conn.interact(|conn| conn.run_pending_migrations()) - - Ok(()) -} \ No newline at end of file +// pub async fn init_db(cfg: DatabaseConfig) { +// // Create a connection pool to the PostgreSQL database +// let manager = cfg.create_connection_pool(); +// +// let pool = Pool::builder(manager).build() +// .map_err(|e| { +// tracing::error!("Failed to create connection pool: {e:?}"); +// Error::InternalServerError +// })?; +// +// } +// +// async fn run_migrations(pool: &Pool) -> Result<(),Error> { +// let conn = pool.get().await +// .map_err(|e| { +// tracing::error!("Failed to retrieve object from connection pool: {e:?}"); +// Error::PoolError +// })?; +// +// // conn.interact(|conn| conn.run_pending_migrations()) +// +// Ok(()) +// } \ No newline at end of file diff --git a/signer-service-rust/src/main.rs b/signer-service-rust/src/main.rs index 4dfeb11b..75e9b3d9 100644 --- a/signer-service-rust/src/main.rs +++ b/signer-service-rust/src/main.rs @@ -1,5 +1,8 @@ mod config; pub mod infra; +mod api; +mod domain; +pub mod utils; use axum::Router; use axum::routing::get; @@ -10,20 +13,26 @@ use tracing_subscriber::{ layer::SubscriberExt, util::SubscriberInitExt }; +use wallet::StellarWallet; +use crate::api::routes::status; pub struct State; #[tokio::main] async fn main() { init_tracing(); - // let server_config = config::ServerConfig::from_env_file(".env").unwrap(); - // let server_addr = server_config.socket_address().unwrap(); - // - // let listener = tokio::net::TcpListener::bind(server_addr).await.unwrap(); - // info!("🚀{:<12} - {:?}\n", "LISTENING", listener.local_addr()); - // - // let routes = Router::new().route("/", get(root)); - // axum::serve(listener,routes).await.unwrap(); + let config = config::Config::try_from_env_file(".env").unwrap(); + let server_addr = config.server_config().socket_address().unwrap(); + let wallet = config.wallet_config().create_wallet().unwrap(); + + + let listener = tokio::net::TcpListener::bind(server_addr).await.unwrap(); + info!("🚀{:<3} - {:?}\n", "LISTENING", listener.local_addr()); + + let routes = Router::new().route("/", get(root)) + .route("/status", get(status)) + .with_state(wallet); + axum::serve(listener,routes).await.unwrap(); } async fn root() -> &'static str { diff --git a/signer-service-rust/src/utils/mod.rs b/signer-service-rust/src/utils/mod.rs new file mode 100644 index 00000000..dde93414 --- /dev/null +++ b/signer-service-rust/src/utils/mod.rs @@ -0,0 +1,3 @@ +mod helper; + +pub use helper::*; \ No newline at end of file From 81c35fe43c9fd7cc5980818ce37ac44f6c174a43 Mon Sep 17 00:00:00 2001 From: b-yap <2826165+b-yap@users.noreply.github.com> Date: Fri, 31 May 2024 21:30:54 +0800 Subject: [PATCH 03/15] add missing files and resources --- signer-service-rust/resources/tokens/BRL.json | 7 + .../resources/tokens/EURC.json | 7 + signer-service-rust/src/api/default.html | 13 ++ signer-service-rust/src/api/horizon/mod.rs | 1 + .../src/api/horizon/tx_builder.rs | 135 ++++++++++++++++++ signer-service-rust/src/api/mod.rs | 21 +++ signer-service-rust/src/api/routes.rs | 82 +++++++++++ signer-service-rust/src/api/routes_static.rs | 17 +++ signer-service-rust/src/api/routes_stellar.rs | 3 + signer-service-rust/src/config/wallet.rs | 59 ++++++++ signer-service-rust/src/domain/models/mod.rs | 13 ++ signer-service-rust/src/utils/helper.rs | 10 ++ 12 files changed, 368 insertions(+) create mode 100644 signer-service-rust/resources/tokens/BRL.json create mode 100644 signer-service-rust/resources/tokens/EURC.json create mode 100644 signer-service-rust/src/api/default.html create mode 100644 signer-service-rust/src/api/horizon/mod.rs create mode 100644 signer-service-rust/src/api/horizon/tx_builder.rs create mode 100644 signer-service-rust/src/api/mod.rs create mode 100644 signer-service-rust/src/api/routes.rs create mode 100644 signer-service-rust/src/api/routes_static.rs create mode 100644 signer-service-rust/src/api/routes_stellar.rs create mode 100644 signer-service-rust/src/config/wallet.rs create mode 100644 signer-service-rust/src/domain/models/mod.rs create mode 100644 signer-service-rust/src/utils/helper.rs diff --git a/signer-service-rust/resources/tokens/BRL.json b/signer-service-rust/resources/tokens/BRL.json new file mode 100644 index 00000000..b09fe414 --- /dev/null +++ b/signer-service-rust/resources/tokens/BRL.json @@ -0,0 +1,7 @@ +{ + "toml_url": "https://ntokens.com/.well-known/stellar.toml", + "asset_code": "BRL", + "asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP", + "vault_account_id": "6g7fKQQZ9VfbBTQSaKBcATV4psApFra5EDwKLARFZCCVnSWS", + "min_withdrawal_amount": "10000000000000" +} \ No newline at end of file diff --git a/signer-service-rust/resources/tokens/EURC.json b/signer-service-rust/resources/tokens/EURC.json new file mode 100644 index 00000000..6c3dd745 --- /dev/null +++ b/signer-service-rust/resources/tokens/EURC.json @@ -0,0 +1,7 @@ +{ + "toml_url": "https://mykobo.co/.well-known/stellar.toml", + "asset_code": "EURC", + "asset_issuer": "GAQRF3UGHBT6JYQZ7YSUYCIYWAF4T2SAA5237Q5LIQYJOHHFAWDXZ7NM", + "vault_account_id": "6bsD97dS8ZyomMmp1DLCnCtx25oABtf19dypQKdZe6FBQXSm", + "min_withdrawal_amount": "10000000000000" +} \ No newline at end of file diff --git a/signer-service-rust/src/api/default.html b/signer-service-rust/src/api/default.html new file mode 100644 index 00000000..10d55b44 --- /dev/null +++ b/signer-service-rust/src/api/default.html @@ -0,0 +1,13 @@ + + + + + + AWESOME-APP Web + + + +Hello World! + + + \ No newline at end of file diff --git a/signer-service-rust/src/api/horizon/mod.rs b/signer-service-rust/src/api/horizon/mod.rs new file mode 100644 index 00000000..a6e03cea --- /dev/null +++ b/signer-service-rust/src/api/horizon/mod.rs @@ -0,0 +1 @@ +mod tx_builder; \ No newline at end of file diff --git a/signer-service-rust/src/api/horizon/tx_builder.rs b/signer-service-rust/src/api/horizon/tx_builder.rs new file mode 100644 index 00000000..a83455c4 --- /dev/null +++ b/signer-service-rust/src/api/horizon/tx_builder.rs @@ -0,0 +1,135 @@ + +use substrate_stellar_sdk::{Asset, Operation, PublicKey, Signer, SignerKey, StroopAmount, TimeBounds, Transaction, TransactionEnvelope}; +use substrate_stellar_sdk::network::{Network, PUBLIC_NETWORK, TEST_NETWORK}; +use substrate_stellar_sdk::types::{ChangeTrustAsset, Preconditions}; +use tracing::error; +use wallet::operations::AppendExt; +use wallet::StellarWallet; +use crate::api::Error; +use crate::domain::models::{Token}; +use crate::utils::public_key_as_string; + +const BASE_FEE:u32 = 1000000; +const SET_OPT_LOW_THRESHOLD:u8 = 2; +const SET_OPT_MED_THRESHOLD:u8 = 2; +const SET_OPT_HIGH_THRESHOLD:u8 = 2; +const SET_OPT_SIGNER_WEIGHT:u32 = 1; + +pub async fn create_account_transaction(wallet:&StellarWallet, + asset_code:&str, + destination_account:PublicKey, + stroop_amount: i64, + max_time: u64 +) -> Result { + let create_op = Operation::new_create_account( + destination_account, + StroopAmount(stroop_amount) + ).map_err(|e| { + error!("‼️{:<3} - create account operation: {e:?}", "FAILED"); + Error::OperationError("create account".to_string()) + })?; + + // add threshold to the new account + let set_opt_op = Operation::new_set_options( + None, + None, + None, + None, + Some(SET_OPT_LOW_THRESHOLD), + Some(SET_OPT_MED_THRESHOLD), + Some(SET_OPT_HIGH_THRESHOLD), + None, + Some(Signer { + key: SignerKey::SignerKeyTypeEd25519(wallet.secret_key().into_binary()), + weight: SET_OPT_SIGNER_WEIGHT, + }) + ).map_err(|e| { + error!("‼️{:<3} - set options operation: {e:?}", "FAILED"); + Error::OperationError("set options".to_string()) + })?; + + // create a trust line + let token = Token::try_by_asset_code(asset_code)?; + let tk_asset = asset_to_change_trust_asset_type(&token)?; + let change_trust_op = Operation::new_change_trust( + tk_asset + ).map_err(|e| { + error!("‼️{:<3} - change trust asset operation: {e:?}", "FAILED"); + Error::OperationError("change trust asset".to_string()) + })?; + + // prepare the transaction: + let mut tx = create_transaction_no_operations(wallet,max_time).await?; + + // insert all 3 operations + tx.append_multiple(vec![create_op,set_opt_op,change_trust_op]) + .map_err(|e| { + error!("‼️{:<3} - appending operations to transaction: {e:?}", "FAILED"); + Error::TransactionError("append multiple operations".to_string()) + })?; + + + Ok(tx) +} + +fn asset_to_change_trust_asset_type(token:&Token) -> Result { + token.get_asset_type().map(|asset| match asset { + Asset::AssetTypeCreditAlphanum4(res) => + ChangeTrustAsset::AssetTypeCreditAlphanum4(res), + Asset::AssetTypeCreditAlphanum12(res) => + ChangeTrustAsset::AssetTypeCreditAlphanum12(res), + Asset::AssetTypeNative | Asset::Default(_) => + ChangeTrustAsset::AssetTypeNative + }).map_err(|e| e.into()) +} + +/// Basic transaction without any operations yet +async fn create_transaction_no_operations( + wallet: &StellarWallet, + max_time: u64 +) -> Result { + let next_sequence = wallet.get_sequence().await. + map_err(|e| { + let pub_key = public_key_as_string(&wallet.public_key()); + error!("‼️{:<3} - retrieving sequence number of Stellar Public Key: {pub_key}: {e:?}", "FAILED"); + Error::WalletError("sequence number".to_string()) + })? + 1; + + // prepare the transaction + Transaction::new( + wallet.public_key(), + next_sequence, + Some(BASE_FEE), + Preconditions::PrecondTime(TimeBounds{ min_time: 0, max_time }), + None // no memo + ).map_err(|e| { + error!("‼️{:<3} - creating transaction: {e:?}", "FAILED"); + Error::TransactionError("new".to_string()) + }) +} + + +fn create_and_sign_envelope( + wallet: &StellarWallet, + tx: Transaction, +) -> Result { + // convert to envelope + let mut envelope = tx.into_transaction_envelope(); + sign_envelope(wallet, &mut envelope)?; + + Ok(envelope) +} + +fn sign_envelope(wallet: &StellarWallet, envelope: &mut TransactionEnvelope) -> Result<(), Error> { + let network: &Network = + if wallet.is_public_network() { &PUBLIC_NETWORK } else { &TEST_NETWORK }; + + envelope + .sign(network, vec![&wallet.secret_key()]) + .map_err(|e| { + error!("‼️{:<3} - signing envelope: {e:?}", "FAILED"); + Error::WalletError("signing envelope".to_string()) + })?; + + Ok(()) +} \ No newline at end of file diff --git a/signer-service-rust/src/api/mod.rs b/signer-service-rust/src/api/mod.rs new file mode 100644 index 00000000..7e5c7aa8 --- /dev/null +++ b/signer-service-rust/src/api/mod.rs @@ -0,0 +1,21 @@ +pub mod routes; +mod routes_static; +mod routes_stellar; +mod horizon; + +use crate::domain::models::Error as ModelsError; + +#[derive(Debug)] +pub enum Error { + ModelError(ModelsError), + WalletError(String), + OperationError(String), + TransactionError(String) +} + + +impl From for Error { + fn from(value: ModelsError) -> Self { + Self::ModelError(value) + } +} \ No newline at end of file diff --git a/signer-service-rust/src/api/routes.rs b/signer-service-rust/src/api/routes.rs new file mode 100644 index 00000000..872d1940 --- /dev/null +++ b/signer-service-rust/src/api/routes.rs @@ -0,0 +1,82 @@ +use axum::{debug_handler, Json, Router}; +use axum::extract::State; +use axum::routing::get; +use serde_json::{json, Value}; +use tokio::time::Instant; + +use tracing::{info, warn}; +use wallet::error::Error; +use wallet::{HorizonBalance, StellarWallet}; + +/* +// basic handler that responds with a static string +#[debug_handler] +pub async fn root() -> &'static str { + "Hello, World!" +} +*/ + + +#[debug_handler] +pub async fn stellar(State(wallet): State) { + +} + +#[debug_handler] +pub async fn status(State(wallet): State) -> Json { + let start = Instant::now(); + + let wallet_public_key = { + let pub_key = wallet.public_key().to_encoding(); + String::from_utf8(pub_key).unwrap_or("undefined".to_string()) + }; + + let res = match wallet.get_balances().await { + Ok(balances) => _get_balance_success(&wallet_public_key, balances), + Err(e) => { + let e = e.to_string(); + warn!("⚠️{:<3} - Stellar Public Key {wallet_public_key} balances: {e}", "FAILED"); + + Json(json!({ + "status": 500, + "error": "Server Error", + "details": e + })) + } + }; + + let duration = start.elapsed(); + info!("➡️ status {duration:?}"); + + res +} + +fn _get_balance_success(public_key:&str, balances: Vec) -> Json { + let failed_status = Json(json!({ + "status": false, + "public": public_key + })); + + let Some(native_balance) = balances.iter().find(|bal| { + if let Ok(asset_type) = std::str::from_utf8(&bal.asset_type) { + asset_type == "native" + } else { + false + } + } + ) else { + warn!("⚠️{:<3} - XLM balance of Stellar Public Key {public_key}\n", "NOT FOUND"); + return failed_status; + }; + + if native_balance.balance < 2.5 { + warn!("⚠️{:<3} - XLM balance of Stellar Public Key {public_key}\n", "INSUFFICIENT"); + return failed_status; + } + + info!("💰️{:<3} - Stellar Public Key {public_key} has sufficient XLM balance", "EXIST"); + Json(json!({ + "status": true, + "public": public_key + })) +} diff --git a/signer-service-rust/src/api/routes_static.rs b/signer-service-rust/src/api/routes_static.rs new file mode 100644 index 00000000..089ed431 --- /dev/null +++ b/signer-service-rust/src/api/routes_static.rs @@ -0,0 +1,17 @@ +use axum::handler::HandlerWithoutStateExt; +use axum::http::StatusCode; +use axum::routing::{any_service, MethodRouter}; +use tower_http::services::ServeDir; + +// Note: Here we can just return a MethodRouter rather than a full Router +// since ServeDir is a service. +pub fn serve_dir() -> MethodRouter { + async fn handle_404() -> (StatusCode, &'static str) { + (StatusCode::NOT_FOUND, "Resource not found.") + } + + any_service( + ServeDir::new("./default.html") + .not_found_service(handle_404.into_service()), + ) +} \ No newline at end of file diff --git a/signer-service-rust/src/api/routes_stellar.rs b/signer-service-rust/src/api/routes_stellar.rs new file mode 100644 index 00000000..abb13006 --- /dev/null +++ b/signer-service-rust/src/api/routes_stellar.rs @@ -0,0 +1,3 @@ +use axum::extract::State; +use axum::Json; +use wallet::StellarWallet; diff --git a/signer-service-rust/src/config/wallet.rs b/signer-service-rust/src/config/wallet.rs new file mode 100644 index 00000000..2d2142f9 --- /dev/null +++ b/signer-service-rust/src/config/wallet.rs @@ -0,0 +1,59 @@ +use std::env; +use std::fmt::{Debug, Formatter}; +use substrate_stellar_sdk::{SecretKey, StellarTypeToString}; +use tracing::{error, warn}; +use wallet::StellarWallet; +use crate::config::Error; +use crate::utils::public_key_as_string; + +const STELLAR_SECRET_KEY:&str = "STELLAR_SECRET_KEY"; +const STELLAR_PUBLIC_NETWORK:&str = "STELLAR_PUBLIC_NETWORK"; + +pub struct WalletConfig { + secret:SecretKey, + is_public_network: bool +} + +impl Debug for WalletConfig { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + f.debug_struct("WalletConfig") + .field("secret", &"******") + .field("is_public_network", &self.is_public_network) + .finish() + } +} + +impl WalletConfig { + pub(super) fn try_from_env() -> Result { + let secret = env::var("STELLAR_SECRET_KEY").map_err(|_| Error::MissingStellarSecretKey)?; + let secret = SecretKey::from_encoding(&secret) + .map_err(|e| { + error!("‼️Failed to parse stellar secret key ******: {e:?}"); + Error::ParseFailed("stellar secret key".to_string()) + })?; + + let is_public_network = env::var("STELLAR_PUBLIC_NETWORK").map_err(|_| Error::MissingStellarNetworkIdentifier)?; + let is_public_network = is_public_network.parse::() + .map_err(|_| { + error!("‼️Failed to parse stellar public network {is_public_network}"); + Error::ParseFailed("stellar public network".to_string()) + })?; + + Ok(WalletConfig { + secret, + is_public_network, + }) + } + + pub fn public_key_as_str(&self) -> String { + public_key_as_string(self.secret.get_public()) + } + + pub fn create_wallet(&self) -> Result { + StellarWallet::from_secret_key(self.secret.clone(), self.is_public_network) + .map_err(|e| { + error!("‼️{:<3} - Wallet creation for Stellar Public Key: {}", "FAILED", self.public_key_as_str()); + Error::CreateWalletFailed + }) + } +} \ No newline at end of file diff --git a/signer-service-rust/src/domain/models/mod.rs b/signer-service-rust/src/domain/models/mod.rs new file mode 100644 index 00000000..3c93fac1 --- /dev/null +++ b/signer-service-rust/src/domain/models/mod.rs @@ -0,0 +1,13 @@ +mod token; + +pub use token::Token; + +#[derive(Debug)] +pub enum Error { + FileDoesNotExist(String), + SerdeError(String), + TokenDoesNotExist, + EncodingFailed(String), + + WalletError(String) +} diff --git a/signer-service-rust/src/utils/helper.rs b/signer-service-rust/src/utils/helper.rs new file mode 100644 index 00000000..a549d61e --- /dev/null +++ b/signer-service-rust/src/utils/helper.rs @@ -0,0 +1,10 @@ +use substrate_stellar_sdk::PublicKey; +use tracing::warn; + +pub fn public_key_as_string(public_key:&PublicKey) -> String { + String::from_utf8(public_key.to_encoding()) + .unwrap_or_else(|e| { + warn!("⚠️{:<3} - Stellar Public Key conversion:{e:?}\n", "WARNING"); + "undefined".to_string() + }) +} \ No newline at end of file From a170685d19e04558b051af595902dedd434a0094 Mon Sep 17 00:00:00 2001 From: b-yap <2826165+b-yap@users.noreply.github.com> Date: Wed, 5 Jun 2024 20:24:38 +0800 Subject: [PATCH 04/15] adding stellar routes --- .../src/api/horizon/create_account_tx.rs | 92 +++++++++++ signer-service-rust/src/api/horizon/helper.rs | 58 +++++++ signer-service-rust/src/api/horizon/mod.rs | 9 +- .../src/api/horizon/payment_and_merge_tx.rs | 154 ++++++++++++++++++ .../src/api/horizon/tx_builder.rs | 135 --------------- signer-service-rust/src/api/mod.rs | 19 ++- signer-service-rust/src/api/routes.rs | 82 ---------- signer-service-rust/src/api/routes/mod.rs | 41 +++++ signer-service-rust/src/api/routes/routes.rs | 148 +++++++++++++++++ signer-service-rust/src/api/routes_stellar.rs | 3 - .../src/config/{wallet.rs => account.rs} | 62 ++++++- signer-service-rust/src/config/error.rs | 4 +- signer-service-rust/src/config/mod.rs | 11 +- signer-service-rust/src/config/server.rs | 3 +- signer-service-rust/src/domain/models/mod.rs | 32 +++- .../src/domain/models/requests.rs | 34 ++++ .../src/domain/models/sep24Result.rs | 71 ++++++++ .../src/domain/models/token.rs | 16 +- signer-service-rust/src/main.rs | 13 +- signer-service-rust/src/utils/helper.rs | 3 +- 20 files changed, 733 insertions(+), 257 deletions(-) create mode 100644 signer-service-rust/src/api/horizon/create_account_tx.rs create mode 100644 signer-service-rust/src/api/horizon/helper.rs create mode 100644 signer-service-rust/src/api/horizon/payment_and_merge_tx.rs delete mode 100644 signer-service-rust/src/api/horizon/tx_builder.rs delete mode 100644 signer-service-rust/src/api/routes.rs create mode 100644 signer-service-rust/src/api/routes/mod.rs create mode 100644 signer-service-rust/src/api/routes/routes.rs delete mode 100644 signer-service-rust/src/api/routes_stellar.rs rename signer-service-rust/src/config/{wallet.rs => account.rs} (51%) create mode 100644 signer-service-rust/src/domain/models/requests.rs create mode 100644 signer-service-rust/src/domain/models/sep24Result.rs diff --git a/signer-service-rust/src/api/horizon/create_account_tx.rs b/signer-service-rust/src/api/horizon/create_account_tx.rs new file mode 100644 index 00000000..50918ea0 --- /dev/null +++ b/signer-service-rust/src/api/horizon/create_account_tx.rs @@ -0,0 +1,92 @@ +use axum::Json; +use serde_json::{json, Value}; +use substrate_stellar_sdk::{Operation, PublicKey, Signer, SignerKey, StroopAmount}; +use tracing::error; +use wallet::operations::AppendExt; +use crate::api::Error; +use crate::domain::models::{Token}; +use crate::api::horizon::helper::{change_trust_operation, create_transaction_no_operations, operation_with_custom_err}; +use crate::config::AccountConfig; + +const SET_OPT_LOW_THRESHOLD:u8 = 2; +const SET_OPT_MED_THRESHOLD:u8 = 2; +const SET_OPT_HIGH_THRESHOLD:u8 = 2; +const SET_OPT_SIGNER_WEIGHT:u32 = 1; + +const NEW_ACCOUNT_STARTING_BALANCE:StroopAmount = StroopAmount(2500000); + +pub async fn build_create_account_tx( + funding_account: &AccountConfig, + ephemeral_account_id: &PublicKey, + asset_code:&str, + max_time: u64, +) -> Result,Error> { + let sequence = funding_account.get_sequence().await?; + // prepare the transaction: + let mut tx = create_transaction_no_operations( + funding_account.public_key(), + sequence, + max_time, + None + )?; + + let operations = prepare_all_operations( + funding_account, + ephemeral_account_id.clone(), + asset_code + )?; + + // insert all 3 operations + tx.append_multiple(operations) + .map_err(|e| { + error!("‼️{:<3} - appending operations to transaction: {e:?}", "FAILED"); + Error::TransactionError("append multiple operations".to_string()) + })?; + + let tx_sig = funding_account.create_base64_signature(tx)?; + + let public_key = funding_account.public_key_as_str(); + Ok(Json(json!({ + "signature": [tx_sig], + "sequence": sequence, + "public": public_key + }))) +} + + +fn prepare_all_operations( + funding_account: &AccountConfig, + ephemeral_account_id: PublicKey, + asset_code:&str +) -> Result,Error> { + let create_op = operation_with_custom_err!( + Operation::new_create_account( + ephemeral_account_id, + NEW_ACCOUNT_STARTING_BALANCE + ), + "create account" + )?; + + // add threshold to the new account + let set_opt_op = operation_with_custom_err!(Operation::new_set_options::( + None, + None, + None, + None, + Some(SET_OPT_LOW_THRESHOLD), + Some(SET_OPT_MED_THRESHOLD), + Some(SET_OPT_HIGH_THRESHOLD), + None, + Some(Signer { + key: SignerKey::SignerKeyTypeEd25519(funding_account.public_key().into_binary()), + weight: SET_OPT_SIGNER_WEIGHT, + })), + "set options" + )?; + + // create a trust line + let token = Token::try_by_asset_code(asset_code)?; + let change_trust_op = change_trust_operation(&token)?; + + Ok(vec![create_op,set_opt_op, change_trust_op]) +} \ No newline at end of file diff --git a/signer-service-rust/src/api/horizon/helper.rs b/signer-service-rust/src/api/horizon/helper.rs new file mode 100644 index 00000000..9aa3d393 --- /dev/null +++ b/signer-service-rust/src/api/horizon/helper.rs @@ -0,0 +1,58 @@ +use substrate_stellar_sdk::{Asset, Memo, Operation, PublicKey, TimeBounds, Transaction}; +use substrate_stellar_sdk::types::{ChangeTrustAsset, Preconditions}; +use tracing::error; +use crate::api::Error; +use crate::domain::models::Token; + +const BASE_FEE:u32 = 1000000; + +macro_rules! operation_with_custom_err { + ($op:expr, $op_str:expr) => { + $op.map_err(|e| { + let op_str = stringify!($op_str); + error!("‼️{:<3} - {op_str} operation: {e:?}", "FAILED"); + Error::OperationError(op_str.to_string()) + }) + }; +} + +pub(super) use operation_with_custom_err; + +/// Basic transaction without any operations yet +pub(super) fn create_transaction_no_operations( + source_account: PublicKey, + next_sequence: i64, + max_time: u64, + memo: Option +) -> Result { + + // prepare the transaction + Transaction::new( + source_account, + next_sequence, + Some(BASE_FEE), + Preconditions::PrecondTime(TimeBounds{ min_time: 0, max_time }), + memo + ).map_err(|e| { + error!("‼️{:<3} - creating transaction: {e:?}", "FAILED"); + Error::TransactionError("new".to_string()) + }) +} + +pub(super) fn change_trust_operation(token:&Token) -> Result { + let tk_asset = asset_to_change_trust_asset_type(token)?; + operation_with_custom_err!(Operation::new_change_trust( + tk_asset), + "change trust" + ) +} +pub(super) fn asset_to_change_trust_asset_type(token:&Token) -> Result { + token.get_asset_type().map(|asset| match asset { + Asset::AssetTypeCreditAlphanum4(res) => + ChangeTrustAsset::AssetTypeCreditAlphanum4(res), + Asset::AssetTypeCreditAlphanum12(res) => + ChangeTrustAsset::AssetTypeCreditAlphanum12(res), + Asset::AssetTypeNative | Asset::Default(_) => + ChangeTrustAsset::AssetTypeNative + }).map_err(|e| e.into()) +} \ No newline at end of file diff --git a/signer-service-rust/src/api/horizon/mod.rs b/signer-service-rust/src/api/horizon/mod.rs index a6e03cea..20aeef59 100644 --- a/signer-service-rust/src/api/horizon/mod.rs +++ b/signer-service-rust/src/api/horizon/mod.rs @@ -1 +1,8 @@ -mod tx_builder; \ No newline at end of file +pub use create_account_tx::build_create_account_tx; +pub use payment_and_merge_tx::build_payment_and_merge_tx; + +mod create_account_tx; +mod payment_and_merge_tx; + +mod helper; + diff --git a/signer-service-rust/src/api/horizon/payment_and_merge_tx.rs b/signer-service-rust/src/api/horizon/payment_and_merge_tx.rs new file mode 100644 index 00000000..2ac1df59 --- /dev/null +++ b/signer-service-rust/src/api/horizon/payment_and_merge_tx.rs @@ -0,0 +1,154 @@ +use axum::Json; +use serde_json::{json, Value}; +use substrate_stellar_sdk::{Operation, PublicKey, Transaction}; +use tracing::{error, info}; +use wallet::operations::AppendExt; +use crate::api::Error; +use crate::api::horizon::helper::{change_trust_operation, create_transaction_no_operations}; +use crate::domain::models::{Sep24Result, Token}; +use crate::config::AccountConfig; + +pub fn build_payment_and_merge_tx( + funding_account: &AccountConfig, + ephemeral_account_id: PublicKey, + ephemeral_sequence: i64, + payment_data: Sep24Result, + max_time:u64, + asset_code: &str +) -> Result,Error>{ + let token = Token::try_by_asset_code(asset_code)?; + + let payment_tx = payment_transaction( + ephemeral_account_id.clone(), + ephemeral_sequence, + &token, + max_time, + payment_data + )?; + + info!(" payment_tx: {payment_tx:?}"); + + let merge_tx = merge_transaction( + ephemeral_account_id, + ephemeral_sequence, + &token, + max_time, + funding_account.public_key() + )?; + + info!(" merge_tx: {merge_tx:?}"); + let payment_tx_sig = funding_account.create_base64_signature(payment_tx)?; + let merge_tx_sig = funding_account.create_base64_signature(merge_tx)?; + + let public_key = funding_account.public_key_as_str(); + Ok(Json(json!({ + "signature": [ + payment_tx_sig, + merge_tx_sig + ], + "public": public_key + }))) +} +fn payment_transaction( + source_account_id: PublicKey, + next_sequence: i64, + token:&Token, + max_time: u64, + payment_data: Sep24Result +) -> Result { + + let mut payment_tx = create_transaction_no_operations( + source_account_id, + next_sequence, + max_time, + Some(payment_data.memo()?) + )?; + + payment_tx.append_operation( + Operation::new_payment( + payment_data.offramping_account()?, + token.get_asset_type()?, + payment_data.amount() + ).map_err(|e| { + error!("‼️{:<3} - payment operation: {e:?}", "FAILED"); + Error::OperationError("payment operation".to_string()) + })? + ).map_err(|e| { + error!("‼️{:<3} - appending operation to transaction: {e:?}", "FAILED"); + Error::TransactionError("append operation".to_string()) + })?; + + Ok(payment_tx) +} + +fn merge_transaction( + source_account_id: PublicKey, + next_sequence: i64, + token:&Token, + max_time: u64, + destination_account_id: PublicKey, +) -> Result { + info!(" merge_transaction: start creating merge tx"); + // create a trust line + let change_trust_op = change_trust_operation(&token)?; + info!(" merge_transaction: op {change_trust_op:?}"); + + // account merge op + let merge_op = Operation::new_account_merge( + destination_account_id + ).map_err(|e| { + error!("‼️{:<3} - account merge operation: {e:?}", "FAILED"); + Error::OperationError("account merge operation".to_string()) + })?; + + info!(" merge_transaction: op {merge_op:?}"); + + let mut merge_tx = create_transaction_no_operations( + source_account_id, + next_sequence, + max_time, + None + )?; + + + info!(" merge_transaction: tx {merge_tx:?}"); + + merge_tx.append_multiple(vec![change_trust_op,merge_op]) + .map_err(|e| { + error!("‼️{:<3} - appending operations to transaction: {e:?}", "FAILED"); + Error::TransactionError("append multiple operations".to_string()) + })?; + + info!(" merge_transaction: tx append done"); + + Ok(merge_tx) +} + +#[cfg(test)] +mod test { + use substrate_stellar_sdk::{SecretKey,TransactionEnvelope, XdrCodec}; + use substrate_stellar_sdk::network::{PUBLIC_NETWORK, TEST_NETWORK}; + + + #[tokio::test(flavor = "multi_thread")] + async fn create_payment_test() { + let mut transaction = TransactionEnvelope::from_base64_xdr("AAAAAgAAAAAI0Q/BfivPVJeyPqP4fh23zQw7Oio2cJLRBpMu/WPKHwAPQkAAEI5tAAAAWQAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAdub3RoaW5nAAAAAAEAAAAAAAAAAQAAAADbXK4cnapJLq2NmMPtXroXHKJHwxyGGdLEGxO+7wLv/QAAAAFFVVJDAAAAACES7oY4Z+TiGf4lTAkYsAvJ6kAHdb/Dq0QwlxzlBYd8AAAJGE5yoAAAAAAAAAAAAA==") + .unwrap(); + + let secret = "SCVJD7BHU5LNFXNIDC7E226HISKUOZUEPJWLA2YU2GNBFMP5PYF2TQBH"; + let secret_key = SecretKey::from_encoding(secret).unwrap(); + let public_key = secret_key.get_public().clone(); + let public_key = String::from_utf8(public_key.to_encoding()).unwrap(); + println!("public key: {public_key}"); + + + transaction.sign(&TEST_NETWORK,vec![&secret_key]) + .unwrap(); + let res = transaction.to_base64_xdr(); + let res = transaction.create_base64_signature(&PUBLIC_NETWORK,&secret_key); + let res = String::from_utf8(res).unwrap(); + println!("the tx: {res}"); + + assert!(true); + } +} \ No newline at end of file diff --git a/signer-service-rust/src/api/horizon/tx_builder.rs b/signer-service-rust/src/api/horizon/tx_builder.rs deleted file mode 100644 index a83455c4..00000000 --- a/signer-service-rust/src/api/horizon/tx_builder.rs +++ /dev/null @@ -1,135 +0,0 @@ - -use substrate_stellar_sdk::{Asset, Operation, PublicKey, Signer, SignerKey, StroopAmount, TimeBounds, Transaction, TransactionEnvelope}; -use substrate_stellar_sdk::network::{Network, PUBLIC_NETWORK, TEST_NETWORK}; -use substrate_stellar_sdk::types::{ChangeTrustAsset, Preconditions}; -use tracing::error; -use wallet::operations::AppendExt; -use wallet::StellarWallet; -use crate::api::Error; -use crate::domain::models::{Token}; -use crate::utils::public_key_as_string; - -const BASE_FEE:u32 = 1000000; -const SET_OPT_LOW_THRESHOLD:u8 = 2; -const SET_OPT_MED_THRESHOLD:u8 = 2; -const SET_OPT_HIGH_THRESHOLD:u8 = 2; -const SET_OPT_SIGNER_WEIGHT:u32 = 1; - -pub async fn create_account_transaction(wallet:&StellarWallet, - asset_code:&str, - destination_account:PublicKey, - stroop_amount: i64, - max_time: u64 -) -> Result { - let create_op = Operation::new_create_account( - destination_account, - StroopAmount(stroop_amount) - ).map_err(|e| { - error!("‼️{:<3} - create account operation: {e:?}", "FAILED"); - Error::OperationError("create account".to_string()) - })?; - - // add threshold to the new account - let set_opt_op = Operation::new_set_options( - None, - None, - None, - None, - Some(SET_OPT_LOW_THRESHOLD), - Some(SET_OPT_MED_THRESHOLD), - Some(SET_OPT_HIGH_THRESHOLD), - None, - Some(Signer { - key: SignerKey::SignerKeyTypeEd25519(wallet.secret_key().into_binary()), - weight: SET_OPT_SIGNER_WEIGHT, - }) - ).map_err(|e| { - error!("‼️{:<3} - set options operation: {e:?}", "FAILED"); - Error::OperationError("set options".to_string()) - })?; - - // create a trust line - let token = Token::try_by_asset_code(asset_code)?; - let tk_asset = asset_to_change_trust_asset_type(&token)?; - let change_trust_op = Operation::new_change_trust( - tk_asset - ).map_err(|e| { - error!("‼️{:<3} - change trust asset operation: {e:?}", "FAILED"); - Error::OperationError("change trust asset".to_string()) - })?; - - // prepare the transaction: - let mut tx = create_transaction_no_operations(wallet,max_time).await?; - - // insert all 3 operations - tx.append_multiple(vec![create_op,set_opt_op,change_trust_op]) - .map_err(|e| { - error!("‼️{:<3} - appending operations to transaction: {e:?}", "FAILED"); - Error::TransactionError("append multiple operations".to_string()) - })?; - - - Ok(tx) -} - -fn asset_to_change_trust_asset_type(token:&Token) -> Result { - token.get_asset_type().map(|asset| match asset { - Asset::AssetTypeCreditAlphanum4(res) => - ChangeTrustAsset::AssetTypeCreditAlphanum4(res), - Asset::AssetTypeCreditAlphanum12(res) => - ChangeTrustAsset::AssetTypeCreditAlphanum12(res), - Asset::AssetTypeNative | Asset::Default(_) => - ChangeTrustAsset::AssetTypeNative - }).map_err(|e| e.into()) -} - -/// Basic transaction without any operations yet -async fn create_transaction_no_operations( - wallet: &StellarWallet, - max_time: u64 -) -> Result { - let next_sequence = wallet.get_sequence().await. - map_err(|e| { - let pub_key = public_key_as_string(&wallet.public_key()); - error!("‼️{:<3} - retrieving sequence number of Stellar Public Key: {pub_key}: {e:?}", "FAILED"); - Error::WalletError("sequence number".to_string()) - })? + 1; - - // prepare the transaction - Transaction::new( - wallet.public_key(), - next_sequence, - Some(BASE_FEE), - Preconditions::PrecondTime(TimeBounds{ min_time: 0, max_time }), - None // no memo - ).map_err(|e| { - error!("‼️{:<3} - creating transaction: {e:?}", "FAILED"); - Error::TransactionError("new".to_string()) - }) -} - - -fn create_and_sign_envelope( - wallet: &StellarWallet, - tx: Transaction, -) -> Result { - // convert to envelope - let mut envelope = tx.into_transaction_envelope(); - sign_envelope(wallet, &mut envelope)?; - - Ok(envelope) -} - -fn sign_envelope(wallet: &StellarWallet, envelope: &mut TransactionEnvelope) -> Result<(), Error> { - let network: &Network = - if wallet.is_public_network() { &PUBLIC_NETWORK } else { &TEST_NETWORK }; - - envelope - .sign(network, vec![&wallet.secret_key()]) - .map_err(|e| { - error!("‼️{:<3} - signing envelope: {e:?}", "FAILED"); - Error::WalletError("signing envelope".to_string()) - })?; - - Ok(()) -} \ No newline at end of file diff --git a/signer-service-rust/src/api/mod.rs b/signer-service-rust/src/api/mod.rs index 7e5c7aa8..199e3da6 100644 --- a/signer-service-rust/src/api/mod.rs +++ b/signer-service-rust/src/api/mod.rs @@ -1,21 +1,30 @@ pub mod routes; mod routes_static; -mod routes_stellar; mod horizon; + +use serde::{Deserialize, Serialize}; use crate::domain::models::Error as ModelsError; +use crate::config::Error as ConfigError; + +pub(super) use horizon::{build_create_account_tx, build_payment_and_merge_tx}; -#[derive(Debug)] +#[derive(Debug, Serialize, Deserialize)] pub enum Error { ModelError(ModelsError), - WalletError(String), OperationError(String), - TransactionError(String) + TransactionError(String), + ConfigError(ConfigError) } - impl From for Error { fn from(value: ModelsError) -> Self { Self::ModelError(value) } +} + +impl From for Error { + fn from(value: ConfigError) -> Self { + Self::ConfigError(value) + } } \ No newline at end of file diff --git a/signer-service-rust/src/api/routes.rs b/signer-service-rust/src/api/routes.rs deleted file mode 100644 index 872d1940..00000000 --- a/signer-service-rust/src/api/routes.rs +++ /dev/null @@ -1,82 +0,0 @@ -use axum::{debug_handler, Json, Router}; -use axum::extract::State; -use axum::routing::get; -use serde_json::{json, Value}; -use tokio::time::Instant; - -use tracing::{info, warn}; -use wallet::error::Error; -use wallet::{HorizonBalance, StellarWallet}; - -/* -// basic handler that responds with a static string -#[debug_handler] -pub async fn root() -> &'static str { - "Hello, World!" -} -*/ - - -#[debug_handler] -pub async fn stellar(State(wallet): State) { - -} - -#[debug_handler] -pub async fn status(State(wallet): State) -> Json { - let start = Instant::now(); - - let wallet_public_key = { - let pub_key = wallet.public_key().to_encoding(); - String::from_utf8(pub_key).unwrap_or("undefined".to_string()) - }; - - let res = match wallet.get_balances().await { - Ok(balances) => _get_balance_success(&wallet_public_key, balances), - Err(e) => { - let e = e.to_string(); - warn!("⚠️{:<3} - Stellar Public Key {wallet_public_key} balances: {e}", "FAILED"); - - Json(json!({ - "status": 500, - "error": "Server Error", - "details": e - })) - } - }; - - let duration = start.elapsed(); - info!("➡️ status {duration:?}"); - - res -} - -fn _get_balance_success(public_key:&str, balances: Vec) -> Json { - let failed_status = Json(json!({ - "status": false, - "public": public_key - })); - - let Some(native_balance) = balances.iter().find(|bal| { - if let Ok(asset_type) = std::str::from_utf8(&bal.asset_type) { - asset_type == "native" - } else { - false - } - } - ) else { - warn!("⚠️{:<3} - XLM balance of Stellar Public Key {public_key}\n", "NOT FOUND"); - return failed_status; - }; - - if native_balance.balance < 2.5 { - warn!("⚠️{:<3} - XLM balance of Stellar Public Key {public_key}\n", "INSUFFICIENT"); - return failed_status; - } - - info!("💰️{:<3} - Stellar Public Key {public_key} has sufficient XLM balance", "EXIST"); - Json(json!({ - "status": true, - "public": public_key - })) -} diff --git a/signer-service-rust/src/api/routes/mod.rs b/signer-service-rust/src/api/routes/mod.rs new file mode 100644 index 00000000..bcf6faae --- /dev/null +++ b/signer-service-rust/src/api/routes/mod.rs @@ -0,0 +1,41 @@ + +mod routes; + +use axum::handler::Handler; +use axum::Router; +use axum::routing::{get, post}; +use wallet::StellarWallet; +pub use routes::*; +use crate::config::AccountConfig; + + +// pub fn routes(account:&AccountConfig, wallet:StellarWallet) -> Router { +// let status_router = Router::new().route("/status", get(status)) +// .with_state(wallet); +// +// Router::new().nest("/v1", +// Router::new() +// .merge(status_router) +// .merge(stellar_routes(account)) +// ) +// } + +pub fn v1_routes(account:AccountConfig) -> Router { + Router::new().nest( + "/v1", + status_route(account.clone()) + .merge(stellar_routes(account)) + ) +} +fn status_route(account:AccountConfig) -> Router { + Router::new().route("/status", get(status)) + .with_state(account) +} + +fn stellar_routes(account:AccountConfig) -> Router { + Router::new() + .route("/stellar/create", post(create_account)) + .route("/stellar/payment", post(payment)) + .with_state(account) + +} \ No newline at end of file diff --git a/signer-service-rust/src/api/routes/routes.rs b/signer-service-rust/src/api/routes/routes.rs new file mode 100644 index 00000000..4dec2be3 --- /dev/null +++ b/signer-service-rust/src/api/routes/routes.rs @@ -0,0 +1,148 @@ +use axum::{debug_handler, Json}; +use axum::extract::State; +use serde_json::{json, Value}; +use tokio::time::Instant; + +use tracing::{info, warn}; +use wallet::{HorizonBalance, StellarWallet}; +use crate::api::{build_create_account_tx, build_payment_and_merge_tx}; +use crate::config::{AccountConfig, Error}; + +use crate::domain::models::requests; + +pub(super) async fn create_account( + State(funding_account): State, + Json(payload): Json +) -> Json { + let start = Instant::now(); + + let ephemeral_account_id = match payload.account_id_as_public_key() { + Ok(id) => id, + Err(result) => return result + }; + + let res = build_create_account_tx( + &funding_account, + &ephemeral_account_id, + &payload.asset_code, + payload.max_time + ).await + .unwrap_or_else(|e|{ + Json(json!({ + "status": 500, + "error": "Server Error", + "details": e + })) + + }); + + let duration = start.elapsed(); + info!("➡️ create {duration:?}"); + res +} + +pub(super) async fn payment( + State(funding_account): State, + Json(payload): Json +) -> Json { + info!("📦 {payload:#?}"); + + let start = Instant::now(); + + let ephemeral_account_id = match payload.account_id_as_public_key() { + Ok(id) => id, + Err(result) => return result + }; + + + info!(" ephemeral_account_id: {ephemeral_account_id:?}"); + + let res = build_payment_and_merge_tx( + &funding_account, + ephemeral_account_id, + payload.sequence, + payload.payment_data, + payload.max_time, + &payload.asset_code + ).unwrap_or_else(|e|{ + Json(json!({ + "status": 500, + "error": "Server Error", + "details": e + })) + + }); + + let duration = start.elapsed(); + info!("➡️ payment {duration:?}"); + res +} + +#[debug_handler] +pub(super) async fn status(State(account): State) -> Json { + let start = Instant::now(); + + let pub_key = account.public_key_as_str(); + let wallet = match account.create_wallet() { + Ok(w) => w, + Err(e) => { + let e = format!("{e:?}"); + return Json(json!({ + "status": 500, + "error": "Server Error", + "details": e + })); + } + }; + + + let res = match wallet.get_balances().await { + Ok(balances) => _get_balance_success(&pub_key, balances), + Err(e) => { + let e = e.to_string(); + warn!("⚠️{:<3} - Stellar Public Key {pub_key} balances: {e}", "FAILED"); + + Json(json!({ + "status": 500, + "error": "Server Error", + "details": e + })) + } + }; + + let duration = start.elapsed(); + info!("➡️ status {duration:?}"); + + res +} + + +fn _get_balance_success(public_key:&str, balances: Vec) -> Json { + let failed_status = Json(json!({ + "status": false, + "public": public_key + })); + + let Some(native_balance) = balances.iter().find(|bal| { + if let Ok(asset_type) = std::str::from_utf8(&bal.asset_type) { + asset_type == "native" + } else { + false + } + } + ) else { + warn!("⚠️{:<3} - XLM balance of Stellar Public Key {public_key}\n", "NOT FOUND"); + return failed_status; + }; + + if native_balance.balance < 2.5 { + warn!("⚠️{:<3} - XLM balance of Stellar Public Key {public_key}\n", "INSUFFICIENT"); + return failed_status; + } + + info!("💰️{:<3} - Stellar Public Key {public_key} has sufficient XLM balance", "EXIST"); + Json(json!({ + "status": true, + "public": public_key + })) +} diff --git a/signer-service-rust/src/api/routes_stellar.rs b/signer-service-rust/src/api/routes_stellar.rs deleted file mode 100644 index abb13006..00000000 --- a/signer-service-rust/src/api/routes_stellar.rs +++ /dev/null @@ -1,3 +0,0 @@ -use axum::extract::State; -use axum::Json; -use wallet::StellarWallet; diff --git a/signer-service-rust/src/config/wallet.rs b/signer-service-rust/src/config/account.rs similarity index 51% rename from signer-service-rust/src/config/wallet.rs rename to signer-service-rust/src/config/account.rs index 2d2142f9..772ed8c5 100644 --- a/signer-service-rust/src/config/wallet.rs +++ b/signer-service-rust/src/config/account.rs @@ -1,7 +1,8 @@ use std::env; use std::fmt::{Debug, Formatter}; -use substrate_stellar_sdk::{SecretKey, StellarTypeToString}; -use tracing::{error, warn}; +use substrate_stellar_sdk::{PublicKey, SecretKey, Transaction}; +use substrate_stellar_sdk::network::{Network, PUBLIC_NETWORK, TEST_NETWORK}; +use tracing::error; use wallet::StellarWallet; use crate::config::Error; use crate::utils::public_key_as_string; @@ -9,21 +10,22 @@ use crate::utils::public_key_as_string; const STELLAR_SECRET_KEY:&str = "STELLAR_SECRET_KEY"; const STELLAR_PUBLIC_NETWORK:&str = "STELLAR_PUBLIC_NETWORK"; -pub struct WalletConfig { +#[derive(Clone)] +pub struct AccountConfig { secret:SecretKey, is_public_network: bool } -impl Debug for WalletConfig { +impl Debug for AccountConfig { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - f.debug_struct("WalletConfig") + f.debug_struct("AccountConfig") .field("secret", &"******") .field("is_public_network", &self.is_public_network) .finish() } } -impl WalletConfig { +impl AccountConfig { pub(super) fn try_from_env() -> Result { let secret = env::var("STELLAR_SECRET_KEY").map_err(|_| Error::MissingStellarSecretKey)?; let secret = SecretKey::from_encoding(&secret) @@ -39,7 +41,7 @@ impl WalletConfig { Error::ParseFailed("stellar public network".to_string()) })?; - Ok(WalletConfig { + Ok(AccountConfig { secret, is_public_network, }) @@ -49,6 +51,51 @@ impl WalletConfig { public_key_as_string(self.secret.get_public()) } + pub fn public_key(&self) -> PublicKey { + self.public_key() + } + + pub fn network(&self) -> &Network { + if self.is_public_network { + &PUBLIC_NETWORK + } else { + &TEST_NETWORK + } + } + + /// Returns a signature OR the Vec version of the signature + pub fn create_base64_signature( + &self, + tx:Transaction + ) -> Result { + let x = tx.into_transaction_envelope(); + let res = x.create_base64_signature( + self.network(), + &self.secret + ); + + String::from_utf8(res.clone()) + .map_err(|e| { + error!("⚠️{:<3} - converting Vec to base64 signature: {e:?}\n", "FAILED"); + Error::ParseFailed("base64 signature".to_string()) + }) + } + + pub async fn get_sequence(&self) -> Result { + let pub_key = self.public_key_as_str(); + + let wallet = StellarWallet::from_secret_key(self.secret.clone(),self.is_public_network) + .map_err(|e|{ + error!("⚠️{:<3} - creating wallet of {pub_key}: {e:?}\n", "FAILED"); + Error::CreateWalletFailed + })?; + + wallet.get_sequence().await.map_err(|e|{ + error!("⚠️{:<3} - retrieving next sequence of {pub_key}: {e:?}\n", "FAILED"); + Error::CreateWalletFailed + }) + } + pub fn create_wallet(&self) -> Result { StellarWallet::from_secret_key(self.secret.clone(), self.is_public_network) .map_err(|e| { @@ -56,4 +103,5 @@ impl WalletConfig { Error::CreateWalletFailed }) } + } \ No newline at end of file diff --git a/signer-service-rust/src/config/error.rs b/signer-service-rust/src/config/error.rs index a8e1f9ef..fd65c5db 100644 --- a/signer-service-rust/src/config/error.rs +++ b/signer-service-rust/src/config/error.rs @@ -1,6 +1,6 @@ +use serde::{Deserialize, Serialize}; - -#[derive(Debug)] +#[derive(Debug, Serialize, Deserialize)] pub enum Error { FileDoesNotExist(String), diff --git a/signer-service-rust/src/config/mod.rs b/signer-service-rust/src/config/mod.rs index 016f0049..136eac39 100644 --- a/signer-service-rust/src/config/mod.rs +++ b/signer-service-rust/src/config/mod.rs @@ -1,14 +1,13 @@ mod server; mod database; mod error; -mod wallet; +mod account; use std::env; -use serde_json::error::Category::Data; pub use server::ServerConfig; pub use database::DatabaseConfig; +pub use account::AccountConfig; pub use error::Error; -use crate::config::wallet::WalletConfig; use tracing::error; @@ -16,7 +15,7 @@ use tracing::error; pub struct Config { server:ServerConfig, database: DatabaseConfig, - wallet: WalletConfig + account: AccountConfig } impl Config { @@ -30,7 +29,7 @@ impl Config { Ok(Config { server: ServerConfig::try_from_env()?, database: DatabaseConfig::try_from_env()?, - wallet: WalletConfig::try_from_env()? + account: AccountConfig::try_from_env()? }) } @@ -42,7 +41,7 @@ impl Config { &self.database } - pub fn wallet_config(&self) -> &WalletConfig { &self.wallet } + pub fn account_config(&self) -> AccountConfig { self.account.clone() } } #[doc(hidden)] diff --git a/signer-service-rust/src/config/server.rs b/signer-service-rust/src/config/server.rs index 0a4c5825..7cacdb96 100644 --- a/signer-service-rust/src/config/server.rs +++ b/signer-service-rust/src/config/server.rs @@ -1,7 +1,6 @@ use std::{ - env::{self, VarError}, + env, net::SocketAddr, - path::Path }; use crate::config::{Error, try_get_port_from_env}; diff --git a/signer-service-rust/src/domain/models/mod.rs b/signer-service-rust/src/domain/models/mod.rs index 3c93fac1..1c9c8e5a 100644 --- a/signer-service-rust/src/domain/models/mod.rs +++ b/signer-service-rust/src/domain/models/mod.rs @@ -1,13 +1,41 @@ mod token; +mod sep24Result; +pub mod requests; + +use axum::Json; +use serde::{Deserialize, Serialize}; +use serde_json::{json, Value}; +use substrate_stellar_sdk::PublicKey; +use tracing::error; pub use token::Token; +pub use sep24Result::Sep24Result; + -#[derive(Debug)] +#[derive(Debug, Serialize, Deserialize)] pub enum Error { FileDoesNotExist(String), SerdeError(String), TokenDoesNotExist, EncodingFailed(String), - WalletError(String) + WalletError(String), + + InvalidMemo } + +fn get_public_key_or_return_json_error(id:&str, name:&str) -> Result> { + PublicKey::from_encoding(id).map_err(|e|{ + error!("‼️{:<3} - Encoding {name} {id}: {e:?}", "FAILED"); + let error = Error::EncodingFailed(format!("{name}")); + let error = format!("{error:?}"); + + Json(json!({ + "status": 500, + "error": "Server Error", + "details": error + })) + + }) + +} \ No newline at end of file diff --git a/signer-service-rust/src/domain/models/requests.rs b/signer-service-rust/src/domain/models/requests.rs new file mode 100644 index 00000000..7dc9624c --- /dev/null +++ b/signer-service-rust/src/domain/models/requests.rs @@ -0,0 +1,34 @@ +use axum::Json; +use serde::{Deserialize, Serialize}; +use serde_json::Value; +use substrate_stellar_sdk::PublicKey; +use crate::domain::models::{get_public_key_or_return_json_error, Sep24Result}; + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct StellarPaymentRequestBody { + pub account_id: String, + pub sequence: i64, + pub payment_data: Sep24Result, + pub max_time: u64, + pub asset_code: String, +} + +impl StellarPaymentRequestBody { + pub fn account_id_as_public_key(&self) -> Result> { + get_public_key_or_return_json_error(&self.account_id, "account_id") + } +} + +#[derive(Debug,Serialize,Deserialize)] +pub struct StellarCreateRequestBody { + pub account_id: String, + pub max_time: u64, + pub asset_code: String +} + +impl StellarCreateRequestBody { + pub fn account_id_as_public_key(&self) -> Result> { + get_public_key_or_return_json_error(&self.account_id, "account_id") + } +} \ No newline at end of file diff --git a/signer-service-rust/src/domain/models/sep24Result.rs b/signer-service-rust/src/domain/models/sep24Result.rs new file mode 100644 index 00000000..d6d5129e --- /dev/null +++ b/signer-service-rust/src/domain/models/sep24Result.rs @@ -0,0 +1,71 @@ +use std::fmt::Debug; +use serde::{Deserialize, Serialize}; +use substrate_stellar_sdk::{Memo, PublicKey, StroopAmount}; +use substrate_stellar_sdk::compound_types::LimitedString; +use tracing::error; +use crate::domain::models::Error; + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Sep24Result { + pub amount: i64, + pub memo: String, + pub memo_type: String, + pub offramping_account: String, +} + +impl Sep24Result { + pub fn amount(&self) -> StroopAmount { + StroopAmount(self.amount) + } + + pub fn memo(&self) -> Result{ + let memo_type = self.memo_type.to_lowercase(); + + match memo_type.as_str() { + "1" | "text" | "memotext" => { + let memo = self.memo.clone().into_bytes(); + Ok(Memo::MemoText( + LimitedString::new(memo) + .map_err(|e| { + error!("‼️{:<3} - Convert memo to type Memo: {e:?}", "FAILED"); + Error::InvalidMemo + })? + )) + } + "3" | "hash" | "memohash" => { + let _memo = self.memo.as_bytes(); + let mut memo = [0;32]; + memo[.._memo.len()].copy_from_slice(_memo); + Ok(Memo::MemoHash(memo)) + } + _ => { + error!("‼️{:<3} - Unsupported offramp memo type: {:?}", "FAILED", self.memo_type); + Err(Error::InvalidMemo) + } + } + } + + pub fn offramping_account(&self) -> Result { + PublicKey::from_encoding(&self.offramping_account).map_err(|e| { + error!("‼️{:<3} - Encoding offramping account {}: {e:?}", "FAILED", self.offramping_account); + Error::EncodingFailed("offramping account".to_string()) + }) + + } + + #[cfg(test)] + pub fn new( + amount: i64, + memo: String, + memo_type: String, + offramping_account: String + ) -> Self { + Sep24Result { + amount, + memo, + memo_type, + offramping_account + } + } +} diff --git a/signer-service-rust/src/domain/models/token.rs b/signer-service-rust/src/domain/models/token.rs index 890d5d18..17f19ede 100644 --- a/signer-service-rust/src/domain/models/token.rs +++ b/signer-service-rust/src/domain/models/token.rs @@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize}; use substrate_stellar_sdk::{Asset, PublicKey}; use substrate_stellar_sdk::types::{AlphaNum12, AlphaNum4}; -use tracing::{error, warn}; +use tracing::error; use crate::domain::models::Error; #[derive(Debug, Serialize,Deserialize)] @@ -15,6 +15,7 @@ pub struct Token { } impl Token { + /// Returns a Token by reading from a json file pub fn try_from_path(path: &str) -> Result { let read_file = std::fs::read_to_string(path) .map_err(|e| { @@ -33,6 +34,8 @@ impl Token { }) } + /// Returns a Token based on a supported asset_code + /// todo: read from database next time pub fn try_by_asset_code(asset_code:&str) -> Result { let asset_code = asset_code.to_uppercase(); let path = format!("./resources/tokens/{asset_code}.json"); @@ -66,18 +69,25 @@ impl Token { } pub fn get_asset_type(&self) -> Result { + let _asset_code = self.asset_code.as_bytes(); Ok( if self.asset_code.len() <= 4 { + let mut asset_code = [0; 4]; + asset_code[.._asset_code.len()].copy_from_slice(_asset_code); + Asset::AssetTypeCreditAlphanum4( AlphaNum4 { - asset_code: self.asset_code.clone().into(), + asset_code, issuer: self.asset_issuer()? } ) } else { + let mut asset_code = [0; 12]; + asset_code[.._asset_code.len()].copy_from_slice(_asset_code); + Asset::AssetTypeCreditAlphanum12( AlphaNum12 { - asset_code: self.asset_code.clone().into(), + asset_code, issuer: self.asset_issuer()?, } ) diff --git a/signer-service-rust/src/main.rs b/signer-service-rust/src/main.rs index 75e9b3d9..37bc59e5 100644 --- a/signer-service-rust/src/main.rs +++ b/signer-service-rust/src/main.rs @@ -1,7 +1,7 @@ mod config; pub mod infra; mod api; -mod domain; +pub mod domain; pub mod utils; use axum::Router; @@ -14,7 +14,7 @@ use tracing_subscriber::{ util::SubscriberInitExt }; use wallet::StellarWallet; -use crate::api::routes::status; +use crate::api::routes::{v1_routes}; pub struct State; #[tokio::main] @@ -23,16 +23,15 @@ async fn main() { let config = config::Config::try_from_env_file(".env").unwrap(); let server_addr = config.server_config().socket_address().unwrap(); - let wallet = config.wallet_config().create_wallet().unwrap(); + let account_cfg = config.account_config(); + let wallet = account_cfg.create_wallet().unwrap(); let listener = tokio::net::TcpListener::bind(server_addr).await.unwrap(); info!("🚀{:<3} - {:?}\n", "LISTENING", listener.local_addr()); - let routes = Router::new().route("/", get(root)) - .route("/status", get(status)) - .with_state(wallet); - axum::serve(listener,routes).await.unwrap(); + + axum::serve(listener,v1_routes(account_cfg)).await.unwrap(); } async fn root() -> &'static str { diff --git a/signer-service-rust/src/utils/helper.rs b/signer-service-rust/src/utils/helper.rs index a549d61e..f3b7b253 100644 --- a/signer-service-rust/src/utils/helper.rs +++ b/signer-service-rust/src/utils/helper.rs @@ -1,10 +1,9 @@ use substrate_stellar_sdk::PublicKey; -use tracing::warn; pub fn public_key_as_string(public_key:&PublicKey) -> String { String::from_utf8(public_key.to_encoding()) .unwrap_or_else(|e| { - warn!("⚠️{:<3} - Stellar Public Key conversion:{e:?}\n", "WARNING"); + tracing::warn!("⚠️{:<3} - Stellar Public Key conversion:{e:?}\n", "WARNING"); "undefined".to_string() }) } \ No newline at end of file From f43b3cd040678c756a0c268c29ceaac9fbcfe3c8 Mon Sep 17 00:00:00 2001 From: b-yap <2826165+b-yap@users.noreply.github.com> Date: Wed, 5 Jun 2024 21:12:15 +0800 Subject: [PATCH 05/15] share env example --- signer-service-rust/.env | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 signer-service-rust/.env diff --git a/signer-service-rust/.env b/signer-service-rust/.env new file mode 100644 index 00000000..a1a1a5e2 --- /dev/null +++ b/signer-service-rust/.env @@ -0,0 +1,10 @@ +SERVER_HOST=127.0.0.1 +SERVER_PORT=3001 + +DATABASE_HOST=localhost +DATABASE_PORT=5432 +POSTGRES_USER=superuser +POSTGRES_PASSWORD=1234 + +STELLAR_SECRET_KEY=SCVJD7BHU5LNFXNIDC7E226HISKUOZUEPJWLA2YU2GNBFMP5PYF2TQBH +STELLAR_PUBLIC_NETWORK=false From c026e2f3fd59aff31e0c7ad4dabb5015e386906e Mon Sep 17 00:00:00 2001 From: b-yap <2826165+b-yap@users.noreply.github.com> Date: Wed, 5 Jun 2024 23:58:56 +0800 Subject: [PATCH 06/15] code cleanup --- signer-service-rust/src/api/default.html | 13 ---- .../src/api/horizon/create_account_tx.rs | 11 +++- signer-service-rust/src/api/horizon/helper.rs | 8 ++- .../src/api/horizon/payment_and_merge_tx.rs | 57 ++++-------------- signer-service-rust/src/api/mod.rs | 27 +++++---- signer-service-rust/src/api/requests.rs | 55 +++++++++++++++++ signer-service-rust/src/api/routes/mod.rs | 22 ++----- signer-service-rust/src/api/routes/routes.rs | 59 +++++++------------ signer-service-rust/src/api/routes_static.rs | 17 ------ .../src/{domain/models => api}/sep24Result.rs | 15 +++-- signer-service-rust/src/config/account.rs | 36 ++++++----- signer-service-rust/src/domain/mod.rs | 2 - signer-service-rust/src/domain/models/mod.rs | 41 ------------- .../src/domain/models/requests.rs | 34 ----------- signer-service-rust/src/infra/error.rs | 9 ++- signer-service-rust/src/infra/mod.rs | 5 +- .../src/{domain/models => infra}/token.rs | 40 ++++--------- signer-service-rust/src/main.rs | 10 ---- 18 files changed, 175 insertions(+), 286 deletions(-) delete mode 100644 signer-service-rust/src/api/default.html create mode 100644 signer-service-rust/src/api/requests.rs delete mode 100644 signer-service-rust/src/api/routes_static.rs rename signer-service-rust/src/{domain/models => api}/sep24Result.rs (83%) delete mode 100644 signer-service-rust/src/domain/mod.rs delete mode 100644 signer-service-rust/src/domain/models/mod.rs delete mode 100644 signer-service-rust/src/domain/models/requests.rs rename signer-service-rust/src/{domain/models => infra}/token.rs (85%) diff --git a/signer-service-rust/src/api/default.html b/signer-service-rust/src/api/default.html deleted file mode 100644 index 10d55b44..00000000 --- a/signer-service-rust/src/api/default.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - AWESOME-APP Web - - - -Hello World! - - - \ No newline at end of file diff --git a/signer-service-rust/src/api/horizon/create_account_tx.rs b/signer-service-rust/src/api/horizon/create_account_tx.rs index 50918ea0..58089dad 100644 --- a/signer-service-rust/src/api/horizon/create_account_tx.rs +++ b/signer-service-rust/src/api/horizon/create_account_tx.rs @@ -4,9 +4,9 @@ use substrate_stellar_sdk::{Operation, PublicKey, Signer, SignerKey, StroopAmoun use tracing::error; use wallet::operations::AppendExt; use crate::api::Error; -use crate::domain::models::{Token}; use crate::api::horizon::helper::{change_trust_operation, create_transaction_no_operations, operation_with_custom_err}; use crate::config::AccountConfig; +use crate::infra::Token; const SET_OPT_LOW_THRESHOLD:u8 = 2; const SET_OPT_MED_THRESHOLD:u8 = 2; @@ -15,6 +15,13 @@ const SET_OPT_SIGNER_WEIGHT:u32 = 1; const NEW_ACCOUNT_STARTING_BALANCE:StroopAmount = StroopAmount(2500000); +/// Returns a [`Json`] of the `funding_account`'s signature (for signing this transaction) +/// and sequence number (when submitting this transaction) +/// +/// This transaction will perform 3 operations: +/// * Create an account, for `ephemeral_account_id` +/// * Add threshold to that account +/// * Add a trust line wth the given `asset_code` pub async fn build_create_account_tx( funding_account: &AccountConfig, ephemeral_account_id: &PublicKey, @@ -22,6 +29,7 @@ pub async fn build_create_account_tx( max_time: u64, ) -> Result,Error> { let sequence = funding_account.get_sequence().await?; + // prepare the transaction: let mut tx = create_transaction_no_operations( funding_account.public_key(), @@ -53,7 +61,6 @@ pub async fn build_create_account_tx( }))) } - fn prepare_all_operations( funding_account: &AccountConfig, ephemeral_account_id: PublicKey, diff --git a/signer-service-rust/src/api/horizon/helper.rs b/signer-service-rust/src/api/horizon/helper.rs index 9aa3d393..9ff87eb6 100644 --- a/signer-service-rust/src/api/horizon/helper.rs +++ b/signer-service-rust/src/api/horizon/helper.rs @@ -2,10 +2,11 @@ use substrate_stellar_sdk::{Asset, Memo, Operation, PublicKey, TimeBounds, Trans use substrate_stellar_sdk::types::{ChangeTrustAsset, Preconditions}; use tracing::error; use crate::api::Error; -use crate::domain::models::Token; const BASE_FEE:u32 = 1000000; +#[doc(hidden)] +/// A helper macro to convert [`substrate_stellar_sdk::StellarSdkError`] to [`Error::OperationError`] macro_rules! operation_with_custom_err { ($op:expr, $op_str:expr) => { $op.map_err(|e| { @@ -17,8 +18,9 @@ macro_rules! operation_with_custom_err { } pub(super) use operation_with_custom_err; +use crate::infra::Token; -/// Basic transaction without any operations yet +/// Returns a basic [`Transaction`] WITHOUT any operations yet pub(super) fn create_transaction_no_operations( source_account: PublicKey, next_sequence: i64, @@ -47,7 +49,7 @@ pub(super) fn change_trust_operation(token:&Token) -> Result { ) } pub(super) fn asset_to_change_trust_asset_type(token:&Token) -> Result { - token.get_asset_type().map(|asset| match asset { + token.asset_type().map(|asset| match asset { Asset::AssetTypeCreditAlphanum4(res) => ChangeTrustAsset::AssetTypeCreditAlphanum4(res), Asset::AssetTypeCreditAlphanum12(res) => diff --git a/signer-service-rust/src/api/horizon/payment_and_merge_tx.rs b/signer-service-rust/src/api/horizon/payment_and_merge_tx.rs index 2ac1df59..574d42cc 100644 --- a/signer-service-rust/src/api/horizon/payment_and_merge_tx.rs +++ b/signer-service-rust/src/api/horizon/payment_and_merge_tx.rs @@ -1,13 +1,18 @@ use axum::Json; use serde_json::{json, Value}; use substrate_stellar_sdk::{Operation, PublicKey, Transaction}; -use tracing::{error, info}; +use tracing::error; use wallet::operations::AppendExt; -use crate::api::Error; +use crate::api::{Error, Sep24Result}; use crate::api::horizon::helper::{change_trust_operation, create_transaction_no_operations}; -use crate::domain::models::{Sep24Result, Token}; use crate::config::AccountConfig; +use crate::infra::Token; + +/// Returns a [`Json`] of the `funding_account`'s signatures for signing 2 transactions: +/// * payment transaction +/// * account merge transaction +/// * merging the `ephemeral_account_id` to the `funding_account` pub fn build_payment_and_merge_tx( funding_account: &AccountConfig, ephemeral_account_id: PublicKey, @@ -26,8 +31,6 @@ pub fn build_payment_and_merge_tx( payment_data )?; - info!(" payment_tx: {payment_tx:?}"); - let merge_tx = merge_transaction( ephemeral_account_id, ephemeral_sequence, @@ -36,7 +39,6 @@ pub fn build_payment_and_merge_tx( funding_account.public_key() )?; - info!(" merge_tx: {merge_tx:?}"); let payment_tx_sig = funding_account.create_base64_signature(payment_tx)?; let merge_tx_sig = funding_account.create_base64_signature(merge_tx)?; @@ -56,7 +58,6 @@ fn payment_transaction( max_time: u64, payment_data: Sep24Result ) -> Result { - let mut payment_tx = create_transaction_no_operations( source_account_id, next_sequence, @@ -66,8 +67,8 @@ fn payment_transaction( payment_tx.append_operation( Operation::new_payment( - payment_data.offramping_account()?, - token.get_asset_type()?, + payment_data.offramping_account_id()?, + token.asset_type()?, payment_data.amount() ).map_err(|e| { error!("‼️{:<3} - payment operation: {e:?}", "FAILED"); @@ -88,10 +89,8 @@ fn merge_transaction( max_time: u64, destination_account_id: PublicKey, ) -> Result { - info!(" merge_transaction: start creating merge tx"); // create a trust line let change_trust_op = change_trust_operation(&token)?; - info!(" merge_transaction: op {change_trust_op:?}"); // account merge op let merge_op = Operation::new_account_merge( @@ -101,8 +100,6 @@ fn merge_transaction( Error::OperationError("account merge operation".to_string()) })?; - info!(" merge_transaction: op {merge_op:?}"); - let mut merge_tx = create_transaction_no_operations( source_account_id, next_sequence, @@ -110,45 +107,11 @@ fn merge_transaction( None )?; - - info!(" merge_transaction: tx {merge_tx:?}"); - merge_tx.append_multiple(vec![change_trust_op,merge_op]) .map_err(|e| { error!("‼️{:<3} - appending operations to transaction: {e:?}", "FAILED"); Error::TransactionError("append multiple operations".to_string()) })?; - info!(" merge_transaction: tx append done"); - Ok(merge_tx) -} - -#[cfg(test)] -mod test { - use substrate_stellar_sdk::{SecretKey,TransactionEnvelope, XdrCodec}; - use substrate_stellar_sdk::network::{PUBLIC_NETWORK, TEST_NETWORK}; - - - #[tokio::test(flavor = "multi_thread")] - async fn create_payment_test() { - let mut transaction = TransactionEnvelope::from_base64_xdr("AAAAAgAAAAAI0Q/BfivPVJeyPqP4fh23zQw7Oio2cJLRBpMu/WPKHwAPQkAAEI5tAAAAWQAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAdub3RoaW5nAAAAAAEAAAAAAAAAAQAAAADbXK4cnapJLq2NmMPtXroXHKJHwxyGGdLEGxO+7wLv/QAAAAFFVVJDAAAAACES7oY4Z+TiGf4lTAkYsAvJ6kAHdb/Dq0QwlxzlBYd8AAAJGE5yoAAAAAAAAAAAAA==") - .unwrap(); - - let secret = "SCVJD7BHU5LNFXNIDC7E226HISKUOZUEPJWLA2YU2GNBFMP5PYF2TQBH"; - let secret_key = SecretKey::from_encoding(secret).unwrap(); - let public_key = secret_key.get_public().clone(); - let public_key = String::from_utf8(public_key.to_encoding()).unwrap(); - println!("public key: {public_key}"); - - - transaction.sign(&TEST_NETWORK,vec![&secret_key]) - .unwrap(); - let res = transaction.to_base64_xdr(); - let res = transaction.create_base64_signature(&PUBLIC_NETWORK,&secret_key); - let res = String::from_utf8(res).unwrap(); - println!("the tx: {res}"); - - assert!(true); - } } \ No newline at end of file diff --git a/signer-service-rust/src/api/mod.rs b/signer-service-rust/src/api/mod.rs index 199e3da6..8ce040e2 100644 --- a/signer-service-rust/src/api/mod.rs +++ b/signer-service-rust/src/api/mod.rs @@ -1,30 +1,35 @@ pub mod routes; -mod routes_static; mod horizon; +mod sep24Result; +pub mod requests; + +pub use sep24Result::Sep24Result; use serde::{Deserialize, Serialize}; -use crate::domain::models::Error as ModelsError; use crate::config::Error as ConfigError; +use crate::infra::Error as InfraError; pub(super) use horizon::{build_create_account_tx, build_payment_and_merge_tx}; #[derive(Debug, Serialize, Deserialize)] pub enum Error { - ModelError(ModelsError), + InvalidMemo, + EncodingFailed(String), OperationError(String), TransactionError(String), - ConfigError(ConfigError) -} - -impl From for Error { - fn from(value: ModelsError) -> Self { - Self::ModelError(value) - } + ConfigError(ConfigError), + InfraError(InfraError) } impl From for Error { fn from(value: ConfigError) -> Self { Self::ConfigError(value) } -} \ No newline at end of file +} + +impl From for Error { + fn from(value: InfraError) -> Self { + Self::InfraError(value) + } +} diff --git a/signer-service-rust/src/api/requests.rs b/signer-service-rust/src/api/requests.rs new file mode 100644 index 00000000..ff5eb602 --- /dev/null +++ b/signer-service-rust/src/api/requests.rs @@ -0,0 +1,55 @@ +use axum::Json; +use serde::{Deserialize, Serialize}; +use serde_json::{json, Value}; +use substrate_stellar_sdk::PublicKey; +use tracing::error; +use crate::api::Sep24Result; + +/// Request Body of [crate::api::routes::create_account()] +/// with api: POST /v1/stellar/create +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct StellarCreateRequestBody { + pub account_id: String, + pub max_time: u64, + pub asset_code: String +} + +impl StellarCreateRequestBody { + /// returns the account id as [`PublicKey`], or an error in [`Json`] format + pub fn account_id_as_public_key(&self) -> Result> { + get_public_key_or_return_json_error(&self.account_id, "account_id") + } +} + +/// Request Body of [crate::api::routes::payment()] +/// with api: POST /v1/stellar/create +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct StellarPaymentRequestBody { + pub account_id: String, + pub sequence: i64, + pub payment_data: Sep24Result, + pub max_time: u64, + pub asset_code: String, +} + +impl StellarPaymentRequestBody { + /// returns the account id as [`PublicKey`], or an error in [`Json`] format + pub fn account_id_as_public_key(&self) -> Result> { + get_public_key_or_return_json_error(&self.account_id, "account_id") + } +} + +fn get_public_key_or_return_json_error(id:&str, name:&str) -> Result> { + PublicKey::from_encoding(id).map_err(|e|{ + error!("‼️{:<3} - Encoding {name} {id}: {e:?}", "FAILED"); + let error = format!("Encoding Failed: {name}"); + + Json(json!({ + "status": 500, + "error": "Server Error", + "details": error + })) + }) +} \ No newline at end of file diff --git a/signer-service-rust/src/api/routes/mod.rs b/signer-service-rust/src/api/routes/mod.rs index bcf6faae..3ac72db1 100644 --- a/signer-service-rust/src/api/routes/mod.rs +++ b/signer-service-rust/src/api/routes/mod.rs @@ -1,25 +1,11 @@ - mod routes; -use axum::handler::Handler; use axum::Router; use axum::routing::{get, post}; -use wallet::StellarWallet; -pub use routes::*; +use crate::api::routes::routes::{create_account, payment, status}; use crate::config::AccountConfig; - -// pub fn routes(account:&AccountConfig, wallet:StellarWallet) -> Router { -// let status_router = Router::new().route("/status", get(status)) -// .with_state(wallet); -// -// Router::new().nest("/v1", -// Router::new() -// .merge(status_router) -// .merge(stellar_routes(account)) -// ) -// } - +/// Returns /v1/... routes pub fn v1_routes(account:AccountConfig) -> Router { Router::new().nest( "/v1", @@ -27,11 +13,15 @@ pub fn v1_routes(account:AccountConfig) -> Router { .merge(stellar_routes(account)) ) } + +/// GET /v1/status fn status_route(account:AccountConfig) -> Router { Router::new().route("/status", get(status)) .with_state(account) } +/// POST /v1/stellar/create and +/// POST /v1/stellar/payment fn stellar_routes(account:AccountConfig) -> Router { Router::new() .route("/stellar/create", post(create_account)) diff --git a/signer-service-rust/src/api/routes/routes.rs b/signer-service-rust/src/api/routes/routes.rs index 4dec2be3..2de3ae3e 100644 --- a/signer-service-rust/src/api/routes/routes.rs +++ b/signer-service-rust/src/api/routes/routes.rs @@ -1,19 +1,19 @@ -use axum::{debug_handler, Json}; +use axum::Json; use axum::extract::State; use serde_json::{json, Value}; use tokio::time::Instant; use tracing::{info, warn}; -use wallet::{HorizonBalance, StellarWallet}; -use crate::api::{build_create_account_tx, build_payment_and_merge_tx}; -use crate::config::{AccountConfig, Error}; - -use crate::domain::models::requests; +use wallet::HorizonBalance; +use crate::api::{build_create_account_tx, build_payment_and_merge_tx, requests}; +use crate::config::AccountConfig; +/// Performs POST /v1/stellar/create pub(super) async fn create_account( State(funding_account): State, Json(payload): Json ) -> Json { + info!("📦{:<3}: {payload:#?}","POST create payload"); let start = Instant::now(); let ephemeral_account_id = match payload.account_id_as_public_key() { @@ -37,15 +37,16 @@ pub(super) async fn create_account( }); let duration = start.elapsed(); - info!("➡️ create {duration:?}"); + info!("➡️{:<3} {duration:?}", "POST create"); res } +/// Performs POST /v1/stellar/payment pub(super) async fn payment( State(funding_account): State, Json(payload): Json ) -> Json { - info!("📦 {payload:#?}"); + info!("📦{:<3}: {payload:#?}","POST payment payload"); let start = Instant::now(); @@ -54,9 +55,6 @@ pub(super) async fn payment( Err(result) => return result }; - - info!(" ephemeral_account_id: {ephemeral_account_id:?}"); - let res = build_payment_and_merge_tx( &funding_account, ephemeral_account_id, @@ -74,34 +72,20 @@ pub(super) async fn payment( }); let duration = start.elapsed(); - info!("➡️ payment {duration:?}"); + info!("➡️{:<3} {duration:?}", "POST payment"); res } -#[debug_handler] + +/// Performs GET /v1/status pub(super) async fn status(State(account): State) -> Json { let start = Instant::now(); let pub_key = account.public_key_as_str(); - let wallet = match account.create_wallet() { - Ok(w) => w, - Err(e) => { - let e = format!("{e:?}"); - return Json(json!({ - "status": 500, - "error": "Server Error", - "details": e - })); - } - }; - - - let res = match wallet.get_balances().await { + let res = match account.get_balances().await { Ok(balances) => _get_balance_success(&pub_key, balances), Err(e) => { - let e = e.to_string(); - warn!("⚠️{:<3} - Stellar Public Key {pub_key} balances: {e}", "FAILED"); - + let e = format!("{e:?}"); Json(json!({ "status": 500, "error": "Server Error", @@ -111,16 +95,15 @@ pub(super) async fn status(State(account): State) -> Json }; let duration = start.elapsed(); - info!("➡️ status {duration:?}"); - + info!("➡️{:<3} {duration:?}", "GET status"); res } -fn _get_balance_success(public_key:&str, balances: Vec) -> Json { +fn _get_balance_success(public_key_as_str:&str, balances: Vec) -> Json { let failed_status = Json(json!({ "status": false, - "public": public_key + "public": public_key_as_str })); let Some(native_balance) = balances.iter().find(|bal| { @@ -131,18 +114,18 @@ fn _get_balance_success(public_key:&str, balances: Vec) -> Json< } } ) else { - warn!("⚠️{:<3} - XLM balance of Stellar Public Key {public_key}\n", "NOT FOUND"); + warn!("⚠️{:<3} - XLM balance of Stellar Public Key {public_key_as_str}\n", "NOT FOUND"); return failed_status; }; if native_balance.balance < 2.5 { - warn!("⚠️{:<3} - XLM balance of Stellar Public Key {public_key}\n", "INSUFFICIENT"); + warn!("⚠️{:<3} - XLM balance of Stellar Public Key {public_key_as_str}\n", "INSUFFICIENT"); return failed_status; } - info!("💰️{:<3} - Stellar Public Key {public_key} has sufficient XLM balance", "EXIST"); + info!("💰️{:<3} - Stellar Public Key {public_key_as_str} has sufficient XLM balance", "EXIST"); Json(json!({ "status": true, - "public": public_key + "public": public_key_as_str })) } diff --git a/signer-service-rust/src/api/routes_static.rs b/signer-service-rust/src/api/routes_static.rs deleted file mode 100644 index 089ed431..00000000 --- a/signer-service-rust/src/api/routes_static.rs +++ /dev/null @@ -1,17 +0,0 @@ -use axum::handler::HandlerWithoutStateExt; -use axum::http::StatusCode; -use axum::routing::{any_service, MethodRouter}; -use tower_http::services::ServeDir; - -// Note: Here we can just return a MethodRouter rather than a full Router -// since ServeDir is a service. -pub fn serve_dir() -> MethodRouter { - async fn handle_404() -> (StatusCode, &'static str) { - (StatusCode::NOT_FOUND, "Resource not found.") - } - - any_service( - ServeDir::new("./default.html") - .not_found_service(handle_404.into_service()), - ) -} \ No newline at end of file diff --git a/signer-service-rust/src/domain/models/sep24Result.rs b/signer-service-rust/src/api/sep24Result.rs similarity index 83% rename from signer-service-rust/src/domain/models/sep24Result.rs rename to signer-service-rust/src/api/sep24Result.rs index d6d5129e..21288f0b 100644 --- a/signer-service-rust/src/domain/models/sep24Result.rs +++ b/signer-service-rust/src/api/sep24Result.rs @@ -3,9 +3,9 @@ use serde::{Deserialize, Serialize}; use substrate_stellar_sdk::{Memo, PublicKey, StroopAmount}; use substrate_stellar_sdk::compound_types::LimitedString; use tracing::error; -use crate::domain::models::Error; +use crate::api::Error; -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct Sep24Result { pub amount: i64, @@ -18,7 +18,10 @@ impl Sep24Result { pub fn amount(&self) -> StroopAmount { StroopAmount(self.amount) } - + + /// returns a [`Memo`] from the fields [`self.memo`] and [`self.memo_type`]. + /// [`self.memo_type`] can be a numeric String value + /// derived from [`substrate_stellar_sdk::types::MemoType`] pub fn memo(&self) -> Result{ let memo_type = self.memo_type.to_lowercase(); @@ -45,13 +48,13 @@ impl Sep24Result { } } } - - pub fn offramping_account(&self) -> Result { + + /// returns offramping_account as [`PublicKey`] + pub fn offramping_account_id(&self) -> Result { PublicKey::from_encoding(&self.offramping_account).map_err(|e| { error!("‼️{:<3} - Encoding offramping account {}: {e:?}", "FAILED", self.offramping_account); Error::EncodingFailed("offramping account".to_string()) }) - } #[cfg(test)] diff --git a/signer-service-rust/src/config/account.rs b/signer-service-rust/src/config/account.rs index 772ed8c5..93ce477c 100644 --- a/signer-service-rust/src/config/account.rs +++ b/signer-service-rust/src/config/account.rs @@ -3,7 +3,7 @@ use std::fmt::{Debug, Formatter}; use substrate_stellar_sdk::{PublicKey, SecretKey, Transaction}; use substrate_stellar_sdk::network::{Network, PUBLIC_NETWORK, TEST_NETWORK}; use tracing::error; -use wallet::StellarWallet; +use wallet::{HorizonBalance, StellarWallet}; use crate::config::Error; use crate::utils::public_key_as_string; @@ -27,14 +27,14 @@ impl Debug for AccountConfig { impl AccountConfig { pub(super) fn try_from_env() -> Result { - let secret = env::var("STELLAR_SECRET_KEY").map_err(|_| Error::MissingStellarSecretKey)?; + let secret = env::var(STELLAR_SECRET_KEY).map_err(|_| Error::MissingStellarSecretKey)?; let secret = SecretKey::from_encoding(&secret) .map_err(|e| { error!("‼️Failed to parse stellar secret key ******: {e:?}"); Error::ParseFailed("stellar secret key".to_string()) })?; - let is_public_network = env::var("STELLAR_PUBLIC_NETWORK").map_err(|_| Error::MissingStellarNetworkIdentifier)?; + let is_public_network = env::var(STELLAR_PUBLIC_NETWORK).map_err(|_| Error::MissingStellarNetworkIdentifier)?; let is_public_network = is_public_network.parse::() .map_err(|_| { error!("‼️Failed to parse stellar public network {is_public_network}"); @@ -52,7 +52,7 @@ impl AccountConfig { } pub fn public_key(&self) -> PublicKey { - self.public_key() + self.secret.get_public().clone() } pub fn network(&self) -> &Network { @@ -82,24 +82,30 @@ impl AccountConfig { } pub async fn get_sequence(&self) -> Result { - let pub_key = self.public_key_as_str(); - - let wallet = StellarWallet::from_secret_key(self.secret.clone(),self.is_public_network) - .map_err(|e|{ - error!("⚠️{:<3} - creating wallet of {pub_key}: {e:?}\n", "FAILED"); - Error::CreateWalletFailed - })?; + let wallet = self.create_wallet()?; wallet.get_sequence().await.map_err(|e|{ + let pub_key = self.public_key_as_str(); error!("⚠️{:<3} - retrieving next sequence of {pub_key}: {e:?}\n", "FAILED"); Error::CreateWalletFailed }) } - pub fn create_wallet(&self) -> Result { - StellarWallet::from_secret_key(self.secret.clone(), self.is_public_network) - .map_err(|e| { - error!("‼️{:<3} - Wallet creation for Stellar Public Key: {}", "FAILED", self.public_key_as_str()); + pub async fn get_balances(&self) -> Result, Error> { + let wallet = self.create_wallet()?; + + wallet.get_balances().await.map_err(|e|{ + let pub_key = self.public_key_as_str(); + error!("⚠️{:<3} - retrieving balances of {pub_key}: {e:?}\n", "FAILED"); + Error::CreateWalletFailed + }) + } + + fn create_wallet(&self) -> Result { + StellarWallet::from_secret_key(self.secret.clone(),self.is_public_network) + .map_err(|e|{ + let pub_key = self.public_key_as_str(); + error!("⚠️{:<3} - creating wallet of {pub_key}: {e:?}\n", "FAILED"); Error::CreateWalletFailed }) } diff --git a/signer-service-rust/src/domain/mod.rs b/signer-service-rust/src/domain/mod.rs deleted file mode 100644 index 88b9624f..00000000 --- a/signer-service-rust/src/domain/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod models; - diff --git a/signer-service-rust/src/domain/models/mod.rs b/signer-service-rust/src/domain/models/mod.rs deleted file mode 100644 index 1c9c8e5a..00000000 --- a/signer-service-rust/src/domain/models/mod.rs +++ /dev/null @@ -1,41 +0,0 @@ -mod token; -mod sep24Result; -pub mod requests; - - -use axum::Json; -use serde::{Deserialize, Serialize}; -use serde_json::{json, Value}; -use substrate_stellar_sdk::PublicKey; -use tracing::error; -pub use token::Token; -pub use sep24Result::Sep24Result; - - -#[derive(Debug, Serialize, Deserialize)] -pub enum Error { - FileDoesNotExist(String), - SerdeError(String), - TokenDoesNotExist, - EncodingFailed(String), - - WalletError(String), - - InvalidMemo -} - -fn get_public_key_or_return_json_error(id:&str, name:&str) -> Result> { - PublicKey::from_encoding(id).map_err(|e|{ - error!("‼️{:<3} - Encoding {name} {id}: {e:?}", "FAILED"); - let error = Error::EncodingFailed(format!("{name}")); - let error = format!("{error:?}"); - - Json(json!({ - "status": 500, - "error": "Server Error", - "details": error - })) - - }) - -} \ No newline at end of file diff --git a/signer-service-rust/src/domain/models/requests.rs b/signer-service-rust/src/domain/models/requests.rs deleted file mode 100644 index 7dc9624c..00000000 --- a/signer-service-rust/src/domain/models/requests.rs +++ /dev/null @@ -1,34 +0,0 @@ -use axum::Json; -use serde::{Deserialize, Serialize}; -use serde_json::Value; -use substrate_stellar_sdk::PublicKey; -use crate::domain::models::{get_public_key_or_return_json_error, Sep24Result}; - -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct StellarPaymentRequestBody { - pub account_id: String, - pub sequence: i64, - pub payment_data: Sep24Result, - pub max_time: u64, - pub asset_code: String, -} - -impl StellarPaymentRequestBody { - pub fn account_id_as_public_key(&self) -> Result> { - get_public_key_or_return_json_error(&self.account_id, "account_id") - } -} - -#[derive(Debug,Serialize,Deserialize)] -pub struct StellarCreateRequestBody { - pub account_id: String, - pub max_time: u64, - pub asset_code: String -} - -impl StellarCreateRequestBody { - pub fn account_id_as_public_key(&self) -> Result> { - get_public_key_or_return_json_error(&self.account_id, "account_id") - } -} \ No newline at end of file diff --git a/signer-service-rust/src/infra/error.rs b/signer-service-rust/src/infra/error.rs index 07d7adb0..3d3d3f5e 100644 --- a/signer-service-rust/src/infra/error.rs +++ b/signer-service-rust/src/infra/error.rs @@ -1,8 +1,13 @@ +use serde::{Deserialize, Serialize}; -#[derive(Debug)] +#[derive(Debug, Serialize, Deserialize)] pub enum Error { InternalServerError, NotFound, - PoolError + PoolError, + TokenDoesNotExist, + DoesNotExist(String), + EncodingFailed(String), + SerdeError(String), } \ No newline at end of file diff --git a/signer-service-rust/src/infra/mod.rs b/signer-service-rust/src/infra/mod.rs index 00b6f539..4070772a 100644 --- a/signer-service-rust/src/infra/mod.rs +++ b/signer-service-rust/src/infra/mod.rs @@ -1,4 +1,7 @@ mod db; mod error; +mod token; -pub use error::Error; \ No newline at end of file + +pub use error::Error; +pub use token::Token; diff --git a/signer-service-rust/src/domain/models/token.rs b/signer-service-rust/src/infra/token.rs similarity index 85% rename from signer-service-rust/src/domain/models/token.rs rename to signer-service-rust/src/infra/token.rs index 17f19ede..0811c189 100644 --- a/signer-service-rust/src/domain/models/token.rs +++ b/signer-service-rust/src/infra/token.rs @@ -3,7 +3,7 @@ use substrate_stellar_sdk::{Asset, PublicKey}; use substrate_stellar_sdk::types::{AlphaNum12, AlphaNum4}; use tracing::error; -use crate::domain::models::Error; +use crate::infra::Error; #[derive(Debug, Serialize,Deserialize)] pub struct Token { @@ -16,20 +16,17 @@ pub struct Token { impl Token { /// Returns a Token by reading from a json file + /// todo: read from db next time pub fn try_from_path(path: &str) -> Result { let read_file = std::fs::read_to_string(path) - .map_err(|e| { + .map_err(|_| { error!("‼️{:<3} - Reading file {path}", "FAILED"); - - Error::FileDoesNotExist(path.to_string()) - + Error::DoesNotExist(path.to_string()) })?; serde_json::from_str(&read_file) .map_err(|e| { error!("‼️{:<3} - Deserializing to Token struct in file {path}: {e:?}", "FAILED"); - - Error::SerdeError(format!("Token struct in file {path}")) }) } @@ -42,7 +39,7 @@ impl Token { Self::try_from_path(&path).map_err(|e| { match e { - Error::FileDoesNotExist(_) => { + Error::DoesNotExist(_) => { Error::TokenDoesNotExist } _ => e @@ -60,15 +57,7 @@ impl Token { hex } - fn asset_issuer(&self) -> Result { - PublicKey::from_encoding(&self.asset_issuer).map_err(|e|{ - error!("‼️{:<3} - Encoding asset issuer:{}: {e:?}", "FAILED", &self.asset_issuer); - - Error::EncodingFailed("asset issuer".to_string()) - }) - } - - pub fn get_asset_type(&self) -> Result { + pub fn asset_type(&self) -> Result { let _asset_code = self.asset_code.as_bytes(); Ok( if self.asset_code.len() <= 4 { @@ -94,16 +83,11 @@ impl Token { } ) } -} -#[cfg(test)] -mod test { - use crate::domain::models::Token; - - #[test] - fn test_me() { - let cfg = Token::try_by_asset_code("BRL"); - println!("The value of cfg: {cfg:?}"); - assert!(true); + fn asset_issuer(&self) -> Result { + PublicKey::from_encoding(&self.asset_issuer).map_err(|e|{ + error!("‼️{:<3} - Encoding asset issuer:{}: {e:?}", "FAILED", &self.asset_issuer); + Error::EncodingFailed("asset issuer".to_string()) + }) } -} \ No newline at end of file +} diff --git a/signer-service-rust/src/main.rs b/signer-service-rust/src/main.rs index 37bc59e5..62c7ecb5 100644 --- a/signer-service-rust/src/main.rs +++ b/signer-service-rust/src/main.rs @@ -1,11 +1,8 @@ mod config; pub mod infra; mod api; -pub mod domain; pub mod utils; -use axum::Router; -use axum::routing::get; use tracing::info; use tracing_subscriber::{ filter::EnvFilter, @@ -13,7 +10,6 @@ use tracing_subscriber::{ layer::SubscriberExt, util::SubscriberInitExt }; -use wallet::StellarWallet; use crate::api::routes::{v1_routes}; pub struct State; @@ -25,19 +21,13 @@ async fn main() { let server_addr = config.server_config().socket_address().unwrap(); let account_cfg = config.account_config(); - let wallet = account_cfg.create_wallet().unwrap(); let listener = tokio::net::TcpListener::bind(server_addr).await.unwrap(); info!("🚀{:<3} - {:?}\n", "LISTENING", listener.local_addr()); - axum::serve(listener,v1_routes(account_cfg)).await.unwrap(); } -async fn root() -> &'static str { - "Server is Running!" -} - /// initialize for logging purposes fn init_tracing() { tracing_subscriber::registry() From 1a7f1676c66749f7e5e85e3a3f69cc372309aa92 Mon Sep 17 00:00:00 2001 From: b-yap <2826165+b-yap@users.noreply.github.com> Date: Thu, 6 Jun 2024 22:19:00 +0800 Subject: [PATCH 07/15] tested, result similar to js now --- signer-service-rust/Cargo.lock | 4763 ----------------- signer-service-rust/Cargo.toml | 4 +- signer-service-rust/diesel.toml | 6 + .../down.sql | 1 + .../up.sql | 10 + signer-service-rust/rust-toolchain.toml | 2 +- .../src/api/horizon/create_account_tx.rs | 30 +- signer-service-rust/src/api/horizon/helper.rs | 7 - .../src/api/horizon/payment_and_merge_tx.rs | 45 +- signer-service-rust/src/api/mod.rs | 4 +- signer-service-rust/src/api/requests.rs | 2 + .../src/api/routes/{routes.rs => methods.rs} | 1 + signer-service-rust/src/api/routes/mod.rs | 4 +- signer-service-rust/src/api/sep24Result.rs | 10 +- signer-service-rust/src/config/account.rs | 2 +- signer-service-rust/src/config/database.rs | 14 +- signer-service-rust/src/config/server.rs | 8 - signer-service-rust/src/{utils => }/helper.rs | 11 + signer-service-rust/src/infra/db.rs | 30 - signer-service-rust/src/infra/error.rs | 48 +- signer-service-rust/src/infra/mod.rs | 16 +- signer-service-rust/src/infra/models.rs | 86 + signer-service-rust/src/infra/token.rs | 12 +- signer-service-rust/src/main.rs | 12 +- signer-service-rust/src/utils/mod.rs | 3 - 25 files changed, 261 insertions(+), 4870 deletions(-) delete mode 100644 signer-service-rust/Cargo.lock create mode 100644 signer-service-rust/diesel.toml create mode 100644 signer-service-rust/migrations/00000000000000_diesel_initial_setup/down.sql create mode 100644 signer-service-rust/migrations/00000000000000_diesel_initial_setup/up.sql rename signer-service-rust/src/api/routes/{routes.rs => methods.rs} (99%) rename signer-service-rust/src/{utils => }/helper.rs (54%) delete mode 100644 signer-service-rust/src/infra/db.rs create mode 100644 signer-service-rust/src/infra/models.rs delete mode 100644 signer-service-rust/src/utils/mod.rs diff --git a/signer-service-rust/Cargo.lock b/signer-service-rust/Cargo.lock deleted file mode 100644 index 691c003d..00000000 --- a/signer-service-rust/Cargo.lock +++ /dev/null @@ -1,4763 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] - -[[package]] -name = "addr2line" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" -dependencies = [ - "gimli 0.26.2", -] - -[[package]] -name = "addr2line" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" -dependencies = [ - "gimli 0.29.0", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "ahash" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom 0.2.15", - "once_cell", - "version_check", -] - -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "getrandom 0.2.15", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "allocator-api2" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - -[[package]] -name = "anyhow" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" - -[[package]] -name = "array-bytes" -version = "4.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" - -[[package]] -name = "arrayref" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" - -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "async-trait" -version = "0.1.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "axum" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" -dependencies = [ - "async-trait", - "axum-core", - "axum-macros", - "bytes", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "http-body-util", - "hyper 1.3.1", - "hyper-util", - "itoa", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "serde_json", - "serde_path_to_error", - "serde_urlencoded", - "sync_wrapper 1.0.1", - "tokio", - "tower", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "axum-core" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "http-body-util", - "mime", - "pin-project-lite", - "rustversion", - "sync_wrapper 0.1.2", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "axum-macros" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00c055ee2d014ae5981ce1016374e8213682aa14d9bf40e48ab48b5f3ef20eaa" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "backtrace" -version = "0.3.72" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11" -dependencies = [ - "addr2line 0.22.0", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object 0.35.0", - "rustc-demangle", -] - -[[package]] -name = "base16ct" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" - -[[package]] -name = "base58" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" - -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - -[[package]] -name = "base64ct" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" - -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "blake2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" -dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "blake2b_simd" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" -dependencies = [ - "arrayref", - "arrayvec 0.7.4", - "constant_time_eq", -] - -[[package]] -name = "block-buffer" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -dependencies = [ - "block-padding", - "byte-tools", - "byteorder", - "generic-array 0.12.4", -] - -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array 0.14.7", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array 0.14.7", -] - -[[package]] -name = "block-padding" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" -dependencies = [ - "byte-tools", -] - -[[package]] -name = "bounded-collections" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca548b6163b872067dc5eb82fd130c56881435e30367d2073594a3d9744120dd" -dependencies = [ - "log", - "parity-scale-codec", - "scale-info", - "serde", -] - -[[package]] -name = "bs58" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" - -[[package]] -name = "bstringify" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd769563b4ea2953e2825c9e6b7470a5f55f67e0be00030bf3e390a2a6071f64" - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "byte-slice-cast" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" - -[[package]] -name = "byte-tools" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" - -[[package]] -name = "cached" -version = "0.47.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69b0116662497bc24e4b177c90eaf8870e39e2714c3fcfa296327a93f593fc21" -dependencies = [ - "ahash 0.8.11", - "async-trait", - "cached_proc_macro", - "cached_proc_macro_types", - "futures", - "hashbrown 0.14.5", - "instant", - "once_cell", - "thiserror", - "tokio", -] - -[[package]] -name = "cached_proc_macro" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c878c71c2821aa2058722038a59a67583a4240524687c6028571c9b395ded61f" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "cached_proc_macro_types" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade8366b8bd5ba243f0a58f036cc0ca8a2f069cff1a2351ef1cac6b083e16fc0" - -[[package]] -name = "cc" -version = "1.0.98" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" - -[[package]] -name = "cfg-expr" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aacacf4d96c24b2ad6eb8ee6df040e4f27b0d0b39a5710c30091baa830485db" -dependencies = [ - "smallvec", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "windows-targets 0.52.5", -] - -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - -[[package]] -name = "constant_time_eq" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" - -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "cpp_demangle" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "cpufeatures" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" -dependencies = [ - "libc", -] - -[[package]] -name = "cranelift-entity" -version = "0.93.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f42ea692c7b450ad18b8c9889661505d51c09ec4380cf1c2d278dbb2da22cae1" -dependencies = [ - "serde", -] - -[[package]] -name = "crc32fast" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "crypto-bigint" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" -dependencies = [ - "generic-array 0.14.7", - "rand_core 0.6.4", - "subtle", - "zeroize", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array 0.14.7", - "typenum", -] - -[[package]] -name = "crypto-mac" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" -dependencies = [ - "generic-array 0.14.7", - "subtle", -] - -[[package]] -name = "crypto-mac" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" -dependencies = [ - "generic-array 0.14.7", - "subtle", -] - -[[package]] -name = "curve25519-dalek" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9b85542f99a2dfa2a1b8e192662741c9859a846b296bef1c92ef9b58b5a216" -dependencies = [ - "byteorder", - "digest 0.8.1", - "rand_core 0.5.1", - "subtle", - "zeroize", -] - -[[package]] -name = "curve25519-dalek" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" -dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", - "subtle", - "zeroize", -] - -[[package]] -name = "curve25519-dalek" -version = "4.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" -dependencies = [ - "cfg-if", - "cpufeatures", - "curve25519-dalek-derive", - "digest 0.10.7", - "fiat-crypto", - "platforms", - "rustc_version", - "subtle", - "zeroize", -] - -[[package]] -name = "curve25519-dalek-derive" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "darling" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 1.0.109", -] - -[[package]] -name = "darling_macro" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" -dependencies = [ - "darling_core", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "deadpool" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6541a3916932fe57768d4be0b1ffb5ec7cbf74ca8c903fdfd5c0fe8aa958f0ed" -dependencies = [ - "deadpool-runtime", - "num_cpus", - "tokio", -] - -[[package]] -name = "deadpool-diesel" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "590573e9e29c5190a5ff782136f871e6e652e35d598a349888e028693601adf1" -dependencies = [ - "deadpool", - "deadpool-sync", - "diesel", -] - -[[package]] -name = "deadpool-runtime" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "092966b41edc516079bdf31ec78a2e0588d1d0c08f78b91d8307215928642b2b" -dependencies = [ - "tokio", -] - -[[package]] -name = "deadpool-sync" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc213ac28dbe3eda41e1c1e40fad9a04b3ee3bb12f18dee5930a36aca7fa0e8" -dependencies = [ - "deadpool-runtime", -] - -[[package]] -name = "der" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" -dependencies = [ - "const-oid", - "zeroize", -] - -[[package]] -name = "derive-syn-parse" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_more" -version = "0.99.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "diesel" -version = "2.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff236accb9a5069572099f0b350a92e9560e8e63a9b8d546162f4a5e03026bb2" -dependencies = [ - "bitflags 2.5.0", - "byteorder", - "diesel_derives", - "itoa", - "pq-sys", - "serde_json", - "uuid", -] - -[[package]] -name = "diesel_derives" -version = "2.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14701062d6bed917b5c7103bdffaee1e4609279e240488ad24e7bd979ca6866c" -dependencies = [ - "diesel_table_macro_syntax", - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "diesel_migrations" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6036b3f0120c5961381b570ee20a02432d7e2d27ea60de9578799cf9156914ac" -dependencies = [ - "diesel", - "migrations_internals", - "migrations_macros", -] - -[[package]] -name = "diesel_table_macro_syntax" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" -dependencies = [ - "syn 2.0.66", -] - -[[package]] -name = "digest" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" -dependencies = [ - "generic-array 0.12.4", -] - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array 0.14.7", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer 0.10.4", - "const-oid", - "crypto-common", - "subtle", -] - -[[package]] -name = "dotenv" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" - -[[package]] -name = "dotenvy" -version = "0.15.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" - -[[package]] -name = "downcast-rs" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" - -[[package]] -name = "dyn-clonable" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e9232f0e607a262ceb9bd5141a3dfb3e4db6994b31989bbfd845878cba59fd4" -dependencies = [ - "dyn-clonable-impl", - "dyn-clone", -] - -[[package]] -name = "dyn-clonable-impl" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "dyn-clone" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" - -[[package]] -name = "ecdsa" -version = "0.16.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" -dependencies = [ - "der", - "digest 0.10.7", - "elliptic-curve", - "rfc6979", - "signature 2.2.0", - "spki", -] - -[[package]] -name = "ed25519" -version = "1.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" -dependencies = [ - "signature 1.6.4", -] - -[[package]] -name = "ed25519-dalek" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" -dependencies = [ - "curve25519-dalek 3.2.0", - "ed25519", - "sha2 0.9.9", - "zeroize", -] - -[[package]] -name = "ed25519-zebra" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" -dependencies = [ - "curve25519-dalek 3.2.0", - "hashbrown 0.12.3", - "hex", - "rand_core 0.6.4", - "sha2 0.9.9", - "zeroize", -] - -[[package]] -name = "either" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" - -[[package]] -name = "elliptic-curve" -version = "0.13.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" -dependencies = [ - "base16ct", - "crypto-bigint", - "digest 0.10.7", - "ff", - "generic-array 0.14.7", - "group", - "pkcs8", - "rand_core 0.6.4", - "sec1", - "subtle", - "zeroize", -] - -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "environmental" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "expander" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f360349150728553f92e4c997a16af8915f418d3a0f21b440d34c5632f16ed84" -dependencies = [ - "blake2", - "fs-err", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "fake-simd" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" - -[[package]] -name = "fallible-iterator" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" - -[[package]] -name = "fastrand" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" - -[[package]] -name = "ff" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" -dependencies = [ - "rand_core 0.6.4", - "subtle", -] - -[[package]] -name = "fiat-crypto" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" - -[[package]] -name = "fixed-hash" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" -dependencies = [ - "byteorder", - "rand 0.8.5", - "rustc-hex", - "static_assertions", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "frame-metadata" -version = "15.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "878babb0b136e731cc77ec2fd883ff02745ff21e6fb662729953d44923df009c" -dependencies = [ - "cfg-if", - "parity-scale-codec", - "scale-info", - "serde", -] - -[[package]] -name = "frame-support" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "bitflags 1.3.2", - "environmental", - "frame-metadata", - "frame-support-procedural", - "impl-trait-for-tuples", - "k256", - "log", - "once_cell", - "parity-scale-codec", - "paste", - "scale-info", - "serde", - "smallvec", - "sp-api", - "sp-arithmetic", - "sp-core", - "sp-core-hashing-proc-macro", - "sp-inherents", - "sp-io", - "sp-runtime", - "sp-staking", - "sp-state-machine", - "sp-std", - "sp-tracing", - "sp-weights", - "tt-call", -] - -[[package]] -name = "frame-support-procedural" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "Inflector", - "cfg-expr", - "derive-syn-parse", - "frame-support-procedural-tools", - "itertools", - "proc-macro-warning", - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "frame-support-procedural-tools" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "frame-support-procedural-tools-derive", - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "frame-support-procedural-tools-derive" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "fs-err" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" -dependencies = [ - "autocfg", -] - -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - -[[package]] -name = "futures" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" - -[[package]] -name = "futures-executor" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", - "num_cpus", -] - -[[package]] -name = "futures-io" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" - -[[package]] -name = "futures-macro" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "futures-sink" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" - -[[package]] -name = "futures-task" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" - -[[package]] -name = "futures-util" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" -dependencies = [ - "typenum", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", - "zeroize", -] - -[[package]] -name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] - -[[package]] -name = "getrandom" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", -] - -[[package]] -name = "getrandom_or_panic" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" -dependencies = [ - "rand_core 0.6.4", -] - -[[package]] -name = "gimli" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" -dependencies = [ - "fallible-iterator", - "stable_deref_trait", -] - -[[package]] -name = "gimli" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" - -[[package]] -name = "group" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" -dependencies = [ - "ff", - "rand_core 0.6.4", - "subtle", -] - -[[package]] -name = "h2" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.12", - "indexmap 2.2.6", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hash-db" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e7d7786361d7425ae2fe4f9e407eb0efaa0840f5212d109cc018c40c35c6ab4" - -[[package]] -name = "hash256-std-hasher" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" -dependencies = [ - "crunchy", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.8", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash 0.8.11", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -dependencies = [ - "ahash 0.8.11", - "allocator-api2", -] - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hmac" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" -dependencies = [ - "crypto-mac 0.8.0", - "digest 0.9.0", -] - -[[package]] -name = "hmac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" -dependencies = [ - "crypto-mac 0.11.1", - "digest 0.9.0", -] - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "hmac-drbg" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" -dependencies = [ - "digest 0.9.0", - "generic-array 0.14.7", - "hmac 0.8.1", -] - -[[package]] -name = "http" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http 0.2.12", - "pin-project-lite", -] - -[[package]] -name = "http-body" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" -dependencies = [ - "bytes", - "http 1.1.0", -] - -[[package]] -name = "http-body-util" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" -dependencies = [ - "bytes", - "futures-core", - "http 1.1.0", - "http-body 1.0.0", - "pin-project-lite", -] - -[[package]] -name = "http-range-header" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08a397c49fec283e3d6211adbe480be95aae5f304cfb923e9970e08956d5168a" - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "hyper" -version = "0.14.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http 0.2.12", - "http-body 0.4.6", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", -] - -[[package]] -name = "hyper-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" -dependencies = [ - "bytes", - "hyper 0.14.28", - "native-tls", - "tokio", - "tokio-native-tls", -] - -[[package]] -name = "hyper-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" -dependencies = [ - "bytes", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "hyper 1.3.1", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "impl-codec" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" -dependencies = [ - "parity-scale-codec", -] - -[[package]] -name = "impl-serde" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" -dependencies = [ - "serde", -] - -[[package]] -name = "impl-trait-for-tuples" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "index-fixed" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161ceaf2f41b6cd3f6502f5da085d4ad4393a51e0c70ed2fce1d5698d798fae" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown 0.14.5", -] - -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "integer-sqrt" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" -dependencies = [ - "num-traits", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "ipnet" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "k256" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" -dependencies = [ - "cfg-if", - "ecdsa", - "elliptic-curve", - "once_cell", - "sha2 0.10.8", -] - -[[package]] -name = "keccak" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" -dependencies = [ - "cpufeatures", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -dependencies = [ - "spin", -] - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libm" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" - -[[package]] -name = "libsecp256k1" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" -dependencies = [ - "arrayref", - "base64 0.13.1", - "digest 0.9.0", - "hmac-drbg", - "libsecp256k1-core", - "libsecp256k1-gen-ecmult", - "libsecp256k1-gen-genmult", - "rand 0.8.5", - "serde", - "sha2 0.9.9", - "typenum", -] - -[[package]] -name = "libsecp256k1-core" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" -dependencies = [ - "crunchy", - "digest 0.9.0", - "subtle", -] - -[[package]] -name = "libsecp256k1-gen-ecmult" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" -dependencies = [ - "libsecp256k1-core", -] - -[[package]] -name = "libsecp256k1-gen-genmult" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" -dependencies = [ - "libsecp256k1-core", -] - -[[package]] -name = "linux-raw-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" - -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" - -[[package]] -name = "mach" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" -dependencies = [ - "libc", -] - -[[package]] -name = "matchers" -version = "0.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" -dependencies = [ - "regex-automata 0.1.10", -] - -[[package]] -name = "matchers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" -dependencies = [ - "regex-automata 0.1.10", -] - -[[package]] -name = "matchit" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" - -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "memfd" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" -dependencies = [ - "rustix 0.38.34", -] - -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - -[[package]] -name = "memory-db" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" -dependencies = [ - "hash-db", -] - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - -[[package]] -name = "merlin" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e261cf0f8b3c42ded9f7d2bb59dea03aa52bc8a1cbc7482f9fc3fd1229d3b42" -dependencies = [ - "byteorder", - "keccak", - "rand_core 0.5.1", - "zeroize", -] - -[[package]] -name = "merlin" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" -dependencies = [ - "byteorder", - "keccak", - "rand_core 0.6.4", - "zeroize", -] - -[[package]] -name = "migrations_internals" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f23f71580015254b020e856feac3df5878c2c7a8812297edd6c0a485ac9dada" -dependencies = [ - "serde", - "toml", -] - -[[package]] -name = "migrations_macros" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cce3325ac70e67bbab5bd837a31cae01f1a6db64e0e744a33cb03a543469ef08" -dependencies = [ - "migrations_internals", - "proc-macro2", - "quote", -] - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "mime_guess" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" -dependencies = [ - "mime", - "unicase", -] - -[[package]] -name = "miniz_oxide" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" -dependencies = [ - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.48.0", -] - -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - -[[package]] -name = "nohash-hasher" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" - -[[package]] -name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi", -] - -[[package]] -name = "num-bigint" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-format" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" -dependencies = [ - "arrayvec 0.7.4", - "itoa", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "object" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" -dependencies = [ - "crc32fast", - "hashbrown 0.12.3", - "indexmap 1.9.3", - "memchr", -] - -[[package]] -name = "object" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "opaque-debug" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" - -[[package]] -name = "opaque-debug" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" - -[[package]] -name = "openssl" -version = "0.10.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" -dependencies = [ - "bitflags 2.5.0", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.102" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - -[[package]] -name = "parity-scale-codec" -version = "3.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" -dependencies = [ - "arrayvec 0.7.4", - "bitvec", - "byte-slice-cast", - "bytes", - "impl-trait-for-tuples", - "parity-scale-codec-derive", - "serde", -] - -[[package]] -name = "parity-scale-codec-derive" -version = "3.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" -dependencies = [ - "proc-macro-crate 3.1.0", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "parity-wasm" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" - -[[package]] -name = "parking_lot" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.52.5", -] - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "pbkdf2" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" -dependencies = [ - "crypto-mac 0.11.1", -] - -[[package]] -name = "pbkdf2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" -dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkcs8" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" -dependencies = [ - "der", - "spki", -] - -[[package]] -name = "pkg-config" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" - -[[package]] -name = "platforms" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "pq-sys" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0052426df997c0cbd30789eb44ca097e3541717a7b8fa36b1c464ee7edebd" -dependencies = [ - "vcpkg", -] - -[[package]] -name = "primitive-types" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" -dependencies = [ - "fixed-hash", - "impl-codec", - "impl-serde", - "scale-info", - "uint", -] - -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit 0.19.15", -] - -[[package]] -name = "proc-macro-crate" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" -dependencies = [ - "toml_edit 0.21.1", -] - -[[package]] -name = "proc-macro-warning" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e99670bafb56b9a106419397343bdbc8b8742c3cc449fec6345f86173f47cd4" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "proc-macro2" -version = "1.0.84" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "psm" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" -dependencies = [ - "cc", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom 0.2.15", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags 2.5.0", -] - -[[package]] -name = "ref-cast" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" -dependencies = [ - "ref-cast-impl", -] - -[[package]] -name = "ref-cast-impl" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "regex" -version = "1.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.8.3", -] - -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - -[[package]] -name = "reqwest" -version = "0.11.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" -dependencies = [ - "base64 0.21.7", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.28", - "hyper-tls", - "ipnet", - "js-sys", - "log", - "mime", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls-pemfile", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper 0.1.2", - "system-configuration", - "tokio", - "tokio-native-tls", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "winreg", -] - -[[package]] -name = "rfc6979" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" -dependencies = [ - "hmac 0.12.1", - "subtle", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustc-hex" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rustix" -version = "0.36.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.45.0", -] - -[[package]] -name = "rustix" -version = "0.38.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags 2.5.0", - "errno", - "libc", - "linux-raw-sys 0.4.14", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64 0.21.7", -] - -[[package]] -name = "rustversion" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "scale-info" -version = "2.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" -dependencies = [ - "bitvec", - "cfg-if", - "derive_more", - "parity-scale-codec", - "scale-info-derive", - "serde", -] - -[[package]] -name = "scale-info-derive" -version = "2.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" -dependencies = [ - "proc-macro-crate 3.1.0", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "schannel" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "schnellru" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9a8ef13a93c54d20580de1e5c413e624e53121d42fc7e2c11d10ef7f8b02367" -dependencies = [ - "ahash 0.8.11", - "cfg-if", - "hashbrown 0.13.2", -] - -[[package]] -name = "schnorrkel" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" -dependencies = [ - "arrayref", - "arrayvec 0.5.2", - "curve25519-dalek 2.1.3", - "getrandom 0.1.16", - "merlin 2.0.1", - "rand 0.7.3", - "rand_core 0.5.1", - "sha2 0.8.2", - "subtle", - "zeroize", -] - -[[package]] -name = "schnorrkel" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de18f6d8ba0aad7045f5feae07ec29899c1112584a38509a84ad7b04451eaa0" -dependencies = [ - "arrayref", - "arrayvec 0.7.4", - "curve25519-dalek 4.1.2", - "getrandom_or_panic", - "merlin 3.0.0", - "rand_core 0.6.4", - "sha2 0.10.8", - "subtle", - "zeroize", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "sec1" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" -dependencies = [ - "base16ct", - "der", - "generic-array 0.14.7", - "pkcs8", - "subtle", - "zeroize", -] - -[[package]] -name = "secp256k1" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" -dependencies = [ - "secp256k1-sys", -] - -[[package]] -name = "secp256k1-sys" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" -dependencies = [ - "cc", -] - -[[package]] -name = "secrecy" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" -dependencies = [ - "zeroize", -] - -[[package]] -name = "security-framework" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" -dependencies = [ - "bitflags 2.5.0", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "serde_json" -version = "1.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_path_to_error" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" -dependencies = [ - "itoa", - "serde", -] - -[[package]] -name = "serde_spanned" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha2" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" -dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", -] - -[[package]] -name = "sha2" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug 0.3.1", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "sha3" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" -dependencies = [ - "digest 0.10.7", - "keccak", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "signal-hook-registry" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" -dependencies = [ - "libc", -] - -[[package]] -name = "signature" -version = "1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" - -[[package]] -name = "signature" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" -dependencies = [ - "digest 0.10.7", - "rand_core 0.6.4", -] - -[[package]] -name = "signer-service-rust" -version = "0.1.0" -dependencies = [ - "anyhow", - "axum", - "deadpool-diesel", - "diesel", - "diesel_migrations", - "dotenvy", - "hex", - "serde", - "serde_json", - "substrate-stellar-sdk", - "tokio", - "tower-http", - "tracing", - "tracing-subscriber 0.3.18", - "wallet", -] - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "socket2" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "sodalite" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41784a359d15c58bba298cccb7f30a847a1a42d0620c9bdaa0aa42fdb3c280e0" -dependencies = [ - "index-fixed", -] - -[[package]] -name = "sp-api" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "hash-db", - "log", - "parity-scale-codec", - "scale-info", - "sp-api-proc-macro", - "sp-core", - "sp-metadata-ir", - "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-trie", - "sp-version", - "thiserror", -] - -[[package]] -name = "sp-api-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "Inflector", - "blake2", - "expander", - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "sp-application-crypto" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "sp-core", - "sp-io", - "sp-std", -] - -[[package]] -name = "sp-arithmetic" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "integer-sqrt", - "num-traits", - "parity-scale-codec", - "scale-info", - "serde", - "sp-std", - "static_assertions", -] - -[[package]] -name = "sp-core" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "array-bytes", - "bitflags 1.3.2", - "blake2", - "bounded-collections", - "bs58", - "dyn-clonable", - "ed25519-zebra", - "futures", - "hash-db", - "hash256-std-hasher", - "impl-serde", - "lazy_static", - "libsecp256k1", - "log", - "merlin 2.0.1", - "parity-scale-codec", - "parking_lot", - "paste", - "primitive-types", - "rand 0.8.5", - "regex", - "scale-info", - "schnorrkel 0.9.1", - "secp256k1", - "secrecy", - "serde", - "sp-core-hashing", - "sp-debug-derive", - "sp-externalities", - "sp-runtime-interface", - "sp-std", - "sp-storage", - "ss58-registry", - "substrate-bip39", - "thiserror", - "tiny-bip39", - "zeroize", -] - -[[package]] -name = "sp-core-hashing" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "blake2b_simd", - "byteorder", - "digest 0.10.7", - "sha2 0.10.8", - "sha3", - "sp-std", - "twox-hash", -] - -[[package]] -name = "sp-core-hashing-proc-macro" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "proc-macro2", - "quote", - "sp-core-hashing", - "syn 2.0.66", -] - -[[package]] -name = "sp-debug-derive" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "sp-externalities" -version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "environmental", - "parity-scale-codec", - "sp-std", - "sp-storage", -] - -[[package]] -name = "sp-inherents" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "async-trait", - "impl-trait-for-tuples", - "parity-scale-codec", - "scale-info", - "sp-core", - "sp-runtime", - "sp-std", - "thiserror", -] - -[[package]] -name = "sp-io" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "bytes", - "ed25519", - "ed25519-dalek", - "futures", - "libsecp256k1", - "log", - "parity-scale-codec", - "rustversion", - "secp256k1", - "sp-core", - "sp-externalities", - "sp-keystore", - "sp-runtime-interface", - "sp-state-machine", - "sp-std", - "sp-tracing", - "sp-trie", - "tracing", - "tracing-core", -] - -[[package]] -name = "sp-keystore" -version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "futures", - "parity-scale-codec", - "parking_lot", - "sp-core", - "sp-externalities", - "thiserror", -] - -[[package]] -name = "sp-metadata-ir" -version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "frame-metadata", - "parity-scale-codec", - "scale-info", - "sp-std", -] - -[[package]] -name = "sp-panic-handler" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "backtrace", - "lazy_static", - "regex", -] - -[[package]] -name = "sp-runtime" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "either", - "hash256-std-hasher", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "paste", - "rand 0.8.5", - "scale-info", - "serde", - "sp-application-crypto", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-std", - "sp-weights", -] - -[[package]] -name = "sp-runtime-interface" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "bytes", - "impl-trait-for-tuples", - "parity-scale-codec", - "primitive-types", - "sp-externalities", - "sp-runtime-interface-proc-macro", - "sp-std", - "sp-storage", - "sp-tracing", - "sp-wasm-interface", - "static_assertions", -] - -[[package]] -name = "sp-runtime-interface-proc-macro" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "Inflector", - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "sp-staking" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "sp-core", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "sp-state-machine" -version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "hash-db", - "log", - "parity-scale-codec", - "parking_lot", - "rand 0.8.5", - "smallvec", - "sp-core", - "sp-externalities", - "sp-panic-handler", - "sp-std", - "sp-trie", - "thiserror", - "tracing", -] - -[[package]] -name = "sp-std" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" - -[[package]] -name = "sp-storage" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "impl-serde", - "parity-scale-codec", - "ref-cast", - "serde", - "sp-debug-derive", - "sp-std", -] - -[[package]] -name = "sp-tracing" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "parity-scale-codec", - "sp-std", - "tracing", - "tracing-core", - "tracing-subscriber 0.2.25", -] - -[[package]] -name = "sp-trie" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "ahash 0.8.11", - "hash-db", - "hashbrown 0.13.2", - "lazy_static", - "memory-db", - "nohash-hasher", - "parity-scale-codec", - "parking_lot", - "scale-info", - "schnellru", - "sp-core", - "sp-std", - "thiserror", - "tracing", - "trie-db", - "trie-root", -] - -[[package]] -name = "sp-version" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "impl-serde", - "parity-scale-codec", - "parity-wasm", - "scale-info", - "serde", - "sp-core-hashing-proc-macro", - "sp-runtime", - "sp-std", - "sp-version-proc-macro", - "thiserror", -] - -[[package]] -name = "sp-version-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "parity-scale-codec", - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "sp-wasm-interface" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "anyhow", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "sp-std", - "wasmi", - "wasmtime", -] - -[[package]] -name = "sp-weights" -version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "smallvec", - "sp-arithmetic", - "sp-core", - "sp-debug-derive", - "sp-std", -] - -[[package]] -name = "spacewalk-primitives" -version = "1.0.7" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=e7a672ba1e21c98a70df30a6ee458317951dd597#e7a672ba1e21c98a70df30a6ee458317951dd597" -dependencies = [ - "base58", - "bstringify", - "frame-support", - "hex", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core", - "sp-runtime", - "sp-std", - "substrate-stellar-sdk", -] - -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - -[[package]] -name = "spki" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" -dependencies = [ - "base64ct", - "der", -] - -[[package]] -name = "ss58-registry" -version = "1.47.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4743ce898933fbff7bbf414f497c459a782d496269644b3d650a398ae6a487ba" -dependencies = [ - "Inflector", - "num-format", - "proc-macro2", - "quote", - "serde", - "serde_json", - "unicode-xid", -] - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "substrate-bip39" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a7590dc041b9bc2825e52ce5af8416c73dbe9d0654402bfd4b4941938b94d8f" -dependencies = [ - "hmac 0.11.0", - "pbkdf2 0.8.0", - "schnorrkel 0.11.4", - "sha2 0.9.9", - "zeroize", -] - -[[package]] -name = "substrate-stellar-sdk" -version = "0.2.4" -source = "git+https://github.com/pendulum-chain/substrate-stellar-sdk?branch=polkadot-v0.9.42#752c0fa27ffd244fc26fbf2e6988eedcba2cd497" -dependencies = [ - "base64 0.13.1", - "hex", - "lazy_static", - "num-rational", - "scale-info", - "serde", - "serde_json", - "sha2 0.9.9", - "sodalite", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "subtle" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "sync_wrapper" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" - -[[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "target-lexicon" -version = "0.12.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" - -[[package]] -name = "tempfile" -version = "3.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" -dependencies = [ - "cfg-if", - "fastrand", - "rustix 0.38.34", - "windows-sys 0.52.0", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "tiny-bip39" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62cc94d358b5a1e84a5cb9109f559aa3c4d634d2b1b4de3d0fa4adc7c78e2861" -dependencies = [ - "anyhow", - "hmac 0.12.1", - "once_cell", - "pbkdf2 0.11.0", - "rand 0.8.5", - "rustc-hash", - "sha2 0.10.8", - "thiserror", - "unicode-normalization", - "wasm-bindgen", - "zeroize", -] - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tokio" -version = "1.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" -dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "num_cpus", - "parking_lot", - "pin-project-lite", - "signal-hook-registry", - "socket2", - "tokio-macros", - "windows-sys 0.48.0", -] - -[[package]] -name = "tokio-macros" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "tokio-metrics" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcb585a0069b53171684e22d5255984ec30d1c7304fd0a4a9a603ffd8c765cdd" -dependencies = [ - "futures-util", - "pin-project-lite", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - -[[package]] -name = "tokio-stream" -version = "0.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" -dependencies = [ - "futures-core", - "pin-project-lite", - "tokio", - "tokio-util", -] - -[[package]] -name = "tokio-util" -version = "0.7.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "toml" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit 0.19.15", -] - -[[package]] -name = "toml_datetime" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap 2.2.6", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - -[[package]] -name = "toml_edit" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap 2.2.6", - "toml_datetime", - "winnow", -] - -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-http" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" -dependencies = [ - "bitflags 2.5.0", - "bytes", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "http-body-util", - "http-range-header", - "httpdate", - "mime", - "mime_guess", - "percent-encoding", - "pin-project-lite", - "tokio", - "tokio-util", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-futures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" -dependencies = [ - "pin-project", - "tracing", -] - -[[package]] -name = "tracing-log" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - -[[package]] -name = "tracing-log" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - -[[package]] -name = "tracing-serde" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" -dependencies = [ - "serde", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" -dependencies = [ - "ansi_term", - "chrono", - "lazy_static", - "matchers 0.0.1", - "regex", - "serde", - "serde_json", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log 0.1.4", - "tracing-serde", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "matchers 0.1.0", - "nu-ansi-term", - "once_cell", - "regex", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log 0.2.0", -] - -[[package]] -name = "trie-db" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "767abe6ffed88a1889671a102c2861ae742726f52e0a5a425b92c9fbfa7e9c85" -dependencies = [ - "hash-db", - "hashbrown 0.13.2", - "log", - "rustc-hex", - "smallvec", -] - -[[package]] -name = "trie-root" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4ed310ef5ab98f5fa467900ed906cb9232dd5376597e00fd4cba2a449d06c0b" -dependencies = [ - "hash-db", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "tt-call" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f195fd851901624eee5a58c4bb2b4f06399148fcd0ed336e6f1cb60a9881df" - -[[package]] -name = "twox-hash" -version = "1.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" -dependencies = [ - "cfg-if", - "digest 0.10.7", - "rand 0.8.5", - "static_assertions", -] - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "uint" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] - -[[package]] -name = "unicase" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - -[[package]] -name = "url" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "uuid" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wallet" -version = "1.0.7" -source = "git+https://github.com/pendulum-chain/spacewalk?rev=e7a672ba1e21c98a70df30a6ee458317951dd597#e7a672ba1e21c98a70df30a6ee458317951dd597" -dependencies = [ - "async-trait", - "cached", - "dotenv", - "futures", - "parity-scale-codec", - "rand 0.8.5", - "reqwest", - "serde", - "serde_json", - "spacewalk-primitives", - "thiserror", - "tokio", - "tokio-metrics", - "tokio-stream", - "tracing", - "tracing-futures", - "tracing-subscriber 0.2.25", -] - -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.66", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "wasmi" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c326c93fbf86419608361a2c925a31754cf109da1b8b55737070b4d6669422" -dependencies = [ - "parity-wasm", - "wasmi-validation", - "wasmi_core", -] - -[[package]] -name = "wasmi-validation" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ff416ad1ff0c42e5a926ed5d5fab74c0f098749aa0ad8b2a34b982ce0e867b" -dependencies = [ - "parity-wasm", -] - -[[package]] -name = "wasmi_core" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d20cb3c59b788653d99541c646c561c9dd26506f25c0cebfe810659c54c6d7" -dependencies = [ - "downcast-rs", - "libm", - "memory_units", - "num-rational", - "num-traits", -] - -[[package]] -name = "wasmparser" -version = "0.100.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64b20236ab624147dfbb62cf12a19aaf66af0e41b8398838b66e997d07d269d4" -dependencies = [ - "indexmap 1.9.3", - "url", -] - -[[package]] -name = "wasmtime" -version = "6.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a222f5fa1e14b2cefc286f1b68494d7a965f4bf57ec04c59bb62673d639af6" -dependencies = [ - "anyhow", - "bincode", - "cfg-if", - "indexmap 1.9.3", - "libc", - "log", - "object 0.29.0", - "once_cell", - "paste", - "psm", - "serde", - "target-lexicon", - "wasmparser", - "wasmtime-environ", - "wasmtime-jit", - "wasmtime-runtime", - "windows-sys 0.42.0", -] - -[[package]] -name = "wasmtime-asm-macros" -version = "6.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4407a7246e7d2f3d8fb1cf0c72fda8dbafdb6dd34d555ae8bea0e5ae031089cc" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "wasmtime-environ" -version = "6.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b8b50962eae38ee319f7b24900b7cf371f03eebdc17400c1dc8575fc10c9a7" -dependencies = [ - "anyhow", - "cranelift-entity", - "gimli 0.26.2", - "indexmap 1.9.3", - "log", - "object 0.29.0", - "serde", - "target-lexicon", - "thiserror", - "wasmparser", - "wasmtime-types", -] - -[[package]] -name = "wasmtime-jit" -version = "6.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffaed4f9a234ba5225d8e64eac7b4a5d13b994aeb37353cde2cbeb3febda9eaa" -dependencies = [ - "addr2line 0.17.0", - "anyhow", - "bincode", - "cfg-if", - "cpp_demangle", - "gimli 0.26.2", - "log", - "object 0.29.0", - "rustc-demangle", - "serde", - "target-lexicon", - "wasmtime-environ", - "wasmtime-jit-icache-coherence", - "wasmtime-runtime", - "windows-sys 0.42.0", -] - -[[package]] -name = "wasmtime-jit-debug" -version = "6.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed41cbcbf74ce3ff6f1d07d1b707888166dc408d1a880f651268f4f7c9194b2" -dependencies = [ - "once_cell", -] - -[[package]] -name = "wasmtime-jit-icache-coherence" -version = "6.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a28ae1e648461bfdbb79db3efdaee1bca5b940872e4175390f465593a2e54c" -dependencies = [ - "cfg-if", - "libc", - "windows-sys 0.42.0", -] - -[[package]] -name = "wasmtime-runtime" -version = "6.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e704b126e4252788ccfc3526d4d4511d4b23c521bf123e447ac726c14545217b" -dependencies = [ - "anyhow", - "cc", - "cfg-if", - "indexmap 1.9.3", - "libc", - "log", - "mach", - "memfd", - "memoffset", - "paste", - "rand 0.8.5", - "rustix 0.36.17", - "wasmtime-asm-macros", - "wasmtime-environ", - "wasmtime-jit-debug", - "windows-sys 0.42.0", -] - -[[package]] -name = "wasmtime-types" -version = "6.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83e5572c5727c1ee7e8f28717aaa8400e4d22dcbd714ea5457d85b5005206568" -dependencies = [ - "cranelift-entity", - "serde", - "thiserror", - "wasmparser", -] - -[[package]] -name = "web-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" - -[[package]] -name = "winnow" -version = "0.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] - -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] - -[[package]] -name = "zerocopy" -version = "0.7.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "zeroize" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] diff --git a/signer-service-rust/Cargo.toml b/signer-service-rust/Cargo.toml index 2265b5d6..a63733ab 100644 --- a/signer-service-rust/Cargo.toml +++ b/signer-service-rust/Cargo.toml @@ -9,8 +9,8 @@ edition = "2021" axum = { version = "0.7.5", features = ["macros"] } deadpool-diesel = { version = "0.6.1", features = ["postgres"] } -diesel = { version = "2.1.6", features = ["postgres", "serde_json", "uuid"]} -diesel_migrations = "2.1.0" +diesel = { version = "2.2", features = ["postgres", "serde_json", "uuid"]} +diesel_migrations = "2.2.0" # well-maintained fork of dotenv dotenvy = "0.15.7" diff --git a/signer-service-rust/diesel.toml b/signer-service-rust/diesel.toml new file mode 100644 index 00000000..3e2572f8 --- /dev/null +++ b/signer-service-rust/diesel.toml @@ -0,0 +1,6 @@ +[print_schema] +file = "src/infra/schema.rs" +custom_type_derives = ["diesel::query_builder::QueryId"] + +[migrations_directory] +dir = "migrations" \ No newline at end of file diff --git a/signer-service-rust/migrations/00000000000000_diesel_initial_setup/down.sql b/signer-service-rust/migrations/00000000000000_diesel_initial_setup/down.sql new file mode 100644 index 00000000..c7bdd57b --- /dev/null +++ b/signer-service-rust/migrations/00000000000000_diesel_initial_setup/down.sql @@ -0,0 +1 @@ +DROP table tokens \ No newline at end of file diff --git a/signer-service-rust/migrations/00000000000000_diesel_initial_setup/up.sql b/signer-service-rust/migrations/00000000000000_diesel_initial_setup/up.sql new file mode 100644 index 00000000..50034582 --- /dev/null +++ b/signer-service-rust/migrations/00000000000000_diesel_initial_setup/up.sql @@ -0,0 +1,10 @@ +CREATE TABLE tokens ( + id SERIAL PRIMARY KEY, + asset_code VARCHAR(12) NOT NULL, + asset_issuer VARCHAR(60) NOT NULL, + vault_account_id VARCHAR(60) NOT NULL, + toml_url TEXT NOT NULL, + min_withdrawal_amount VARCHAR(20), + + UNIQUE(asset_code,asset_issuer) +) diff --git a/signer-service-rust/rust-toolchain.toml b/signer-service-rust/rust-toolchain.toml index f3ac570b..dff12db1 100644 --- a/signer-service-rust/rust-toolchain.toml +++ b/signer-service-rust/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.77.0" +channel = "1.78.0" components = ["rustfmt", "rls", "clippy"] diff --git a/signer-service-rust/src/api/horizon/create_account_tx.rs b/signer-service-rust/src/api/horizon/create_account_tx.rs index 58089dad..9085c63c 100644 --- a/signer-service-rust/src/api/horizon/create_account_tx.rs +++ b/signer-service-rust/src/api/horizon/create_account_tx.rs @@ -1,10 +1,10 @@ use axum::Json; use serde_json::{json, Value}; -use substrate_stellar_sdk::{Operation, PublicKey, Signer, SignerKey, StroopAmount}; -use tracing::error; +use substrate_stellar_sdk::{Operation, PublicKey, Signer, SignerKey, StroopAmount, XdrCodec}; +use tracing::{error, info}; use wallet::operations::AppendExt; use crate::api::Error; -use crate::api::horizon::helper::{change_trust_operation, create_transaction_no_operations, operation_with_custom_err}; +use crate::api::horizon::helper::{asset_to_change_trust_asset_type, create_transaction_no_operations, operation_with_custom_err}; use crate::config::AccountConfig; use crate::infra::Token; @@ -13,7 +13,7 @@ const SET_OPT_MED_THRESHOLD:u8 = 2; const SET_OPT_HIGH_THRESHOLD:u8 = 2; const SET_OPT_SIGNER_WEIGHT:u32 = 1; -const NEW_ACCOUNT_STARTING_BALANCE:StroopAmount = StroopAmount(2500000); +const NEW_ACCOUNT_STARTING_BALANCE:&'static str = "2.5"; /// Returns a [`Json`] of the `funding_account`'s signature (for signing this transaction) /// and sequence number (when submitting this transaction) @@ -33,7 +33,8 @@ pub async fn build_create_account_tx( // prepare the transaction: let mut tx = create_transaction_no_operations( funding_account.public_key(), - sequence, + // increment the sequence number + sequence + 1, max_time, None )?; @@ -51,7 +52,11 @@ pub async fn build_create_account_tx( Error::TransactionError("append multiple operations".to_string()) })?; - let tx_sig = funding_account.create_base64_signature(tx)?; + let tx_sig = funding_account.create_base64_signature(tx.clone())?; + let payment_env = tx.into_transaction_envelope().to_base64_xdr(); + let payment_env = String::from_utf8(payment_env).unwrap(); + + info!("CARLA CARLA CARLA ENV: {payment_env}"); let public_key = funding_account.public_key_as_str(); Ok(Json(json!({ @@ -66,16 +71,17 @@ fn prepare_all_operations( ephemeral_account_id: PublicKey, asset_code:&str ) -> Result,Error> { + // create account op let create_op = operation_with_custom_err!( Operation::new_create_account( - ephemeral_account_id, + ephemeral_account_id.clone(), NEW_ACCOUNT_STARTING_BALANCE ), "create account" )?; // add threshold to the new account - let set_opt_op = operation_with_custom_err!(Operation::new_set_options::( + let mut set_opt_op = operation_with_custom_err!(Operation::new_set_options::( None, None, None, @@ -90,10 +96,16 @@ fn prepare_all_operations( })), "set options" )?; + set_opt_op.source_account = Some(ephemeral_account_id.clone().into()); // create a trust line let token = Token::try_by_asset_code(asset_code)?; - let change_trust_op = change_trust_operation(&token)?; + let tk_asset = asset_to_change_trust_asset_type(&token)?; + let mut change_trust_op = operation_with_custom_err!( + Operation::new_change_trust(tk_asset), + "change trust" + )?; + change_trust_op.source_account = Some(ephemeral_account_id.into()); Ok(vec![create_op,set_opt_op, change_trust_op]) } \ No newline at end of file diff --git a/signer-service-rust/src/api/horizon/helper.rs b/signer-service-rust/src/api/horizon/helper.rs index 9ff87eb6..105cf91a 100644 --- a/signer-service-rust/src/api/horizon/helper.rs +++ b/signer-service-rust/src/api/horizon/helper.rs @@ -41,13 +41,6 @@ pub(super) fn create_transaction_no_operations( }) } -pub(super) fn change_trust_operation(token:&Token) -> Result { - let tk_asset = asset_to_change_trust_asset_type(token)?; - operation_with_custom_err!(Operation::new_change_trust( - tk_asset), - "change trust" - ) -} pub(super) fn asset_to_change_trust_asset_type(token:&Token) -> Result { token.asset_type().map(|asset| match asset { Asset::AssetTypeCreditAlphanum4(res) => diff --git a/signer-service-rust/src/api/horizon/payment_and_merge_tx.rs b/signer-service-rust/src/api/horizon/payment_and_merge_tx.rs index 574d42cc..de0ec254 100644 --- a/signer-service-rust/src/api/horizon/payment_and_merge_tx.rs +++ b/signer-service-rust/src/api/horizon/payment_and_merge_tx.rs @@ -1,13 +1,14 @@ use axum::Json; use serde_json::{json, Value}; -use substrate_stellar_sdk::{Operation, PublicKey, Transaction}; -use tracing::error; +use substrate_stellar_sdk::{Operation, PublicKey, Transaction, XdrCodec}; +use tracing::{error, info}; use wallet::operations::AppendExt; use crate::api::{Error, Sep24Result}; -use crate::api::horizon::helper::{change_trust_operation, create_transaction_no_operations}; +use crate::api::horizon::helper::{asset_to_change_trust_asset_type, create_transaction_no_operations, operation_with_custom_err}; use crate::config::AccountConfig; use crate::infra::Token; +const CHANGE_TRUST_LIMIT:&'static str = "0"; /// Returns a [`Json`] of the `funding_account`'s signatures for signing 2 transactions: /// * payment transaction @@ -25,7 +26,8 @@ pub fn build_payment_and_merge_tx( let payment_tx = payment_transaction( ephemeral_account_id.clone(), - ephemeral_sequence, + // increment the sequence + ephemeral_sequence + 1, &token, max_time, payment_data @@ -33,15 +35,18 @@ pub fn build_payment_and_merge_tx( let merge_tx = merge_transaction( ephemeral_account_id, - ephemeral_sequence, + // increment the sequence again + ephemeral_sequence + 2, &token, max_time, funding_account.public_key() )?; let payment_tx_sig = funding_account.create_base64_signature(payment_tx)?; + let merge_tx_sig = funding_account.create_base64_signature(merge_tx)?; + let public_key = funding_account.public_key_as_str(); Ok(Json(json!({ "signature": [ @@ -65,16 +70,16 @@ fn payment_transaction( Some(payment_data.memo()?) )?; - payment_tx.append_operation( + let payment_op = operation_with_custom_err!( Operation::new_payment( payment_data.offramping_account_id()?, token.asset_type()?, - payment_data.amount() - ).map_err(|e| { - error!("‼️{:<3} - payment operation: {e:?}", "FAILED"); - Error::OperationError("payment operation".to_string()) - })? - ).map_err(|e| { + payment_data.amount + ), + "payment" + )?; + + payment_tx.append_operation(payment_op).map_err(|e| { error!("‼️{:<3} - appending operation to transaction: {e:?}", "FAILED"); Error::TransactionError("append operation".to_string()) })?; @@ -90,15 +95,17 @@ fn merge_transaction( destination_account_id: PublicKey, ) -> Result { // create a trust line - let change_trust_op = change_trust_operation(&token)?; + let tk_asset = asset_to_change_trust_asset_type(token)?; + let change_trust_op = operation_with_custom_err!( + Operation::new_change_trust_with_limit(tk_asset,CHANGE_TRUST_LIMIT), + "change trust" + )?; // account merge op - let merge_op = Operation::new_account_merge( - destination_account_id - ).map_err(|e| { - error!("‼️{:<3} - account merge operation: {e:?}", "FAILED"); - Error::OperationError("account merge operation".to_string()) - })?; + let merge_op = operation_with_custom_err!( + Operation::new_account_merge(destination_account_id), + "account merge" + )?; let mut merge_tx = create_transaction_no_operations( source_account_id, diff --git a/signer-service-rust/src/api/mod.rs b/signer-service-rust/src/api/mod.rs index 8ce040e2..935381e5 100644 --- a/signer-service-rust/src/api/mod.rs +++ b/signer-service-rust/src/api/mod.rs @@ -6,7 +6,7 @@ pub mod requests; pub use sep24Result::Sep24Result; -use serde::{Deserialize, Serialize}; +use serde::{Deserialize, Deserializer, Serialize}; use crate::config::Error as ConfigError; use crate::infra::Error as InfraError; @@ -32,4 +32,4 @@ impl From for Error { fn from(value: InfraError) -> Self { Self::InfraError(value) } -} +} \ No newline at end of file diff --git a/signer-service-rust/src/api/requests.rs b/signer-service-rust/src/api/requests.rs index ff5eb602..4be40028 100644 --- a/signer-service-rust/src/api/requests.rs +++ b/signer-service-rust/src/api/requests.rs @@ -4,6 +4,7 @@ use serde_json::{json, Value}; use substrate_stellar_sdk::PublicKey; use tracing::error; use crate::api::Sep24Result; +use crate::helper::de_str_to_i64; /// Request Body of [crate::api::routes::create_account()] /// with api: POST /v1/stellar/create @@ -28,6 +29,7 @@ impl StellarCreateRequestBody { #[serde(rename_all = "camelCase")] pub struct StellarPaymentRequestBody { pub account_id: String, + #[serde(deserialize_with = "de_str_to_i64")] pub sequence: i64, pub payment_data: Sep24Result, pub max_time: u64, diff --git a/signer-service-rust/src/api/routes/routes.rs b/signer-service-rust/src/api/routes/methods.rs similarity index 99% rename from signer-service-rust/src/api/routes/routes.rs rename to signer-service-rust/src/api/routes/methods.rs index 2de3ae3e..a15f76db 100644 --- a/signer-service-rust/src/api/routes/routes.rs +++ b/signer-service-rust/src/api/routes/methods.rs @@ -55,6 +55,7 @@ pub(super) async fn payment( Err(result) => return result }; + let res = build_payment_and_merge_tx( &funding_account, ephemeral_account_id, diff --git a/signer-service-rust/src/api/routes/mod.rs b/signer-service-rust/src/api/routes/mod.rs index 3ac72db1..83bb3a4c 100644 --- a/signer-service-rust/src/api/routes/mod.rs +++ b/signer-service-rust/src/api/routes/mod.rs @@ -1,8 +1,8 @@ -mod routes; +mod methods; use axum::Router; use axum::routing::{get, post}; -use crate::api::routes::routes::{create_account, payment, status}; +use crate::api::routes::methods::{create_account, payment, status}; use crate::config::AccountConfig; /// Returns /v1/... routes diff --git a/signer-service-rust/src/api/sep24Result.rs b/signer-service-rust/src/api/sep24Result.rs index 21288f0b..d12e96ab 100644 --- a/signer-service-rust/src/api/sep24Result.rs +++ b/signer-service-rust/src/api/sep24Result.rs @@ -1,23 +1,21 @@ use std::fmt::Debug; -use serde::{Deserialize, Serialize}; +use serde::{Deserialize, Deserializer, Serialize}; use substrate_stellar_sdk::{Memo, PublicKey, StroopAmount}; use substrate_stellar_sdk::compound_types::LimitedString; use tracing::error; use crate::api::Error; +use crate::helper::de_str_to_i64; #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct Sep24Result { - pub amount: i64, + pub amount: String, pub memo: String, pub memo_type: String, pub offramping_account: String, } impl Sep24Result { - pub fn amount(&self) -> StroopAmount { - StroopAmount(self.amount) - } /// returns a [`Memo`] from the fields [`self.memo`] and [`self.memo_type`]. /// [`self.memo_type`] can be a numeric String value @@ -71,4 +69,4 @@ impl Sep24Result { offramping_account } } -} +} \ No newline at end of file diff --git a/signer-service-rust/src/config/account.rs b/signer-service-rust/src/config/account.rs index 93ce477c..7b1dde68 100644 --- a/signer-service-rust/src/config/account.rs +++ b/signer-service-rust/src/config/account.rs @@ -5,7 +5,7 @@ use substrate_stellar_sdk::network::{Network, PUBLIC_NETWORK, TEST_NETWORK}; use tracing::error; use wallet::{HorizonBalance, StellarWallet}; use crate::config::Error; -use crate::utils::public_key_as_string; +use crate::helper::public_key_as_string; const STELLAR_SECRET_KEY:&str = "STELLAR_SECRET_KEY"; const STELLAR_PUBLIC_NETWORK:&str = "STELLAR_PUBLIC_NETWORK"; diff --git a/signer-service-rust/src/config/database.rs b/signer-service-rust/src/config/database.rs index d0600e4b..b7d92d4e 100644 --- a/signer-service-rust/src/config/database.rs +++ b/signer-service-rust/src/config/database.rs @@ -1,6 +1,7 @@ use std::env; use std::fmt::{Debug, Formatter}; use deadpool_diesel::Manager; +use deadpool_diesel::postgres::Pool; use crate::config::{Error, try_get_port_from_env}; const DATABASE_HOST:&str = "DATABASE_HOST"; @@ -40,11 +41,14 @@ impl DatabaseConfig { } /// Create a connection pool to the PostgreSQL database - pub fn create_connection_pool(&self) -> Manager { - Manager::new( + pub fn create_pool(&self) -> Pool { + let url = self.url(); + println!("The db url: {url}"); + let manager = Manager::new( self.url(), deadpool_diesel::Runtime::Tokio1 - ) + ); + Pool::builder(manager).build().unwrap() } // set to private, so as not to accidentally print the username and password somewhere else @@ -56,4 +60,8 @@ impl DatabaseConfig { self.port ) } + + + + } \ No newline at end of file diff --git a/signer-service-rust/src/config/server.rs b/signer-service-rust/src/config/server.rs index 7cacdb96..ebfc49f6 100644 --- a/signer-service-rust/src/config/server.rs +++ b/signer-service-rust/src/config/server.rs @@ -34,14 +34,6 @@ impl ServerConfig { }) } - pub fn host(&self) -> &str { - &self.host - } - - pub fn port(&self) -> u16 { - self.port - } - pub fn socket_address(&self) -> Result { let address = format!("{}:{}", self.host, self.port); // Parse the socket address diff --git a/signer-service-rust/src/utils/helper.rs b/signer-service-rust/src/helper.rs similarity index 54% rename from signer-service-rust/src/utils/helper.rs rename to signer-service-rust/src/helper.rs index f3b7b253..1b792b1d 100644 --- a/signer-service-rust/src/utils/helper.rs +++ b/signer-service-rust/src/helper.rs @@ -1,3 +1,5 @@ +use std::str::FromStr; +use serde::{Deserialize, Deserializer}; use substrate_stellar_sdk::PublicKey; pub fn public_key_as_string(public_key:&PublicKey) -> String { @@ -6,4 +8,13 @@ pub fn public_key_as_string(public_key:&PublicKey) -> String { tracing::warn!("⚠️{:<3} - Stellar Public Key conversion:{e:?}\n", "WARNING"); "undefined".to_string() }) +} + +pub fn de_str_to_i64<'de, D>(de: D) -> Result + where + D: Deserializer<'de>, +{ + let s: &str = Deserialize::deserialize(de)?; + + i64::from_str(s).map_err(serde::de::Error::custom) } \ No newline at end of file diff --git a/signer-service-rust/src/infra/db.rs b/signer-service-rust/src/infra/db.rs deleted file mode 100644 index d1fde0ee..00000000 --- a/signer-service-rust/src/infra/db.rs +++ /dev/null @@ -1,30 +0,0 @@ -use deadpool_diesel::postgres::Pool; -use diesel_migrations::{embed_migrations, EmbeddedMigrations, MigrationHarness}; -use crate::config::DatabaseConfig; -use crate::infra::Error; - -// pub const MIGRATIONS: EmbeddedMigrations = embed_migrations!("migrations/"); - -// pub async fn init_db(cfg: DatabaseConfig) { -// // Create a connection pool to the PostgreSQL database -// let manager = cfg.create_connection_pool(); -// -// let pool = Pool::builder(manager).build() -// .map_err(|e| { -// tracing::error!("Failed to create connection pool: {e:?}"); -// Error::InternalServerError -// })?; -// -// } -// -// async fn run_migrations(pool: &Pool) -> Result<(),Error> { -// let conn = pool.get().await -// .map_err(|e| { -// tracing::error!("Failed to retrieve object from connection pool: {e:?}"); -// Error::PoolError -// })?; -// -// // conn.interact(|conn| conn.run_pending_migrations()) -// -// Ok(()) -// } \ No newline at end of file diff --git a/signer-service-rust/src/infra/error.rs b/signer-service-rust/src/infra/error.rs index 3d3d3f5e..d04486ff 100644 --- a/signer-service-rust/src/infra/error.rs +++ b/signer-service-rust/src/infra/error.rs @@ -1,13 +1,53 @@ +use std::fmt; + +use deadpool_diesel::InteractError; use serde::{Deserialize, Serialize}; -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Deserialize, Serialize)] pub enum Error { InternalServerError, NotFound, - PoolError, - TokenDoesNotExist, DoesNotExist(String), - EncodingFailed(String), SerdeError(String), + EncodingFailed(String) +} + +pub fn adapt_infra_error(error: T) -> Error { + error.as_infra_error() +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self { + Error::NotFound => write!(f, "Not found"), + Error::InternalServerError => write!(f, "Internal server error"), + other => write!(f, "{:?}", other) + } + } +} + +pub trait ErrorExt { + fn as_infra_error(&self) -> Error; +} + +impl ErrorExt for diesel::result::Error { + fn as_infra_error(&self) -> Error { + match self { + diesel::result::Error::NotFound => Error::NotFound, + _ => Error::InternalServerError, + } + } +} + +impl ErrorExt for deadpool_diesel::PoolError { + fn as_infra_error(&self) -> Error { + Error::InternalServerError + } +} + +impl ErrorExt for InteractError { + fn as_infra_error(&self) -> Error { + Error::InternalServerError + } } \ No newline at end of file diff --git a/signer-service-rust/src/infra/mod.rs b/signer-service-rust/src/infra/mod.rs index 4070772a..960b779d 100644 --- a/signer-service-rust/src/infra/mod.rs +++ b/signer-service-rust/src/infra/mod.rs @@ -1,7 +1,21 @@ -mod db; + mod error; mod token; +mod schema; +mod models; +use deadpool_diesel::postgres::Pool; +use diesel_migrations::{embed_migrations, EmbeddedMigrations, MigrationHarness}; pub use error::Error; pub use token::Token; + +pub const MIGRATIONS: EmbeddedMigrations = embed_migrations!("migrations/"); + +pub async fn run_migrations(pool:&Pool) { + let conn = pool.get().await.unwrap(); + conn.interact(|conn| conn.run_pending_migrations(MIGRATIONS).map(|_| ())) + .await + .unwrap(); + +} \ No newline at end of file diff --git a/signer-service-rust/src/infra/models.rs b/signer-service-rust/src/infra/models.rs new file mode 100644 index 00000000..ef4325ab --- /dev/null +++ b/signer-service-rust/src/infra/models.rs @@ -0,0 +1,86 @@ +use deadpool_diesel::postgres::Pool; +use diesel::{ + ExpressionMethods, Identifiable, PgTextExpressionMethods, QueryDsl, Queryable, RunQueryDsl, + Selectable, SelectableHelper, +}; +use crate::infra::error::adapt_infra_error; +use crate::infra::{Error, Token}; +use crate::infra::schema::tokens; + +#[derive(Identifiable, Queryable, Selectable)] +#[diesel(table_name = crate::infra::schema::tokens)] +#[diesel(check_for_backend(diesel::pg::Pg))] +pub(super) struct TokensDb { + pub id: i32, + pub asset_code: String, + pub asset_issuer: String, + pub vault_account_id: String, + pub toml_url: String, + pub min_withdrawal_amount: Option +} + +pub struct TokensFilter { + pub asset_code: Option, + pub asset_issuer: Option, + pub vault_account_id: Option, +} +impl TokensDb { + pub fn into_token(self) -> Token { + Token { + asset_code: self.asset_code, + asset_issuer: self.asset_issuer, + vault_account_id: self.vault_account_id, + toml_url: self.toml_url, + min_withdrawal_amount: self.min_withdrawal_amount, + } + } +} + +pub async fn insert(pool: &Pool, token:Token) -> Result { + let conn = pool.get().await + .map_err(adapt_infra_error)?; + + let res = conn.interact(|conn| { + diesel::insert_into(tokens::table) + .values(token) + .returning(TokensDb::as_returning()) + .get_result(conn) + }) + .await + .map_err(adapt_infra_error)? + .map_err(adapt_infra_error)?; + + Ok(res.id) +} + +pub async fn get_all(pool: &Pool, filter:TokensFilter) -> Result,Error> { + let conn = pool.get().await.map_err(adapt_infra_error)?; + let res = conn + .interact(move |conn| { + let mut query = tokens::table.into_boxed::(); + + if let Some(asset_code) = filter.asset_code { + let asset_code = asset_code.to_uppercase(); + query = query.filter(tokens::asset_code.ilike(format!("{}%", asset_code))); + } + + if let Some(asset_issuer) = filter.asset_issuer { + query = query.filter(tokens::asset_issuer.eq(asset_issuer)); + } + + if let Some(vault_account_id) = filter.vault_account_id { + query = query.filter(tokens::vault_account_id.eq(vault_account_id)); + } + + query.select(TokensDb::as_select()).load::(conn) + }) + .await + .map_err(adapt_infra_error)? + .map_err(adapt_infra_error)?; + + Ok(res + .into_iter() + .map(|tokens_db| tokens_db.into_token()) + .collect() + ) +} diff --git a/signer-service-rust/src/infra/token.rs b/signer-service-rust/src/infra/token.rs index 0811c189..88b019e6 100644 --- a/signer-service-rust/src/infra/token.rs +++ b/signer-service-rust/src/infra/token.rs @@ -1,3 +1,5 @@ + +use diesel::prelude::Insertable; use serde::{Deserialize, Serialize}; use substrate_stellar_sdk::{Asset, PublicKey}; use substrate_stellar_sdk::types::{AlphaNum12, AlphaNum4}; @@ -5,18 +7,18 @@ use substrate_stellar_sdk::types::{AlphaNum12, AlphaNum4}; use tracing::error; use crate::infra::Error; -#[derive(Debug, Serialize,Deserialize)] +#[derive(Insertable, PartialEq, Debug, Serialize,Deserialize)] +#[diesel(table_name = crate::infra::schema::tokens)] pub struct Token { - pub toml_url: String, pub asset_code: String, pub asset_issuer: String, pub vault_account_id: String, - pub min_withdrawal_amount: String, + pub toml_url: String, + pub min_withdrawal_amount: Option, } impl Token { /// Returns a Token by reading from a json file - /// todo: read from db next time pub fn try_from_path(path: &str) -> Result { let read_file = std::fs::read_to_string(path) .map_err(|_| { @@ -40,7 +42,7 @@ impl Token { Self::try_from_path(&path).map_err(|e| { match e { Error::DoesNotExist(_) => { - Error::TokenDoesNotExist + Error::NotFound } _ => e } diff --git a/signer-service-rust/src/main.rs b/signer-service-rust/src/main.rs index 62c7ecb5..1b01f3b2 100644 --- a/signer-service-rust/src/main.rs +++ b/signer-service-rust/src/main.rs @@ -1,7 +1,7 @@ mod config; pub mod infra; mod api; -pub mod utils; +pub mod helper; use tracing::info; use tracing_subscriber::{ @@ -11,6 +11,7 @@ use tracing_subscriber::{ util::SubscriberInitExt }; use crate::api::routes::{v1_routes}; +use crate::infra::run_migrations; pub struct State; #[tokio::main] @@ -18,13 +19,16 @@ async fn main() { init_tracing(); let config = config::Config::try_from_env_file(".env").unwrap(); - let server_addr = config.server_config().socket_address().unwrap(); - let account_cfg = config.account_config(); + let db_cfg = config.database_config(); + let pool = db_cfg.create_pool(); + run_migrations(&pool).await; + let server_addr = config.server_config().socket_address().unwrap(); let listener = tokio::net::TcpListener::bind(server_addr).await.unwrap(); info!("🚀{:<3} - {:?}\n", "LISTENING", listener.local_addr()); + let account_cfg = config.account_config(); axum::serve(listener,v1_routes(account_cfg)).await.unwrap(); } @@ -37,4 +41,4 @@ fn init_tracing() { .init(); -} \ No newline at end of file +} diff --git a/signer-service-rust/src/utils/mod.rs b/signer-service-rust/src/utils/mod.rs deleted file mode 100644 index dde93414..00000000 --- a/signer-service-rust/src/utils/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod helper; - -pub use helper::*; \ No newline at end of file From 153ed3e061d582a5720fe8de6dfb537b7748b57d Mon Sep 17 00:00:00 2001 From: b-yap <2826165+b-yap@users.noreply.github.com> Date: Fri, 7 Jun 2024 22:22:20 +0800 Subject: [PATCH 08/15] cleanup db; access tokens through db already --- .../src/api/horizon/create_account_tx.rs | 65 ++++--- signer-service-rust/src/api/horizon/helper.rs | 51 ++++- .../src/api/horizon/payment_and_merge_tx.rs | 38 ++-- signer-service-rust/src/api/mod.rs | 3 +- signer-service-rust/src/api/requests.rs | 9 +- .../src/api/routes/{methods.rs => impls.rs} | 52 ++--- signer-service-rust/src/api/routes/mod.rs | 22 ++- signer-service-rust/src/api/sep24Result.rs | 31 +-- signer-service-rust/src/config/account.rs | 25 ++- signer-service-rust/src/config/database.rs | 26 ++- signer-service-rust/src/config/error.rs | 4 +- signer-service-rust/src/config/mod.rs | 4 +- signer-service-rust/src/config/server.rs | 9 +- signer-service-rust/src/helper.rs | 3 +- signer-service-rust/src/infra/error.rs | 11 +- signer-service-rust/src/infra/impls.rs | 109 +++++++++++ signer-service-rust/src/infra/mod.rs | 50 ++++- signer-service-rust/src/infra/models.rs | 184 +++++++++++++----- signer-service-rust/src/infra/schema.rs | 16 ++ signer-service-rust/src/infra/token.rs | 95 --------- signer-service-rust/src/main.rs | 33 +++- 21 files changed, 541 insertions(+), 299 deletions(-) rename signer-service-rust/src/api/routes/{methods.rs => impls.rs} (65%) create mode 100644 signer-service-rust/src/infra/impls.rs create mode 100644 signer-service-rust/src/infra/schema.rs delete mode 100644 signer-service-rust/src/infra/token.rs diff --git a/signer-service-rust/src/api/horizon/create_account_tx.rs b/signer-service-rust/src/api/horizon/create_account_tx.rs index 9085c63c..4f71950d 100644 --- a/signer-service-rust/src/api/horizon/create_account_tx.rs +++ b/signer-service-rust/src/api/horizon/create_account_tx.rs @@ -1,12 +1,12 @@ use axum::Json; +use deadpool_diesel::postgres::Pool; use serde_json::{json, Value}; -use substrate_stellar_sdk::{Operation, PublicKey, Signer, SignerKey, StroopAmount, XdrCodec}; -use tracing::{error, info}; +use substrate_stellar_sdk::{Operation, PublicKey, Signer, SignerKey}; +use tracing::error; use wallet::operations::AppendExt; use crate::api::Error; -use crate::api::horizon::helper::{asset_to_change_trust_asset_type, create_transaction_no_operations, operation_with_custom_err}; +use crate::api::horizon::helper::{asset_to_change_trust_asset_type, create_transaction_no_operations, get_single_token, operation_with_custom_err}; use crate::config::AccountConfig; -use crate::infra::Token; const SET_OPT_LOW_THRESHOLD:u8 = 2; const SET_OPT_MED_THRESHOLD:u8 = 2; @@ -15,18 +15,22 @@ const SET_OPT_SIGNER_WEIGHT:u32 = 1; const NEW_ACCOUNT_STARTING_BALANCE:&'static str = "2.5"; -/// Returns a [`Json`] of the `funding_account`'s signature (for signing this transaction) -/// and sequence number (when submitting this transaction) +/// Returns a [`Json`] of: +/// * the `funding_account`'s signature (for signing this transaction) +/// * the sequence number (when submitting this transaction) in [`String`] format +/// * the `funding_account`'s [`PublicKey`] in [`String`] format /// -/// This transaction will perform 3 operations: -/// * Create an account, for `ephemeral_account_id` -/// * Add threshold to that account -/// * Add a trust line wth the given `asset_code` +/// The transaction created will perform 3 operations: +/// * [Create an account](Operation::new_create_account) for `ephemeral_account_id` in Stellar +/// * [Add threshold](Operation::new_set_options) to that new account +/// * [Add a trust line](Operation::new_change_trust) from the given `asset_code`. If the asset code does not exist in the db, +/// it will return [`NotFound`](crate::infra::Error::NotFound) pub async fn build_create_account_tx( + pool: &Pool, funding_account: &AccountConfig, ephemeral_account_id: &PublicKey, asset_code:&str, - max_time: u64, + max_time: u64 ) -> Result,Error> { let sequence = funding_account.get_sequence().await?; @@ -42,21 +46,18 @@ pub async fn build_create_account_tx( let operations = prepare_all_operations( funding_account, ephemeral_account_id.clone(), - asset_code - )?; + asset_code, + pool + ).await?; // insert all 3 operations tx.append_multiple(operations) .map_err(|e| { - error!("‼️{:<3} - appending operations to transaction: {e:?}", "FAILED"); + error!("‼️{:<6} - appending operations to transaction: {e:?}", "FAILED"); Error::TransactionError("append multiple operations".to_string()) })?; let tx_sig = funding_account.create_base64_signature(tx.clone())?; - let payment_env = tx.into_transaction_envelope().to_base64_xdr(); - let payment_env = String::from_utf8(payment_env).unwrap(); - - info!("CARLA CARLA CARLA ENV: {payment_env}"); let public_key = funding_account.public_key_as_str(); Ok(Json(json!({ @@ -66,10 +67,13 @@ pub async fn build_create_account_tx( }))) } -fn prepare_all_operations( +#[doc(hidden)] +/// Returns relevant operations for creating an account in Stellar +async fn prepare_all_operations( funding_account: &AccountConfig, ephemeral_account_id: PublicKey, - asset_code:&str + asset_code:&str, + pool: &Pool ) -> Result,Error> { // create account op let create_op = operation_with_custom_err!( @@ -98,14 +102,21 @@ fn prepare_all_operations( )?; set_opt_op.source_account = Some(ephemeral_account_id.clone().into()); - // create a trust line - let token = Token::try_by_asset_code(asset_code)?; + // add trust line + let mut change_trust_op = change_trust_op(pool,asset_code).await?; + change_trust_op.source_account = Some(ephemeral_account_id.into()); + + Ok(vec![create_op,set_opt_op, change_trust_op]) +} + +#[doc(hidden)] +async fn change_trust_op(pool:&Pool, asset_code:&str) -> Result { + let token = get_single_token(pool,asset_code).await?; let tk_asset = asset_to_change_trust_asset_type(&token)?; - let mut change_trust_op = operation_with_custom_err!( + + operation_with_custom_err!( Operation::new_change_trust(tk_asset), "change trust" - )?; - change_trust_op.source_account = Some(ephemeral_account_id.into()); + ) +} - Ok(vec![create_op,set_opt_op, change_trust_op]) -} \ No newline at end of file diff --git a/signer-service-rust/src/api/horizon/helper.rs b/signer-service-rust/src/api/horizon/helper.rs index 105cf91a..943dc189 100644 --- a/signer-service-rust/src/api/horizon/helper.rs +++ b/signer-service-rust/src/api/horizon/helper.rs @@ -1,24 +1,37 @@ -use substrate_stellar_sdk::{Asset, Memo, Operation, PublicKey, TimeBounds, Transaction}; +use deadpool_diesel::postgres::Pool; +use substrate_stellar_sdk::{Asset, Memo, PublicKey, TimeBounds, Transaction}; use substrate_stellar_sdk::types::{ChangeTrustAsset, Preconditions}; use tracing::error; use crate::api::Error; const BASE_FEE:u32 = 1000000; + #[doc(hidden)] /// A helper macro to convert [`substrate_stellar_sdk::StellarSdkError`] to [`Error::OperationError`] macro_rules! operation_with_custom_err { ($op:expr, $op_str:expr) => { $op.map_err(|e| { let op_str = stringify!($op_str); - error!("‼️{:<3} - {op_str} operation: {e:?}", "FAILED"); + error!("‼️{:<6} - {op_str} operation: {e:?}", "FAILED"); Error::OperationError(op_str.to_string()) }) }; } pub(super) use operation_with_custom_err; -use crate::infra::Token; +use crate::infra::{get_all_tokens, Token, TokensFilter}; + +pub(super) async fn get_single_token(pool:&Pool, asset_code: &str) -> Result { + let mut tokens = get_all_tokens(pool,TokensFilter{ + asset_code: Some(asset_code.to_string()), + asset_issuer: None, + vault_account_id: None, + }).await?; + + tokens.pop().ok_or(Error::InfraError(crate::infra::Error::DoesNotExist(asset_code.to_string()))) +} + /// Returns a basic [`Transaction`] WITHOUT any operations yet pub(super) fn create_transaction_no_operations( @@ -27,7 +40,6 @@ pub(super) fn create_transaction_no_operations( max_time: u64, memo: Option ) -> Result { - // prepare the transaction Transaction::new( source_account, @@ -36,11 +48,12 @@ pub(super) fn create_transaction_no_operations( Preconditions::PrecondTime(TimeBounds{ min_time: 0, max_time }), memo ).map_err(|e| { - error!("‼️{:<3} - creating transaction: {e:?}", "FAILED"); + error!("‼️{:<6} - creating transaction: {e:?}", "FAILED"); Error::TransactionError("new".to_string()) }) } +#[doc(hidden)] pub(super) fn asset_to_change_trust_asset_type(token:&Token) -> Result { token.asset_type().map(|asset| match asset { Asset::AssetTypeCreditAlphanum4(res) => @@ -50,4 +63,32 @@ pub(super) fn asset_to_change_trust_asset_type(token:&Token) -> Result ChangeTrustAsset::AssetTypeNative }).map_err(|e| e.into()) +} + + +#[cfg(test)] +mod test { + use substrate_stellar_sdk::Asset; + use crate::api::horizon::helper::asset_to_change_trust_asset_type; + use crate::infra::Token; + + // #[test] + // fn test_asset_to_change_trust_asset_type() { + // let token = Token { + // asset_code: "XXXXXX".to_string(), + // asset_issuer: "GAENCD6BPYV46VEXWI7KH6D6DW342DB3HIVDM4ES2EDJGLX5MPFB74TG".to_string(), + // vault_account_id: "6g7fKQQZ9VfbBTQSaKBcATV4psApFra5EDwKLARFZCCVnSWS".to_string(), + // toml_url: "sample toml".to_string(), + // min_withdrawal_amount: None, + // }; + // + // assert_eq!( + // asset_to_change_trust_asset_type(&token), + // Ok(Asset::AssetTypeCreditAlphanum12(token.as)) + // + // ) + // + // asset_to_change_trust_asset_type(&token) + // } + } \ No newline at end of file diff --git a/signer-service-rust/src/api/horizon/payment_and_merge_tx.rs b/signer-service-rust/src/api/horizon/payment_and_merge_tx.rs index de0ec254..52034a27 100644 --- a/signer-service-rust/src/api/horizon/payment_and_merge_tx.rs +++ b/signer-service-rust/src/api/horizon/payment_and_merge_tx.rs @@ -1,28 +1,37 @@ use axum::Json; +use deadpool_diesel::postgres::Pool; use serde_json::{json, Value}; -use substrate_stellar_sdk::{Operation, PublicKey, Transaction, XdrCodec}; -use tracing::{error, info}; +use substrate_stellar_sdk::{Operation, PublicKey, Transaction}; +use tracing::error; use wallet::operations::AppendExt; use crate::api::{Error, Sep24Result}; -use crate::api::horizon::helper::{asset_to_change_trust_asset_type, create_transaction_no_operations, operation_with_custom_err}; +use crate::api::horizon::helper::{asset_to_change_trust_asset_type, create_transaction_no_operations, get_single_token, operation_with_custom_err}; use crate::config::AccountConfig; use crate::infra::Token; const CHANGE_TRUST_LIMIT:&'static str = "0"; -/// Returns a [`Json`] of the `funding_account`'s signatures for signing 2 transactions: -/// * payment transaction -/// * account merge transaction -/// * merging the `ephemeral_account_id` to the `funding_account` -pub fn build_payment_and_merge_tx( +/// Returns a [`Json`] of: +/// * the `funding_account`'s signatures (for signing this transaction) +/// * the `funding_account`'s [`PublicKey`] in [`String`] format +/// +/// The `funding_account`'s signatures comes from signing 2 transactions: +/// * [payment](Operation::new_payment) transaction +/// * account merge transaction +/// * [Add a trust line](Operation::new_change_trust_with_limit) from the given `asset_code`. If the asset code does not exist in the db, +/// it will return [`NotFound`](crate::infra::Error::NotFound) +/// * [Merging](Operation::new_account_merge) the `ephemeral_account_id` to the `funding_account` +pub async fn build_payment_and_merge_tx( + pool: &Pool, funding_account: &AccountConfig, ephemeral_account_id: PublicKey, ephemeral_sequence: i64, - payment_data: Sep24Result, + asset_code: &str, max_time:u64, - asset_code: &str + payment_data: Sep24Result, ) -> Result,Error>{ - let token = Token::try_by_asset_code(asset_code)?; + // retrieve the token + let token = get_single_token(pool, asset_code).await?; let payment_tx = payment_transaction( ephemeral_account_id.clone(), @@ -56,6 +65,8 @@ pub fn build_payment_and_merge_tx( "public": public_key }))) } + +#[doc(hidden)] fn payment_transaction( source_account_id: PublicKey, next_sequence: i64, @@ -80,13 +91,14 @@ fn payment_transaction( )?; payment_tx.append_operation(payment_op).map_err(|e| { - error!("‼️{:<3} - appending operation to transaction: {e:?}", "FAILED"); + error!("‼️{:<6} - appending operation to transaction: {e:?}", "FAILED"); Error::TransactionError("append operation".to_string()) })?; Ok(payment_tx) } +#[doc(hidden)] fn merge_transaction( source_account_id: PublicKey, next_sequence: i64, @@ -116,7 +128,7 @@ fn merge_transaction( merge_tx.append_multiple(vec![change_trust_op,merge_op]) .map_err(|e| { - error!("‼️{:<3} - appending operations to transaction: {e:?}", "FAILED"); + error!("‼️{:<6} - appending operations to transaction: {e:?}", "FAILED"); Error::TransactionError("append multiple operations".to_string()) })?; diff --git a/signer-service-rust/src/api/mod.rs b/signer-service-rust/src/api/mod.rs index 935381e5..087fb06d 100644 --- a/signer-service-rust/src/api/mod.rs +++ b/signer-service-rust/src/api/mod.rs @@ -3,10 +3,11 @@ mod horizon; mod sep24Result; pub mod requests; + pub use sep24Result::Sep24Result; -use serde::{Deserialize, Deserializer, Serialize}; +use serde::{Deserialize, Serialize}; use crate::config::Error as ConfigError; use crate::infra::Error as InfraError; diff --git a/signer-service-rust/src/api/requests.rs b/signer-service-rust/src/api/requests.rs index 4be40028..ce47a169 100644 --- a/signer-service-rust/src/api/requests.rs +++ b/signer-service-rust/src/api/requests.rs @@ -6,8 +6,7 @@ use tracing::error; use crate::api::Sep24Result; use crate::helper::de_str_to_i64; -/// Request Body of [crate::api::routes::create_account()] -/// with api: POST /v1/stellar/create +/// Request Body of api POST /v1/stellar/create to create an account in Stellar #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct StellarCreateRequestBody { @@ -23,8 +22,7 @@ impl StellarCreateRequestBody { } } -/// Request Body of [crate::api::routes::payment()] -/// with api: POST /v1/stellar/create +/// Request Body of api POST /v1/stellar/payment #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct StellarPaymentRequestBody { @@ -43,9 +41,10 @@ impl StellarPaymentRequestBody { } } +#[doc(hidden)] fn get_public_key_or_return_json_error(id:&str, name:&str) -> Result> { PublicKey::from_encoding(id).map_err(|e|{ - error!("‼️{:<3} - Encoding {name} {id}: {e:?}", "FAILED"); + error!("‼️{:<6} - Encoding {name} {id}: {e:?}", "FAILED"); let error = format!("Encoding Failed: {name}"); Json(json!({ diff --git a/signer-service-rust/src/api/routes/methods.rs b/signer-service-rust/src/api/routes/impls.rs similarity index 65% rename from signer-service-rust/src/api/routes/methods.rs rename to signer-service-rust/src/api/routes/impls.rs index a15f76db..e3b8360d 100644 --- a/signer-service-rust/src/api/routes/methods.rs +++ b/signer-service-rust/src/api/routes/impls.rs @@ -6,14 +6,15 @@ use tokio::time::Instant; use tracing::{info, warn}; use wallet::HorizonBalance; use crate::api::{build_create_account_tx, build_payment_and_merge_tx, requests}; -use crate::config::AccountConfig; +use crate::AppState; -/// Performs POST /v1/stellar/create +/// Performs POST /v1/stellar/create and requires [`StellarCreateRequestBody`] request body +/// Calls the function [`build_create_account_tx`] pub(super) async fn create_account( - State(funding_account): State, + State(state): State, Json(payload): Json ) -> Json { - info!("📦{:<3}: {payload:#?}","POST create payload"); + info!("📦{:<6}: {payload:#?}","POST create payload"); let start = Instant::now(); let ephemeral_account_id = match payload.account_id_as_public_key() { @@ -22,7 +23,8 @@ pub(super) async fn create_account( }; let res = build_create_account_tx( - &funding_account, + &state.pool, + &state.account, &ephemeral_account_id, &payload.asset_code, payload.max_time @@ -37,16 +39,17 @@ pub(super) async fn create_account( }); let duration = start.elapsed(); - info!("➡️{:<3} {duration:?}", "POST create"); + info!("➡️ {:<6} {duration:?}", "POST create"); res } -/// Performs POST /v1/stellar/payment +/// Performs POST /v1/stellar/payment and requires [`StellarPaymentRequestBody`] request body +/// Calls the function [`build_payment_and_merge_tx`] pub(super) async fn payment( - State(funding_account): State, + State(state): State, Json(payload): Json ) -> Json { - info!("📦{:<3}: {payload:#?}","POST payment payload"); + info!("📦{:<6}: {payload:#?}","POST payment payload"); let start = Instant::now(); @@ -57,13 +60,14 @@ pub(super) async fn payment( let res = build_payment_and_merge_tx( - &funding_account, + &state.pool, + &state.account, ephemeral_account_id, payload.sequence, - payload.payment_data, + &payload.asset_code, payload.max_time, - &payload.asset_code - ).unwrap_or_else(|e|{ + payload.payment_data, + ).await.unwrap_or_else(|e|{ Json(json!({ "status": 500, "error": "Server Error", @@ -73,17 +77,17 @@ pub(super) async fn payment( }); let duration = start.elapsed(); - info!("➡️{:<3} {duration:?}", "POST payment"); + info!("➡️ {:<6} {duration:?}", "POST payment"); res } - -/// Performs GET /v1/status -pub(super) async fn status(State(account): State) -> Json { +/// Performs GET /v1/status returns the [`PublicKey`](substrate_stellar_sdk::PublicKey) (in [`String`] format) of the funding account +/// defined in the environment variable `STELLAR_SECRET_KEY` +pub(super) async fn status(State(state): State) -> Json { let start = Instant::now(); - let pub_key = account.public_key_as_str(); - let res = match account.get_balances().await { + let pub_key = state.account.public_key_as_str(); + let res = match state.account.get_balances().await { Ok(balances) => _get_balance_success(&pub_key, balances), Err(e) => { let e = format!("{e:?}"); @@ -96,11 +100,11 @@ pub(super) async fn status(State(account): State) -> Json }; let duration = start.elapsed(); - info!("➡️{:<3} {duration:?}", "GET status"); + info!("➡️ {:<6} {duration:?}", "GET status"); res } - +#[doc(hidden)] fn _get_balance_success(public_key_as_str:&str, balances: Vec) -> Json { let failed_status = Json(json!({ "status": false, @@ -115,16 +119,16 @@ fn _get_balance_success(public_key_as_str:&str, balances: Vec) - } } ) else { - warn!("⚠️{:<3} - XLM balance of Stellar Public Key {public_key_as_str}\n", "NOT FOUND"); + warn!("⚠️{:<6} - XLM balance of Stellar Public Key {public_key_as_str}\n", "NOT FOUND"); return failed_status; }; if native_balance.balance < 2.5 { - warn!("⚠️{:<3} - XLM balance of Stellar Public Key {public_key_as_str}\n", "INSUFFICIENT"); + warn!("⚠️{:<6} - XLM balance of Stellar Public Key {public_key_as_str}\n", "INSUFFICIENT"); return failed_status; } - info!("💰️{:<3} - Stellar Public Key {public_key_as_str} has sufficient XLM balance", "EXIST"); + info!("💰️{:<6} - Stellar Public Key {public_key_as_str} has sufficient XLM balance", "EXIST"); Json(json!({ "status": true, "public": public_key_as_str diff --git a/signer-service-rust/src/api/routes/mod.rs b/signer-service-rust/src/api/routes/mod.rs index 83bb3a4c..23fe5a28 100644 --- a/signer-service-rust/src/api/routes/mod.rs +++ b/signer-service-rust/src/api/routes/mod.rs @@ -1,31 +1,33 @@ -mod methods; + +/// implementations of the routes +mod impls; use axum::Router; use axum::routing::{get, post}; -use crate::api::routes::methods::{create_account, payment, status}; -use crate::config::AccountConfig; +use crate::api::routes::impls::{create_account, payment, status}; +use crate::AppState; /// Returns /v1/... routes -pub fn v1_routes(account:AccountConfig) -> Router { +pub fn v1_routes(state:AppState) -> Router { Router::new().nest( "/v1", - status_route(account.clone()) - .merge(stellar_routes(account)) + status_route(state.clone()) + .merge(stellar_routes(state)) ) } /// GET /v1/status -fn status_route(account:AccountConfig) -> Router { +fn status_route(state:AppState) -> Router { Router::new().route("/status", get(status)) - .with_state(account) + .with_state(state) } /// POST /v1/stellar/create and /// POST /v1/stellar/payment -fn stellar_routes(account:AccountConfig) -> Router { +fn stellar_routes(state:AppState) -> Router { Router::new() .route("/stellar/create", post(create_account)) .route("/stellar/payment", post(payment)) - .with_state(account) + .with_state(state) } \ No newline at end of file diff --git a/signer-service-rust/src/api/sep24Result.rs b/signer-service-rust/src/api/sep24Result.rs index d12e96ab..3176c71e 100644 --- a/signer-service-rust/src/api/sep24Result.rs +++ b/signer-service-rust/src/api/sep24Result.rs @@ -1,25 +1,23 @@ use std::fmt::Debug; -use serde::{Deserialize, Deserializer, Serialize}; -use substrate_stellar_sdk::{Memo, PublicKey, StroopAmount}; +use serde::{Deserialize, Serialize}; +use substrate_stellar_sdk::{Memo, PublicKey}; use substrate_stellar_sdk::compound_types::LimitedString; use tracing::error; use crate::api::Error; -use crate::helper::de_str_to_i64; #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct Sep24Result { pub amount: String, pub memo: String, + /// Can be a numeric String value based on [`substrate_stellar_sdk::types::MemoType`] pub memo_type: String, pub offramping_account: String, } impl Sep24Result { - /// returns a [`Memo`] from the fields [`self.memo`] and [`self.memo_type`]. - /// [`self.memo_type`] can be a numeric String value - /// derived from [`substrate_stellar_sdk::types::MemoType`] + /// returns a [`Memo`] derived from the fields `memo` and `memo_type`. pub fn memo(&self) -> Result{ let memo_type = self.memo_type.to_lowercase(); @@ -29,7 +27,7 @@ impl Sep24Result { Ok(Memo::MemoText( LimitedString::new(memo) .map_err(|e| { - error!("‼️{:<3} - Convert memo to type Memo: {e:?}", "FAILED"); + error!("‼️{:<6} - Convert memo to type Memo: {e:?}", "FAILED"); Error::InvalidMemo })? )) @@ -41,7 +39,7 @@ impl Sep24Result { Ok(Memo::MemoHash(memo)) } _ => { - error!("‼️{:<3} - Unsupported offramp memo type: {:?}", "FAILED", self.memo_type); + error!("‼️{:<6} - Unsupported offramp memo type: {:?}", "FAILED", self.memo_type); Err(Error::InvalidMemo) } } @@ -50,23 +48,8 @@ impl Sep24Result { /// returns offramping_account as [`PublicKey`] pub fn offramping_account_id(&self) -> Result { PublicKey::from_encoding(&self.offramping_account).map_err(|e| { - error!("‼️{:<3} - Encoding offramping account {}: {e:?}", "FAILED", self.offramping_account); + error!("‼️{:<6} - Encoding offramping account {}: {e:?}", "FAILED", self.offramping_account); Error::EncodingFailed("offramping account".to_string()) }) } - - #[cfg(test)] - pub fn new( - amount: i64, - memo: String, - memo_type: String, - offramping_account: String - ) -> Self { - Sep24Result { - amount, - memo, - memo_type, - offramping_account - } - } } \ No newline at end of file diff --git a/signer-service-rust/src/config/account.rs b/signer-service-rust/src/config/account.rs index 7b1dde68..45ede9ae 100644 --- a/signer-service-rust/src/config/account.rs +++ b/signer-service-rust/src/config/account.rs @@ -7,9 +7,15 @@ use wallet::{HorizonBalance, StellarWallet}; use crate::config::Error; use crate::helper::public_key_as_string; +#[doc(hidden)] +/// the environment variable name to store the secret key const STELLAR_SECRET_KEY:&str = "STELLAR_SECRET_KEY"; + +#[doc(hidden)] +/// the environment variable name to store whether to use Public network or Test network const STELLAR_PUBLIC_NETWORK:&str = "STELLAR_PUBLIC_NETWORK"; +/// The configuration of the funding account #[derive(Clone)] pub struct AccountConfig { secret:SecretKey, @@ -26,6 +32,7 @@ impl Debug for AccountConfig { } impl AccountConfig { + /// Create new config via environment variables pub(super) fn try_from_env() -> Result { let secret = env::var(STELLAR_SECRET_KEY).map_err(|_| Error::MissingStellarSecretKey)?; let secret = SecretKey::from_encoding(&secret) @@ -47,14 +54,17 @@ impl AccountConfig { }) } + /// returns the [`PublicKey`] of the funding account in [`String`] format pub fn public_key_as_str(&self) -> String { public_key_as_string(self.secret.get_public()) } + /// returns the [`PublicKey`] of the funding account pub fn public_key(&self) -> PublicKey { self.secret.get_public().clone() } - + + /// returns the Stellar network to use pub fn network(&self) -> &Network { if self.is_public_network { &PUBLIC_NETWORK @@ -63,7 +73,7 @@ impl AccountConfig { } } - /// Returns a signature OR the Vec version of the signature + /// Returns a signature to be added in this `tx` transaction pub fn create_base64_signature( &self, tx:Transaction @@ -76,36 +86,39 @@ impl AccountConfig { String::from_utf8(res.clone()) .map_err(|e| { - error!("⚠️{:<3} - converting Vec to base64 signature: {e:?}\n", "FAILED"); + error!("⚠️{:<6} - converting Vec to base64 signature: {e:?}\n", "FAILED"); Error::ParseFailed("base64 signature".to_string()) }) } + /// Returns the current sequence of this account pub async fn get_sequence(&self) -> Result { let wallet = self.create_wallet()?; wallet.get_sequence().await.map_err(|e|{ let pub_key = self.public_key_as_str(); - error!("⚠️{:<3} - retrieving next sequence of {pub_key}: {e:?}\n", "FAILED"); + error!("⚠️{:<6} - retrieving current sequence of {pub_key}: {e:?}\n", "FAILED"); Error::CreateWalletFailed }) } + /// Returns a list of [`HorizonBalance`]s of this account pub async fn get_balances(&self) -> Result, Error> { let wallet = self.create_wallet()?; wallet.get_balances().await.map_err(|e|{ let pub_key = self.public_key_as_str(); - error!("⚠️{:<3} - retrieving balances of {pub_key}: {e:?}\n", "FAILED"); + error!("⚠️{:<6} - retrieving balances of {pub_key}: {e:?}\n", "FAILED"); Error::CreateWalletFailed }) } + #[doc(hidden)] fn create_wallet(&self) -> Result { StellarWallet::from_secret_key(self.secret.clone(),self.is_public_network) .map_err(|e|{ let pub_key = self.public_key_as_str(); - error!("⚠️{:<3} - creating wallet of {pub_key}: {e:?}\n", "FAILED"); + error!("⚠️{:<6} - creating wallet of {pub_key}: {e:?}\n", "FAILED"); Error::CreateWalletFailed }) } diff --git a/signer-service-rust/src/config/database.rs b/signer-service-rust/src/config/database.rs index b7d92d4e..4acf2c43 100644 --- a/signer-service-rust/src/config/database.rs +++ b/signer-service-rust/src/config/database.rs @@ -1,14 +1,20 @@ use std::env; use std::fmt::{Debug, Formatter}; -use deadpool_diesel::Manager; -use deadpool_diesel::postgres::Pool; + +use deadpool_diesel::postgres::{Manager,Pool}; +use tracing::error; use crate::config::{Error, try_get_port_from_env}; +#[doc(hidden)] const DATABASE_HOST:&str = "DATABASE_HOST"; +#[doc(hidden)] const DATABASE_PORT:&str = "DATABASE_PORT"; +#[doc(hidden)] const POSTGRES_USER:&str = "POSTGRES_USER"; +#[doc(hidden)] const POSTGRES_PASSWORD:&str = "POSTGRES_PASSWORD"; +/// The configuration of the Postgres db pub struct DatabaseConfig { host: String, port: u16, @@ -31,6 +37,7 @@ impl Debug for DatabaseConfig { } impl DatabaseConfig { + /// Create new config via environment variables pub(super) fn try_from_env() -> Result { Ok(DatabaseConfig{ host: env::var(DATABASE_HOST).map_err(|_| Error::MissingDatabaseHost)?, @@ -40,18 +47,21 @@ impl DatabaseConfig { }) } - /// Create a connection pool to the PostgreSQL database - pub fn create_pool(&self) -> Pool { - let url = self.url(); - println!("The db url: {url}"); + /// Create a connection pool for the Postgres database + pub fn create_pool(&self) -> Result { let manager = Manager::new( self.url(), deadpool_diesel::Runtime::Tokio1 ); - Pool::builder(manager).build().unwrap() + + Pool::builder(manager).build().map_err(|e| { + error!("‼️{:<6} - {e:?}", "FAILED"); + Error::ConnectionPoolError + }) } - // set to private, so as not to accidentally print the username and password somewhere else + #[doc(hidden)] + // Set to private, so as not to accidentally print the username and password somewhere else fn url(&self) -> String { format!("postgres://{}:{}@{}:{}/postgres", self.user, diff --git a/signer-service-rust/src/config/error.rs b/signer-service-rust/src/config/error.rs index fd65c5db..7b4de703 100644 --- a/signer-service-rust/src/config/error.rs +++ b/signer-service-rust/src/config/error.rs @@ -15,5 +15,7 @@ pub enum Error { MissingStellarSecretKey, MissingStellarNetworkIdentifier, CreateWalletFailed, - ParseFailed(String) + ParseFailed(String), + + ConnectionPoolError } \ No newline at end of file diff --git a/signer-service-rust/src/config/mod.rs b/signer-service-rust/src/config/mod.rs index 136eac39..5026a3ca 100644 --- a/signer-service-rust/src/config/mod.rs +++ b/signer-service-rust/src/config/mod.rs @@ -22,7 +22,7 @@ impl Config { pub fn try_from_env_file(file_name:&str) -> Result { // Load environment variables from .env file. if let None = dotenvy::from_filename(file_name).ok() { - error!("‼️{:<3} - Reading file {file_name}", "FAILED"); + error!("‼️{:<6} - Reading file {file_name}", "FAILED"); return Err(Error::FileDoesNotExist(file_name.to_string())); }; @@ -52,7 +52,7 @@ fn try_get_port_from_env(env_var_name:&str, error:Error) -> Result { }; port_as_str.parse::().map_err(|_| { - error!("‼️{:<3} - Convert {env_var_name} {port_as_str} to u16", "FAILED"); + error!("‼️{:<6} - Convert {env_var_name} {port_as_str} to u16", "FAILED"); error }) } \ No newline at end of file diff --git a/signer-service-rust/src/config/server.rs b/signer-service-rust/src/config/server.rs index ebfc49f6..164f7a14 100644 --- a/signer-service-rust/src/config/server.rs +++ b/signer-service-rust/src/config/server.rs @@ -4,13 +4,15 @@ use std::{ }; use crate::config::{Error, try_get_port_from_env}; +#[doc(hidden)] const SERVER_HOST:&str = "SERVER_HOST"; +#[doc(hidden)] const SERVER_PORT:&str = "SERVER_PORT"; const DEFAULT_SERVER_HOST:&str = "127.0.0.1"; const DEFAULT_SERVER_PORT:u16 = 3001; -/// Holds the address of our server +/// The configuration to hold the address of our server #[derive(Debug)] pub struct ServerConfig { host: String, @@ -27,6 +29,7 @@ impl Default for ServerConfig { } impl ServerConfig { + /// Create new config via environment variables pub(super) fn try_from_env() -> Result { Ok(ServerConfig { host: env::var(SERVER_HOST).map_err(|_| Error::MissingServerHost)?, @@ -34,12 +37,14 @@ impl ServerConfig { }) } + /// Returns [`SocketAddr`] derived from the `host` and `port` or + /// [ParseFailed](Error::ParseFailed) if address is invalid pub fn socket_address(&self) -> Result { let address = format!("{}:{}", self.host, self.port); // Parse the socket address address.parse() .map_err(|e| { - tracing::error!("‼️{:<3} - Parsing Server Address:{address}: {e:?}", "FAILED"); + tracing::error!("‼️{:<6} - Parsing Server Address:{address}: {e:?}", "FAILED"); Error::ParseFailed("server address".to_string()) }) } diff --git a/signer-service-rust/src/helper.rs b/signer-service-rust/src/helper.rs index 1b792b1d..213db8bd 100644 --- a/signer-service-rust/src/helper.rs +++ b/signer-service-rust/src/helper.rs @@ -5,7 +5,7 @@ use substrate_stellar_sdk::PublicKey; pub fn public_key_as_string(public_key:&PublicKey) -> String { String::from_utf8(public_key.to_encoding()) .unwrap_or_else(|e| { - tracing::warn!("⚠️{:<3} - Stellar Public Key conversion:{e:?}\n", "WARNING"); + tracing::warn!("⚠️{:<6} - Stellar Public Key conversion:{e:?}\n", "WARNING"); "undefined".to_string() }) } @@ -15,6 +15,5 @@ pub fn de_str_to_i64<'de, D>(de: D) -> Result D: Deserializer<'de>, { let s: &str = Deserialize::deserialize(de)?; - i64::from_str(s).map_err(serde::de::Error::custom) } \ No newline at end of file diff --git a/signer-service-rust/src/infra/error.rs b/signer-service-rust/src/infra/error.rs index d04486ff..0638548e 100644 --- a/signer-service-rust/src/infra/error.rs +++ b/signer-service-rust/src/infra/error.rs @@ -5,8 +5,9 @@ use serde::{Deserialize, Serialize}; #[derive(Debug, Deserialize, Serialize)] pub enum Error { - InternalServerError, + InternalServerError(String), NotFound, + MigrationFailed, DoesNotExist(String), SerdeError(String), @@ -21,7 +22,7 @@ impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { Error::NotFound => write!(f, "Not found"), - Error::InternalServerError => write!(f, "Internal server error"), + Error::InternalServerError(e) => write!(f, "Internal server error: {}",e.to_string()), other => write!(f, "{:?}", other) } } @@ -35,19 +36,19 @@ impl ErrorExt for diesel::result::Error { fn as_infra_error(&self) -> Error { match self { diesel::result::Error::NotFound => Error::NotFound, - _ => Error::InternalServerError, + other => { Error::InternalServerError(other.to_string()) }, } } } impl ErrorExt for deadpool_diesel::PoolError { fn as_infra_error(&self) -> Error { - Error::InternalServerError + Error::InternalServerError(self.to_string()) } } impl ErrorExt for InteractError { fn as_infra_error(&self) -> Error { - Error::InternalServerError + Error::InternalServerError(self.to_string()) } } \ No newline at end of file diff --git a/signer-service-rust/src/infra/impls.rs b/signer-service-rust/src/infra/impls.rs new file mode 100644 index 00000000..f29738b5 --- /dev/null +++ b/signer-service-rust/src/infra/impls.rs @@ -0,0 +1,109 @@ +use deadpool_diesel::postgres::Pool; +use diesel::{ + ExpressionMethods, PgTextExpressionMethods, QueryDsl, RunQueryDsl, + SelectableHelper, +}; + +use crate::infra::{Error, Token}; +use crate::infra::error::adapt_infra_error; +use crate::infra::models::{TokensDb, TokensFilter}; +use crate::infra::schema::tokens; + +/// insert row to `tokens` table +pub async fn insert(pool: &Pool, token:Token) -> Result { + let conn = pool.get().await + .map_err(adapt_infra_error)?; + + let res = conn.interact(|conn| { + diesel::insert_into(tokens::table) + .values(token) + .returning(TokensDb::as_returning()) + .get_result(conn) + }) + .await + .map_err(adapt_infra_error)? + .map_err(adapt_infra_error)?; + + Ok(res.id) +} + +/// get all tokens based on the filter +pub async fn get_all_tokens(pool: &Pool, filter:TokensFilter) -> Result,Error> { + let conn = pool.get().await.map_err(adapt_infra_error)?; + let res = conn + .interact(move |conn| { + let mut query = tokens::table.into_boxed::(); + + if let Some(asset_code) = filter.asset_code { + let asset_code = asset_code.to_uppercase(); + query = query.filter(tokens::asset_code.ilike(format!("{}%", asset_code))); + } + + if let Some(asset_issuer) = filter.asset_issuer { + query = query.filter(tokens::asset_issuer.eq(asset_issuer)); + } + + if let Some(vault_account_id) = filter.vault_account_id { + query = query.filter(tokens::vault_account_id.eq(vault_account_id)); + } + + query.select(TokensDb::as_select()).load::(conn) + }) + .await + .map_err(adapt_infra_error)? + .map_err(adapt_infra_error)?; + + Ok(res + .into_iter() + .map(|tokens_db| tokens_db.into_token()) + .collect() + ) +} + +pub async fn get_token_by_asset_code(pool: &Pool, asset_code:&str) -> Result,Error> { + let filter = TokensFilter { + asset_code: Some(asset_code.to_string()), + asset_issuer: None, + vault_account_id: None, + }; + + get_all_tokens(pool,filter).await +} + +// todo: use db instead of file +pub mod file { + use tracing::error; + use crate::infra::{Error, Token}; + + #[doc(hidden)] + /// Returns a Token by reading from a json file + pub fn try_from_path(path: &str) -> Result { + let read_file = std::fs::read_to_string(path) + .map_err(|_| { + error!("‼️{:<6} - Reading file {path}", "FAILED"); + Error::DoesNotExist(path.to_string()) + })?; + + serde_json::from_str(&read_file) + .map_err(|e| { + error!("‼️{:<6} - Deserializing to Token struct in file {path}: {e:?}", "FAILED"); + Error::SerdeError(format!("Token struct in file {path}")) + }) + } + + /// Returns a Token based on a supported asset_code + pub fn try_by_asset_code(asset_code:&str) -> Result { + let asset_code = asset_code.to_uppercase(); + let path = format!("./resources/tokens/{asset_code}.json"); + + try_from_path(&path).map_err(|e| { + match e { + Error::DoesNotExist(_) => { + Error::DoesNotExist(asset_code) + } + _ => e + } + }) + } + +} \ No newline at end of file diff --git a/signer-service-rust/src/infra/mod.rs b/signer-service-rust/src/infra/mod.rs index 960b779d..d65f61b1 100644 --- a/signer-service-rust/src/infra/mod.rs +++ b/signer-service-rust/src/infra/mod.rs @@ -1,21 +1,53 @@ mod error; -mod token; +mod impls; mod schema; mod models; - use deadpool_diesel::postgres::Pool; use diesel_migrations::{embed_migrations, EmbeddedMigrations, MigrationHarness}; +use tracing::{error, info, warn}; pub use error::Error; -pub use token::Token; +pub use models::{Token,TokensFilter}; +use impls::file::try_by_asset_code; +use impls::insert; + +pub use impls::{get_all_tokens, get_token_by_asset_code}; pub const MIGRATIONS: EmbeddedMigrations = embed_migrations!("migrations/"); -pub async fn run_migrations(pool:&Pool) { - let conn = pool.get().await.unwrap(); - conn.interact(|conn| conn.run_pending_migrations(MIGRATIONS).map(|_| ())) - .await - .unwrap(); +pub async fn run_migrations(pool:&Pool) -> Result<(),Error> { + match pool.get().await { + Err(e) => { + error!("‼️{:<6} - retrieving object from pool: {e:?}", "FAILED"); + return Err(Error::MigrationFailed) + } + Ok(conn) => if let Err(e) = conn.interact(|conn| { + conn.run_pending_migrations(MIGRATIONS).map(|_|()) + }).await { + error!("‼️{:<6} - migration: {e:?}", "FAILED"); + return Err(Error::MigrationFailed) + } + } + + Ok(()) +} + + +#[doc(hidden)] +/// Inserts BRL and EURC to db +pub async fn initialize_db(pool: &Pool) -> Result<(),Error> { + let brl_token = try_by_asset_code("brL")?; + match insert(pool,brl_token.clone()).await { + Ok(id) => info!("💰️{:<6} - to db with id {id}: {brl_token:?} ", "INSERTED"), + Err(e) => warn!("⚠️{:<6} - inserting {} to db: {e}", "WARNING", brl_token.asset_code) + }; + + let eurc_token = try_by_asset_code("eurc")?; + match insert(pool, eurc_token.clone()).await { + Ok(id) => info!("💰️{:<6} - to db with id {id}: {eurc_token:?} ", "INSERTED"), + Err(e) => warn!("⚠️{:<6} - inserting {} to db: {e}", "WARNING", eurc_token.asset_code) + }; -} \ No newline at end of file + Ok(()) +} diff --git a/signer-service-rust/src/infra/models.rs b/signer-service-rust/src/infra/models.rs index ef4325ab..d79486ea 100644 --- a/signer-service-rust/src/infra/models.rs +++ b/signer-service-rust/src/infra/models.rs @@ -1,12 +1,14 @@ -use deadpool_diesel::postgres::Pool; use diesel::{ - ExpressionMethods, Identifiable, PgTextExpressionMethods, QueryDsl, Queryable, RunQueryDsl, - Selectable, SelectableHelper, + Identifiable, Insertable, Queryable, + Selectable, }; -use crate::infra::error::adapt_infra_error; -use crate::infra::{Error, Token}; -use crate::infra::schema::tokens; +use serde::{Deserialize, Serialize}; +use substrate_stellar_sdk::{Asset, PublicKey}; +use substrate_stellar_sdk::types::{AlphaNum12, AlphaNum4}; +use tracing::error; +use crate::infra::Error; +/// Representation of the `tokens` Table #[derive(Identifiable, Queryable, Selectable)] #[diesel(table_name = crate::infra::schema::tokens)] #[diesel(check_for_backend(diesel::pg::Pg))] @@ -19,12 +21,8 @@ pub(super) struct TokensDb { pub min_withdrawal_amount: Option } -pub struct TokensFilter { - pub asset_code: Option, - pub asset_issuer: Option, - pub vault_account_id: Option, -} impl TokensDb { + /// convert to [`Token`] structure pub fn into_token(self) -> Token { Token { asset_code: self.asset_code, @@ -36,51 +34,137 @@ impl TokensDb { } } -pub async fn insert(pool: &Pool, token:Token) -> Result { - let conn = pool.get().await - .map_err(adapt_infra_error)?; - - let res = conn.interact(|conn| { - diesel::insert_into(tokens::table) - .values(token) - .returning(TokensDb::as_returning()) - .get_result(conn) - }) - .await - .map_err(adapt_infra_error)? - .map_err(adapt_infra_error)?; - - Ok(res.id) +/// A row of the `tokens` table WITHOUT the `id` column. +#[derive(Insertable, PartialEq, Clone, Debug, Serialize,Deserialize)] +#[diesel(table_name = crate::infra::schema::tokens)] +pub struct Token { + pub asset_code: String, + pub asset_issuer: String, + pub vault_account_id: String, + pub toml_url: String, + pub min_withdrawal_amount: Option, } -pub async fn get_all(pool: &Pool, filter:TokensFilter) -> Result,Error> { - let conn = pool.get().await.map_err(adapt_infra_error)?; - let res = conn - .interact(move |conn| { - let mut query = tokens::table.into_boxed::(); +impl Token { + pub fn asset_code_hex(&self) -> String { + let asset_code = self.asset_code.to_uppercase(); + let mut hex = format!("0x{}", hex::encode(&asset_code)); - if let Some(asset_code) = filter.asset_code { - let asset_code = asset_code.to_uppercase(); - query = query.filter(tokens::asset_code.ilike(format!("{}%", asset_code))); - } + for _ in self.asset_code.len()..4 { + hex = hex + "00"; + } - if let Some(asset_issuer) = filter.asset_issuer { - query = query.filter(tokens::asset_issuer.eq(asset_issuer)); - } + hex + } + + pub fn asset_type(&self) -> Result { + let _asset_code = self.asset_code.to_uppercase(); + let _asset_code = _asset_code.as_bytes(); - if let Some(vault_account_id) = filter.vault_account_id { - query = query.filter(tokens::vault_account_id.eq(vault_account_id)); + Ok( + if self.asset_code.len() <= 4 { + let mut asset_code = [0; 4]; + asset_code[.._asset_code.len()].copy_from_slice(_asset_code); + + Asset::AssetTypeCreditAlphanum4( + AlphaNum4 { + asset_code, + issuer: self.asset_issuer_as_public_key()? + } + ) + } else { + let mut asset_code = [0; 12]; + asset_code[.._asset_code.len()].copy_from_slice(_asset_code); + + Asset::AssetTypeCreditAlphanum12( + AlphaNum12 { + asset_code, + issuer: self.asset_issuer_as_public_key()?, + } + ) } + ) + } - query.select(TokensDb::as_select()).load::(conn) + fn asset_issuer_as_public_key(&self) -> Result { + PublicKey::from_encoding(&self.asset_issuer).map_err(|e|{ + error!("‼️{:<6} - Encoding asset issuer:{}: {e:?}", "FAILED", &self.asset_issuer); + Error::EncodingFailed("asset issuer".to_string()) }) - .await - .map_err(adapt_infra_error)? - .map_err(adapt_infra_error)?; - - Ok(res - .into_iter() - .map(|tokens_db| tokens_db.into_token()) - .collect() - ) + } } + +/// The allowable columns for filtering the `tokens` Table +pub struct TokensFilter { + pub asset_code: Option, + pub asset_issuer: Option, + pub vault_account_id: Option, +} + +#[cfg(test)] +mod test { + use super::*; + + fn test_token() -> Token { + Token { + asset_code: "tzs".to_string(), + asset_issuer: "GAENCD6BPYV46VEXWI7KH6D6DW342DB3HIVDM4ES2EDJGLX5MPFB74TG".to_string(), + vault_account_id: "6g7fKQQZ9VfbBTQSaKBcATV4psApFra5EDwKLARFZCCVnSWS".to_string(), + toml_url: "sample toml".to_string(), + min_withdrawal_amount: None, + } + } + + mod token { + use substrate_stellar_sdk::PublicKey::PublicKeyTypeEd25519; + use super::*; + + #[test] + fn test_asset_code_hex() { + let mut token = test_token(); + assert_eq!( + token.asset_code_hex(), + "0x545a5300".to_string() + ); + + token.asset_code = "brl".to_string(); + assert_eq!( + token.asset_code_hex(), + "0x42524c00".to_string() + ); + } + + #[test] + fn test_asset_type() { + let mut token = test_token(); + + let expected_asset = Asset::AssetTypeCreditAlphanum4( + AlphaNum4 { + asset_code: [84, 90, 83, 0], + issuer: PublicKeyTypeEd25519( + [8, 209, 15, 193, 126, 43, 207, 84, 151, 178, 62, + 163, 248, 126, 29, 183, 205, 12, 59, 58, 42, 54, + 112, 146, 209, 6, 147, 46, 253, 99, 202, 31 + ]) + } + ); + + let actual_asset = token.asset_type().expect("should return an asset"); + assert_eq!( + actual_asset, + expected_asset + ); + + // fail with "range end index 13 out of range for slice of length 12" + token.asset_code = "1234567890123".to_string(); + assert!(token.asset_type().is_err()); // should fail + } + + #[test] + fn test_asset_issuer_as_public_key() { + + } + + } + +} \ No newline at end of file diff --git a/signer-service-rust/src/infra/schema.rs b/signer-service-rust/src/infra/schema.rs new file mode 100644 index 00000000..1d69b01c --- /dev/null +++ b/signer-service-rust/src/infra/schema.rs @@ -0,0 +1,16 @@ +// @generated automatically by Diesel CLI. + +diesel::table! { + tokens (id) { + id -> Int4, + #[max_length = 12] + asset_code -> Varchar, + #[max_length = 60] + asset_issuer -> Varchar, + #[max_length = 60] + vault_account_id -> Varchar, + toml_url -> Text, + #[max_length = 20] + min_withdrawal_amount -> Nullable, + } +} diff --git a/signer-service-rust/src/infra/token.rs b/signer-service-rust/src/infra/token.rs deleted file mode 100644 index 88b019e6..00000000 --- a/signer-service-rust/src/infra/token.rs +++ /dev/null @@ -1,95 +0,0 @@ - -use diesel::prelude::Insertable; -use serde::{Deserialize, Serialize}; -use substrate_stellar_sdk::{Asset, PublicKey}; -use substrate_stellar_sdk::types::{AlphaNum12, AlphaNum4}; - -use tracing::error; -use crate::infra::Error; - -#[derive(Insertable, PartialEq, Debug, Serialize,Deserialize)] -#[diesel(table_name = crate::infra::schema::tokens)] -pub struct Token { - pub asset_code: String, - pub asset_issuer: String, - pub vault_account_id: String, - pub toml_url: String, - pub min_withdrawal_amount: Option, -} - -impl Token { - /// Returns a Token by reading from a json file - pub fn try_from_path(path: &str) -> Result { - let read_file = std::fs::read_to_string(path) - .map_err(|_| { - error!("‼️{:<3} - Reading file {path}", "FAILED"); - Error::DoesNotExist(path.to_string()) - })?; - - serde_json::from_str(&read_file) - .map_err(|e| { - error!("‼️{:<3} - Deserializing to Token struct in file {path}: {e:?}", "FAILED"); - Error::SerdeError(format!("Token struct in file {path}")) - }) - } - - /// Returns a Token based on a supported asset_code - /// todo: read from database next time - pub fn try_by_asset_code(asset_code:&str) -> Result { - let asset_code = asset_code.to_uppercase(); - let path = format!("./resources/tokens/{asset_code}.json"); - - Self::try_from_path(&path).map_err(|e| { - match e { - Error::DoesNotExist(_) => { - Error::NotFound - } - _ => e - } - }) - } - - pub fn asset_code_hex(&self) -> String { - let mut hex = format!("0x{}", hex::encode(&self.asset_code)); - - for _ in self.asset_code.len()..4 { - hex = hex + "00"; - } - - hex - } - - pub fn asset_type(&self) -> Result { - let _asset_code = self.asset_code.as_bytes(); - Ok( - if self.asset_code.len() <= 4 { - let mut asset_code = [0; 4]; - asset_code[.._asset_code.len()].copy_from_slice(_asset_code); - - Asset::AssetTypeCreditAlphanum4( - AlphaNum4 { - asset_code, - issuer: self.asset_issuer()? - } - ) - } else { - let mut asset_code = [0; 12]; - asset_code[.._asset_code.len()].copy_from_slice(_asset_code); - - Asset::AssetTypeCreditAlphanum12( - AlphaNum12 { - asset_code, - issuer: self.asset_issuer()?, - } - ) - } - ) - } - - fn asset_issuer(&self) -> Result { - PublicKey::from_encoding(&self.asset_issuer).map_err(|e|{ - error!("‼️{:<3} - Encoding asset issuer:{}: {e:?}", "FAILED", &self.asset_issuer); - Error::EncodingFailed("asset issuer".to_string()) - }) - } -} diff --git a/signer-service-rust/src/main.rs b/signer-service-rust/src/main.rs index 1b01f3b2..f6e639a9 100644 --- a/signer-service-rust/src/main.rs +++ b/signer-service-rust/src/main.rs @@ -1,8 +1,12 @@ mod config; pub mod infra; mod api; + +#[doc(hidden)] pub mod helper; + +use deadpool_diesel::postgres::Pool; use tracing::info; use tracing_subscriber::{ filter::EnvFilter, @@ -11,9 +15,16 @@ use tracing_subscriber::{ util::SubscriberInitExt }; use crate::api::routes::{v1_routes}; -use crate::infra::run_migrations; +use crate::config::AccountConfig; +use crate::infra::{initialize_db, run_migrations}; + +/// Application State that can be shared amongst routes +#[derive(Clone)] +pub struct AppState { + pub pool: Pool, + pub account: AccountConfig +} -pub struct State; #[tokio::main] async fn main() { init_tracing(); @@ -21,24 +32,26 @@ async fn main() { let config = config::Config::try_from_env_file(".env").unwrap(); let db_cfg = config.database_config(); - let pool = db_cfg.create_pool(); - run_migrations(&pool).await; + let pool = db_cfg.create_pool().unwrap(); + run_migrations(&pool).await.unwrap(); + initialize_db(&pool).await.unwrap(); let server_addr = config.server_config().socket_address().unwrap(); let listener = tokio::net::TcpListener::bind(server_addr).await.unwrap(); - info!("🚀{:<3} - {:?}\n", "LISTENING", listener.local_addr()); + info!("🚀{:<6} - {:?}\n", "LISTENING", listener.local_addr()); - let account_cfg = config.account_config(); - axum::serve(listener,v1_routes(account_cfg)).await.unwrap(); + let state = AppState { + pool, + account: config.account_config(), + }; + axum::serve(listener,v1_routes(state)).await.unwrap(); } -/// initialize for logging purposes +/// initializes logging fn init_tracing() { tracing_subscriber::registry() .with(fmt::layer()) // will use the value of whatever the RUST_LOG environment variable has been set to. .with(EnvFilter::from_default_env()) .init(); - - } From 5ebd80710624fae06228a7aeb848d6fe93b9b048 Mon Sep 17 00:00:00 2001 From: b-yap <2826165+b-yap@users.noreply.github.com> Date: Tue, 11 Jun 2024 18:19:20 +0800 Subject: [PATCH 09/15] add get for tokens add readme --- signer-service-rust/.env.example | 13 ++ signer-service-rust/README.md | 125 ++++++++++++++++ signer-service-rust/src/api/horizon/helper.rs | 28 ---- signer-service-rust/src/api/routes/impls.rs | 134 +++-------------- signer-service-rust/src/api/routes/mod.rs | 18 ++- .../src/api/routes/stellar_impls.rs | 136 ++++++++++++++++++ signer-service-rust/src/infra/models.rs | 19 ++- 7 files changed, 324 insertions(+), 149 deletions(-) create mode 100644 signer-service-rust/.env.example create mode 100644 signer-service-rust/README.md create mode 100644 signer-service-rust/src/api/routes/stellar_impls.rs diff --git a/signer-service-rust/.env.example b/signer-service-rust/.env.example new file mode 100644 index 00000000..63ea6e65 --- /dev/null +++ b/signer-service-rust/.env.example @@ -0,0 +1,13 @@ +SERVER_HOST=127.0.0.1 +SERVER_PORT=3001 + +DATABASE_HOST=localhost +DATABASE_PORT=5432 +POSTGRES_USER=superuser +POSTGRES_PASSWORD=1234 +DATABASE_URL="postgres://superuser:1234@localhost:5432/postgres" + +STELLAR_SECRET_KEY=SCVJD7BHU5LNFXNIDC7E226HISKUOZUEPJWLA2YU2GNBFMP5PYF2TQBH +STELLAR_PUBLIC_NETWORK=false + + diff --git a/signer-service-rust/README.md b/signer-service-rust/README.md new file mode 100644 index 00000000..997abc4c --- /dev/null +++ b/signer-service-rust/README.md @@ -0,0 +1,125 @@ +## Signer Service in `Rust` +This contains a list of apis equivalent to [signer-service](../signer-service). +Tokens are stored/retrieved in postgres. + +## How to Run + +### Prepare the environment +See [example](.env.example) + +### Prepare Postgres DB +[Postgres docker](https://hub.docker.com/_/postgres) can be used: +```script + docker run --name -e POSTGRES_USER= -e POSTGRES_PASSWORD= -d -p : postgres +``` +### Run the repo +`$> RUST_LOG=info cargo run` +And the log should print: +```log +INFO signer_service_rust: 🚀LISTENING - Ok(127.0.0.1:3001) +``` +On the succeeding runs while your db is still up, you might encounter these logs which can be ignored: +```log +WARN signer_service_rust::infra: ⚠️WARNING - inserting BRL to db: Internal server error: duplicate key value violates unique constraint "tokens_asset_code_asset_issuer_key" +WARN signer_service_rust::infra: ⚠️WARNING - inserting EURC to db: Internal server error: duplicate key value violates unique constraint "tokens_asset_code_asset_issuer_key" +``` +It only warns that the following [tokens](./resources/tokens) are already in the table. + +## The routes + +### **`GET`** http://127.0.0.1:3001/v1/status +if successful, will show the public key of environment variable `STELLAR_SECRET_KEY`: +```json +{ + "public": "GAENC...", + "status": true +} +``` + +### **`GET`** http://127.0.0.1:3001/v1/tokens +returns all the supported tokens +```json +[ + { + "asset_code": "BRL", + "asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP", + "min_withdrawal_amount": "10000000000000", + "toml_url": "https://ntokens.com/.well-known/stellar.toml", + "vault_account_id": "6g7fKQQZ9VfbBTQSaKBcATV4psApFra5EDwKLARFZCCVnSWS" + }, + { + "asset_code": "EURC", + "asset_issuer": "GAQRF3UGHBT6JYQZ7YSUYCIYWAF4T2SAA5237Q5LIQYJOHHFAWDXZ7NM", + "min_withdrawal_amount": "10000000000000", + "toml_url": "https://mykobo.co/.well-known/stellar.toml", + "vault_account_id": "6bsD97dS8ZyomMmp1DLCnCtx25oABtf19dypQKdZe6FBQXSm" + } +] +``` + +### **`POST`** http://127.0.0.1:3001/v1/stellar/payment +requires a request body of: +```json +{ + "accountId": "GAENC...", + "sequence": "466019...", + "paymentData": {"amount": "1000000", "memo":"something", "memoType": "text", "offrampingAccount": "GDNVZLQ4TW..."}, + "maxTime": 10, + "assetCode": "EURC" +} +``` +If successful, will show the public key of environment variable `STELLAR_SECRET_KEY` and the signatures for signing the _payment_ transactions: +```json +{ + "public": "GAENC...", + "signature": [ + "oenVKc3h....wDg==", + "a3asiYAm....3Cg==" + ] +} +``` +If an asset code does not exist: +```json +{ + "details": { + "InfraError": { + "DoesNotExist": "USDC" + } + }, + "error": "Server Error", + "status": 500 +} +``` +If an account is invalid: +```json +{ + "details": { + "EncodingFailed": "offramping account" + }, + "error": "Server Error", + "status": 500 +} +``` + +### **`POST`** http://127.0.0.1:3001/v1/stellar/create +requires a request body of: +```json +{ + "accountId": "GBC...", + "maxTime": 10, + "assetCode": "eurc" +} +``` +If successful, will show: +* the public key of environment variable STELLAR_SECRET_KEY; +* the signatures for signing the _create_ transaction; +* the next sequence number +```json +{ + "public": "GAENCD...", + "sequence": 46601984..., + "signature": [ + "sDVVSuSkwPGoChdTIa...vDA==" + ] +} +``` \ No newline at end of file diff --git a/signer-service-rust/src/api/horizon/helper.rs b/signer-service-rust/src/api/horizon/helper.rs index 943dc189..66716e89 100644 --- a/signer-service-rust/src/api/horizon/helper.rs +++ b/signer-service-rust/src/api/horizon/helper.rs @@ -63,32 +63,4 @@ pub(super) fn asset_to_change_trust_asset_type(token:&Token) -> Result ChangeTrustAsset::AssetTypeNative }).map_err(|e| e.into()) -} - - -#[cfg(test)] -mod test { - use substrate_stellar_sdk::Asset; - use crate::api::horizon::helper::asset_to_change_trust_asset_type; - use crate::infra::Token; - - // #[test] - // fn test_asset_to_change_trust_asset_type() { - // let token = Token { - // asset_code: "XXXXXX".to_string(), - // asset_issuer: "GAENCD6BPYV46VEXWI7KH6D6DW342DB3HIVDM4ES2EDJGLX5MPFB74TG".to_string(), - // vault_account_id: "6g7fKQQZ9VfbBTQSaKBcATV4psApFra5EDwKLARFZCCVnSWS".to_string(), - // toml_url: "sample toml".to_string(), - // min_withdrawal_amount: None, - // }; - // - // assert_eq!( - // asset_to_change_trust_asset_type(&token), - // Ok(Asset::AssetTypeCreditAlphanum12(token.as)) - // - // ) - // - // asset_to_change_trust_asset_type(&token) - // } - } \ No newline at end of file diff --git a/signer-service-rust/src/api/routes/impls.rs b/signer-service-rust/src/api/routes/impls.rs index e3b8360d..63cc3bb2 100644 --- a/signer-service-rust/src/api/routes/impls.rs +++ b/signer-service-rust/src/api/routes/impls.rs @@ -1,136 +1,42 @@ -use axum::Json; use axum::extract::State; +use axum::Json; use serde_json::{json, Value}; use tokio::time::Instant; - -use tracing::{info, warn}; -use wallet::HorizonBalance; -use crate::api::{build_create_account_tx, build_payment_and_merge_tx, requests}; +use tracing::info; use crate::AppState; +use crate::infra::{get_all_tokens, Token, TokensFilter}; -/// Performs POST /v1/stellar/create and requires [`StellarCreateRequestBody`] request body -/// Calls the function [`build_create_account_tx`] -pub(super) async fn create_account( - State(state): State, - Json(payload): Json -) -> Json { - info!("📦{:<6}: {payload:#?}","POST create payload"); +pub(super) async fn tokens(State(state): State,) -> Json { let start = Instant::now(); - - let ephemeral_account_id = match payload.account_id_as_public_key() { - Ok(id) => id, - Err(result) => return result - }; - - let res = build_create_account_tx( + let res = match get_all_tokens( &state.pool, - &state.account, - &ephemeral_account_id, - &payload.asset_code, - payload.max_time - ).await - .unwrap_or_else(|e|{ + TokensFilter::empty() + ).await { + Ok(tokens) => tokens_as_json(tokens), + Err(e) => { Json(json!({ "status": 500, "error": "Server Error", "details": e })) - - }); - - let duration = start.elapsed(); - info!("➡️ {:<6} {duration:?}", "POST create"); - res -} - -/// Performs POST /v1/stellar/payment and requires [`StellarPaymentRequestBody`] request body -/// Calls the function [`build_payment_and_merge_tx`] -pub(super) async fn payment( - State(state): State, - Json(payload): Json -) -> Json { - info!("📦{:<6}: {payload:#?}","POST payment payload"); - - let start = Instant::now(); - - let ephemeral_account_id = match payload.account_id_as_public_key() { - Ok(id) => id, - Err(result) => return result + } }; - - let res = build_payment_and_merge_tx( - &state.pool, - &state.account, - ephemeral_account_id, - payload.sequence, - &payload.asset_code, - payload.max_time, - payload.payment_data, - ).await.unwrap_or_else(|e|{ - Json(json!({ - "status": 500, - "error": "Server Error", - "details": e - })) - - }); - let duration = start.elapsed(); - info!("➡️ {:<6} {duration:?}", "POST payment"); + info!("➡️ {:<6} {duration:?}", "GET tokens"); res } -/// Performs GET /v1/status returns the [`PublicKey`](substrate_stellar_sdk::PublicKey) (in [`String`] format) of the funding account -/// defined in the environment variable `STELLAR_SECRET_KEY` -pub(super) async fn status(State(state): State) -> Json { - let start = Instant::now(); - - let pub_key = state.account.public_key_as_str(); - let res = match state.account.get_balances().await { - Ok(balances) => _get_balance_success(&pub_key, balances), - Err(e) => { - let e = format!("{e:?}"); - Json(json!({ +fn tokens_as_json(tokens:Vec) -> Json { + match serde_json::to_value(tokens) { + Ok(res) => { Json(res) } + Err(e ) => { + let e = e.to_string(); + Json(json!({ "status": 500, "error": "Server Error", "details": e })) - } - }; - - let duration = start.elapsed(); - info!("➡️ {:<6} {duration:?}", "GET status"); - res -} - -#[doc(hidden)] -fn _get_balance_success(public_key_as_str:&str, balances: Vec) -> Json { - let failed_status = Json(json!({ - "status": false, - "public": public_key_as_str - })); - - let Some(native_balance) = balances.iter().find(|bal| { - if let Ok(asset_type) = std::str::from_utf8(&bal.asset_type) { - asset_type == "native" - } else { - false - } - } - ) else { - warn!("⚠️{:<6} - XLM balance of Stellar Public Key {public_key_as_str}\n", "NOT FOUND"); - return failed_status; - }; - - if native_balance.balance < 2.5 { - warn!("⚠️{:<6} - XLM balance of Stellar Public Key {public_key_as_str}\n", "INSUFFICIENT"); - return failed_status; - } - - info!("💰️{:<6} - Stellar Public Key {public_key_as_str} has sufficient XLM balance", "EXIST"); - Json(json!({ - "status": true, - "public": public_key_as_str - })) -} + } + } +} \ No newline at end of file diff --git a/signer-service-rust/src/api/routes/mod.rs b/signer-service-rust/src/api/routes/mod.rs index 23fe5a28..52e566b9 100644 --- a/signer-service-rust/src/api/routes/mod.rs +++ b/signer-service-rust/src/api/routes/mod.rs @@ -1,24 +1,30 @@ /// implementations of the routes +mod stellar_impls; mod impls; use axum::Router; use axum::routing::{get, post}; -use crate::api::routes::impls::{create_account, payment, status}; +use crate::api::routes::impls::tokens; +use crate::api::routes::stellar_impls::{create_account, payment, status}; use crate::AppState; /// Returns /v1/... routes pub fn v1_routes(state:AppState) -> Router { Router::new().nest( "/v1", - status_route(state.clone()) + first_level(state.clone()) .merge(stellar_routes(state)) ) } -/// GET /v1/status -fn status_route(state:AppState) -> Router { - Router::new().route("/status", get(status)) +/// contains the /status and /tokens +fn first_level(state:AppState) -> Router { + Router::new() + /// GET /v1/status + .route("/status", get(status)) + /// GET /v1/tokens + .route("/tokens", get(tokens)) .with_state(state) } @@ -29,5 +35,5 @@ fn stellar_routes(state:AppState) -> Router { .route("/stellar/create", post(create_account)) .route("/stellar/payment", post(payment)) .with_state(state) +} -} \ No newline at end of file diff --git a/signer-service-rust/src/api/routes/stellar_impls.rs b/signer-service-rust/src/api/routes/stellar_impls.rs new file mode 100644 index 00000000..e3b8360d --- /dev/null +++ b/signer-service-rust/src/api/routes/stellar_impls.rs @@ -0,0 +1,136 @@ +use axum::Json; +use axum::extract::State; +use serde_json::{json, Value}; +use tokio::time::Instant; + +use tracing::{info, warn}; +use wallet::HorizonBalance; +use crate::api::{build_create_account_tx, build_payment_and_merge_tx, requests}; +use crate::AppState; + +/// Performs POST /v1/stellar/create and requires [`StellarCreateRequestBody`] request body +/// Calls the function [`build_create_account_tx`] +pub(super) async fn create_account( + State(state): State, + Json(payload): Json +) -> Json { + info!("📦{:<6}: {payload:#?}","POST create payload"); + let start = Instant::now(); + + let ephemeral_account_id = match payload.account_id_as_public_key() { + Ok(id) => id, + Err(result) => return result + }; + + let res = build_create_account_tx( + &state.pool, + &state.account, + &ephemeral_account_id, + &payload.asset_code, + payload.max_time + ).await + .unwrap_or_else(|e|{ + Json(json!({ + "status": 500, + "error": "Server Error", + "details": e + })) + + }); + + let duration = start.elapsed(); + info!("➡️ {:<6} {duration:?}", "POST create"); + res +} + +/// Performs POST /v1/stellar/payment and requires [`StellarPaymentRequestBody`] request body +/// Calls the function [`build_payment_and_merge_tx`] +pub(super) async fn payment( + State(state): State, + Json(payload): Json +) -> Json { + info!("📦{:<6}: {payload:#?}","POST payment payload"); + + let start = Instant::now(); + + let ephemeral_account_id = match payload.account_id_as_public_key() { + Ok(id) => id, + Err(result) => return result + }; + + + let res = build_payment_and_merge_tx( + &state.pool, + &state.account, + ephemeral_account_id, + payload.sequence, + &payload.asset_code, + payload.max_time, + payload.payment_data, + ).await.unwrap_or_else(|e|{ + Json(json!({ + "status": 500, + "error": "Server Error", + "details": e + })) + + }); + + let duration = start.elapsed(); + info!("➡️ {:<6} {duration:?}", "POST payment"); + res +} + +/// Performs GET /v1/status returns the [`PublicKey`](substrate_stellar_sdk::PublicKey) (in [`String`] format) of the funding account +/// defined in the environment variable `STELLAR_SECRET_KEY` +pub(super) async fn status(State(state): State) -> Json { + let start = Instant::now(); + + let pub_key = state.account.public_key_as_str(); + let res = match state.account.get_balances().await { + Ok(balances) => _get_balance_success(&pub_key, balances), + Err(e) => { + let e = format!("{e:?}"); + Json(json!({ + "status": 500, + "error": "Server Error", + "details": e + })) + } + }; + + let duration = start.elapsed(); + info!("➡️ {:<6} {duration:?}", "GET status"); + res +} + +#[doc(hidden)] +fn _get_balance_success(public_key_as_str:&str, balances: Vec) -> Json { + let failed_status = Json(json!({ + "status": false, + "public": public_key_as_str + })); + + let Some(native_balance) = balances.iter().find(|bal| { + if let Ok(asset_type) = std::str::from_utf8(&bal.asset_type) { + asset_type == "native" + } else { + false + } + } + ) else { + warn!("⚠️{:<6} - XLM balance of Stellar Public Key {public_key_as_str}\n", "NOT FOUND"); + return failed_status; + }; + + if native_balance.balance < 2.5 { + warn!("⚠️{:<6} - XLM balance of Stellar Public Key {public_key_as_str}\n", "INSUFFICIENT"); + return failed_status; + } + + info!("💰️{:<6} - Stellar Public Key {public_key_as_str} has sufficient XLM balance", "EXIST"); + Json(json!({ + "status": true, + "public": public_key_as_str + })) +} diff --git a/signer-service-rust/src/infra/models.rs b/signer-service-rust/src/infra/models.rs index d79486ea..a3d3c587 100644 --- a/signer-service-rust/src/infra/models.rs +++ b/signer-service-rust/src/infra/models.rs @@ -72,7 +72,7 @@ impl Token { issuer: self.asset_issuer_as_public_key()? } ) - } else { + } else if self.asset_code.len() <= 12 { let mut asset_code = [0; 12]; asset_code[.._asset_code.len()].copy_from_slice(_asset_code); @@ -82,6 +82,9 @@ impl Token { issuer: self.asset_issuer_as_public_key()?, } ) + } else { + error!("‼️{:<6} - Asset Code {} exceed max characters of 12", "OUT OF RANGE", &self.asset_code); + return Err(Error::EncodingFailed("asset_code".to_string())); } ) } @@ -101,6 +104,16 @@ pub struct TokensFilter { pub vault_account_id: Option, } +impl TokensFilter { + pub fn empty() -> Self { + TokensFilter { + asset_code: None, + asset_issuer: None, + vault_account_id: None, + } + } +} + #[cfg(test)] mod test { use super::*; @@ -162,7 +175,11 @@ mod test { #[test] fn test_asset_issuer_as_public_key() { + let mut token = test_token(); + assert!(token.asset_issuer_as_public_key().is_ok()); + token.asset_issuer = "XXXXXXXXXXXXXXXX".to_string(); + assert!(token.asset_issuer_as_public_key().is_err()); } } From 0beb5c6837423d22ec467641728c5040f5ccec78 Mon Sep 17 00:00:00 2001 From: b-yap <2826165+b-yap@users.noreply.github.com> Date: Tue, 11 Jun 2024 18:21:49 +0800 Subject: [PATCH 10/15] only // instead of /// --- signer-service-rust/Cargo.lock | 4845 +++++++++++++++++++++ signer-service-rust/src/api/routes/mod.rs | 4 +- 2 files changed, 4847 insertions(+), 2 deletions(-) create mode 100644 signer-service-rust/Cargo.lock diff --git a/signer-service-rust/Cargo.lock b/signer-service-rust/Cargo.lock new file mode 100644 index 00000000..3add2367 --- /dev/null +++ b/signer-service-rust/Cargo.lock @@ -0,0 +1,4845 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "addr2line" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +dependencies = [ + "gimli 0.26.2", +] + +[[package]] +name = "addr2line" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +dependencies = [ + "gimli 0.29.0", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +dependencies = [ + "getrandom 0.2.15", + "once_cell", + "version_check", +] + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "getrandom 0.2.15", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anyhow" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" + +[[package]] +name = "array-bytes" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" + +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "async-trait" +version = "0.1.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "axum" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" +dependencies = [ + "async-trait", + "axum-core", + "axum-macros", + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.3.1", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper 1.0.1", + "tokio", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper 0.1.2", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00c055ee2d014ae5981ce1016374e8213682aa14d9bf40e48ab48b5f3ef20eaa" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "backtrace" +version = "0.3.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11" +dependencies = [ + "addr2line 0.22.0", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object 0.35.0", + "rustc-demangle", +] + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base58" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "blake2b_simd" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" +dependencies = [ + "arrayref", + "arrayvec 0.7.4", + "constant_time_eq", +] + +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +dependencies = [ + "block-padding", + "byte-tools", + "byteorder", + "generic-array 0.12.4", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +dependencies = [ + "byte-tools", +] + +[[package]] +name = "bounded-collections" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca548b6163b872067dc5eb82fd130c56881435e30367d2073594a3d9744120dd" +dependencies = [ + "log", + "parity-scale-codec", + "scale-info", + "serde", +] + +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" + +[[package]] +name = "bstringify" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd769563b4ea2953e2825c9e6b7470a5f55f67e0be00030bf3e390a2a6071f64" + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "byte-slice-cast" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" + +[[package]] +name = "cached" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69b0116662497bc24e4b177c90eaf8870e39e2714c3fcfa296327a93f593fc21" +dependencies = [ + "ahash 0.8.11", + "async-trait", + "cached_proc_macro", + "cached_proc_macro_types", + "futures", + "hashbrown 0.14.5", + "instant", + "once_cell", + "thiserror", + "tokio", +] + +[[package]] +name = "cached_proc_macro" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c878c71c2821aa2058722038a59a67583a4240524687c6028571c9b395ded61f" +dependencies = [ + "darling 0.14.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "cached_proc_macro_types" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade8366b8bd5ba243f0a58f036cc0ca8a2f069cff1a2351ef1cac6b083e16fc0" + +[[package]] +name = "cc" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" + +[[package]] +name = "cfg-expr" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aacacf4d96c24b2ad6eb8ee6df040e4f27b0d0b39a5710c30091baa830485db" +dependencies = [ + "smallvec", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "num-traits", + "windows-targets 0.52.5", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "constant_time_eq" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "cpp_demangle" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "cranelift-entity" +version = "0.93.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f42ea692c7b450ad18b8c9889661505d51c09ec4380cf1c2d278dbb2da22cae1" +dependencies = [ + "serde", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array 0.14.7", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array 0.14.7", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array 0.14.7", + "subtle", +] + +[[package]] +name = "crypto-mac" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +dependencies = [ + "generic-array 0.14.7", + "subtle", +] + +[[package]] +name = "curve25519-dalek" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b85542f99a2dfa2a1b8e192662741c9859a846b296bef1c92ef9b58b5a216" +dependencies = [ + "byteorder", + "digest 0.8.1", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "platforms", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core 0.14.4", + "darling_macro 0.14.4", +] + +[[package]] +name = "darling" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" +dependencies = [ + "darling_core 0.20.9", + "darling_macro 0.20.9", +] + +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.10.0", + "syn 1.0.109", +] + +[[package]] +name = "darling_core" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.11.1", + "syn 2.0.66", +] + +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core 0.14.4", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" +dependencies = [ + "darling_core 0.20.9", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "deadpool" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6541a3916932fe57768d4be0b1ffb5ec7cbf74ca8c903fdfd5c0fe8aa958f0ed" +dependencies = [ + "deadpool-runtime", + "num_cpus", + "tokio", +] + +[[package]] +name = "deadpool-diesel" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "590573e9e29c5190a5ff782136f871e6e652e35d598a349888e028693601adf1" +dependencies = [ + "deadpool", + "deadpool-sync", + "diesel", +] + +[[package]] +name = "deadpool-runtime" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "092966b41edc516079bdf31ec78a2e0588d1d0c08f78b91d8307215928642b2b" +dependencies = [ + "tokio", +] + +[[package]] +name = "deadpool-sync" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524bc3df0d57e98ecd022e21ba31166c2625e7d3e5bcc4510efaeeab4abcab04" +dependencies = [ + "deadpool-runtime", +] + +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "derive-syn-parse" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "diesel" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35b696af9ff4c0d2a507db2c5faafa8aa0205e297e5f11e203a24226d5355e7a" +dependencies = [ + "bitflags 2.5.0", + "byteorder", + "diesel_derives", + "itoa", + "pq-sys", + "serde_json", + "uuid", +] + +[[package]] +name = "diesel_derives" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6fdd83d5947068817016e939596d246e5367279453f2a3433287894f2f2996" +dependencies = [ + "diesel_table_macro_syntax", + "dsl_auto_type", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "diesel_migrations" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a73ce704bad4231f001bff3314d91dce4aba0770cee8b233991859abc15c1f6" +dependencies = [ + "diesel", + "migrations_internals", + "migrations_macros", +] + +[[package]] +name = "diesel_table_macro_syntax" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "209c735641a413bc68c4923a9d6ad4bcb3ca306b794edaa7eb0b3228a99ffb25" +dependencies = [ + "syn 2.0.66", +] + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array 0.12.4", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "dotenv" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" + +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + +[[package]] +name = "dsl_auto_type" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab32c18ea6760d951659768a3e35ea72fc1ba0916d665a88dfe048b2a41e543f" +dependencies = [ + "darling 0.20.9", + "either", + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "dyn-clonable" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e9232f0e607a262ceb9bd5141a3dfb3e4db6994b31989bbfd845878cba59fd4" +dependencies = [ + "dyn-clonable-impl", + "dyn-clone", +] + +[[package]] +name = "dyn-clonable-impl" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "dyn-clone" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest 0.10.7", + "elliptic-curve", + "rfc6979", + "signature 2.2.0", + "spki", +] + +[[package]] +name = "ed25519" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +dependencies = [ + "signature 1.6.4", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek 3.2.0", + "ed25519", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "ed25519-zebra" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" +dependencies = [ + "curve25519-dalek 3.2.0", + "hashbrown 0.12.3", + "hex", + "rand_core 0.6.4", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "either" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest 0.10.7", + "ff", + "generic-array 0.14.7", + "group", + "pkcs8", + "rand_core 0.6.4", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "encoding_rs" +version = "0.8.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "environmental" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "expander" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f360349150728553f92e4c997a16af8915f418d3a0f21b440d34c5632f16ed84" +dependencies = [ + "blake2", + "fs-err", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fastrand" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "fixed-hash" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +dependencies = [ + "byteorder", + "rand 0.8.5", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "frame-metadata" +version = "15.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "878babb0b136e731cc77ec2fd883ff02745ff21e6fb662729953d44923df009c" +dependencies = [ + "cfg-if", + "parity-scale-codec", + "scale-info", + "serde", +] + +[[package]] +name = "frame-support" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "bitflags 1.3.2", + "environmental", + "frame-metadata", + "frame-support-procedural", + "impl-trait-for-tuples", + "k256", + "log", + "once_cell", + "parity-scale-codec", + "paste", + "scale-info", + "serde", + "smallvec", + "sp-api", + "sp-arithmetic", + "sp-core", + "sp-core-hashing-proc-macro", + "sp-inherents", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-state-machine", + "sp-std", + "sp-tracing", + "sp-weights", + "tt-call", +] + +[[package]] +name = "frame-support-procedural" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "Inflector", + "cfg-expr", + "derive-syn-parse", + "frame-support-procedural-tools", + "itertools", + "proc-macro-warning", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "frame-support-procedural-tools" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "frame-support-procedural-tools-derive", + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "frame-support-procedural-tools-derive" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "fs-err" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", + "num_cpus", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom_or_panic" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "gimli" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +dependencies = [ + "fallible-iterator", + "stable_deref_trait", +] + +[[package]] +name = "gimli" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.12", + "indexmap 2.2.6", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hash-db" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e7d7786361d7425ae2fe4f9e407eb0efaa0840f5212d109cc018c40c35c6ab4" + +[[package]] +name = "hash256-std-hasher" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" +dependencies = [ + "crunchy", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.8", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.11", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash 0.8.11", + "allocator-api2", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac 0.8.0", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +dependencies = [ + "crypto-mac 0.11.1", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array 0.14.7", + "hmac 0.8.1", +] + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http 0.2.12", + "pin-project-lite", +] + +[[package]] +name = "http-body" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +dependencies = [ + "bytes", + "http 1.1.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +dependencies = [ + "bytes", + "futures-core", + "http 1.1.0", + "http-body 1.0.0", + "pin-project-lite", +] + +[[package]] +name = "http-range-header" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08a397c49fec283e3d6211adbe480be95aae5f304cfb923e9970e08956d5168a" + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "0.14.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http 0.2.12", + "http-body 0.4.6", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper 0.14.29", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "hyper-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" +dependencies = [ + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "hyper 1.3.1", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-serde" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" +dependencies = [ + "serde", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "index-fixed" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161ceaf2f41b6cd3f6502f5da085d4ad4393a51e0c70ed2fce1d5698d798fae" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +dependencies = [ + "equivalent", + "hashbrown 0.14.5", +] + +[[package]] +name = "instant" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "integer-sqrt" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" +dependencies = [ + "num-traits", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "js-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "k256" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "once_cell", + "sha2 0.10.8", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin", +] + +[[package]] +name = "libc" +version = "0.2.155" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "libsecp256k1" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" +dependencies = [ + "arrayref", + "base64 0.13.1", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.8.5", + "serde", + "sha2 0.9.9", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "mach" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +dependencies = [ + "libc", +] + +[[package]] +name = "matchers" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "memfd" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" +dependencies = [ + "rustix 0.38.34", +] + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memory-db" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" +dependencies = [ + "hash-db", +] + +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + +[[package]] +name = "merlin" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e261cf0f8b3c42ded9f7d2bb59dea03aa52bc8a1cbc7482f9fc3fd1229d3b42" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.5.1", + "zeroize", +] + +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.6.4", + "zeroize", +] + +[[package]] +name = "migrations_internals" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd01039851e82f8799046eabbb354056283fb265c8ec0996af940f4e85a380ff" +dependencies = [ + "serde", + "toml", +] + +[[package]] +name = "migrations_macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb161cc72176cb37aa47f1fc520d3ef02263d67d661f44f05d05a079e1237fd" +dependencies = [ + "migrations_internals", + "proc-macro2", + "quote", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "miniz_oxide" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.48.0", +] + +[[package]] +name = "native-tls" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-bigint" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-format" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +dependencies = [ + "arrayvec 0.7.4", + "itoa", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "object" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +dependencies = [ + "crc32fast", + "hashbrown 0.12.3", + "indexmap 1.9.3", + "memchr", +] + +[[package]] +name = "object" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "openssl" +version = "0.10.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +dependencies = [ + "bitflags 2.5.0", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "parity-scale-codec" +version = "3.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" +dependencies = [ + "arrayvec 0.7.4", + "bitvec", + "byte-slice-cast", + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" +dependencies = [ + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "parity-wasm" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.5", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pbkdf2" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" +dependencies = [ + "crypto-mac 0.11.1", +] + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "platforms" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "pq-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5576e3fa8738e1a71285f7211ff83458514aa4864aa34c2bdb422445448d4c4b" +dependencies = [ + "vcpkg", +] + +[[package]] +name = "primitive-types" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +dependencies = [ + "fixed-hash", + "impl-codec", + "impl-serde", + "scale-info", + "uint", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit 0.21.1", +] + +[[package]] +name = "proc-macro-warning" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e99670bafb56b9a106419397343bdbc8b8742c3cc449fec6345f86173f47cd4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "proc-macro2" +version = "1.0.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "psm" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +dependencies = [ + "cc", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.15", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "redox_syscall" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] + +[[package]] +name = "ref-cast" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "regex" +version = "1.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.3", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" + +[[package]] +name = "reqwest" +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "base64 0.21.7", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.29", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 0.1.2", + "system-configuration", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac 0.12.1", + "subtle", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.36.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.1.4", + "windows-sys 0.45.0", +] + +[[package]] +name = "rustix" +version = "0.38.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys 0.4.14", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "scale-info" +version = "2.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" +dependencies = [ + "bitvec", + "cfg-if", + "derive_more", + "parity-scale-codec", + "scale-info-derive", + "serde", +] + +[[package]] +name = "scale-info-derive" +version = "2.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" +dependencies = [ + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "schannel" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "schnellru" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9a8ef13a93c54d20580de1e5c413e624e53121d42fc7e2c11d10ef7f8b02367" +dependencies = [ + "ahash 0.8.11", + "cfg-if", + "hashbrown 0.13.2", +] + +[[package]] +name = "schnorrkel" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "curve25519-dalek 2.1.3", + "getrandom 0.1.16", + "merlin 2.0.1", + "rand 0.7.3", + "rand_core 0.5.1", + "sha2 0.8.2", + "subtle", + "zeroize", +] + +[[package]] +name = "schnorrkel" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de18f6d8ba0aad7045f5feae07ec29899c1112584a38509a84ad7b04451eaa0" +dependencies = [ + "arrayref", + "arrayvec 0.7.4", + "curve25519-dalek 4.1.2", + "getrandom_or_panic", + "merlin 3.0.0", + "rand_core 0.6.4", + "sha2 0.10.8", + "subtle", + "zeroize", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array 0.14.7", + "pkcs8", + "subtle", + "zeroize", +] + +[[package]] +name = "secp256k1" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" +dependencies = [ + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" +dependencies = [ + "cc", +] + +[[package]] +name = "secrecy" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "zeroize", +] + +[[package]] +name = "security-framework" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" +dependencies = [ + "bitflags 2.5.0", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.203" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.203" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "serde_json" +version = "1.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" +dependencies = [ + "itoa", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" +dependencies = [ + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug 0.2.3", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.1", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest 0.10.7", + "rand_core 0.6.4", +] + +[[package]] +name = "signer-service-rust" +version = "0.1.0" +dependencies = [ + "anyhow", + "axum", + "deadpool-diesel", + "diesel", + "diesel_migrations", + "dotenvy", + "hex", + "serde", + "serde_json", + "substrate-stellar-sdk", + "tokio", + "tower-http", + "tracing", + "tracing-subscriber 0.3.18", + "wallet", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "socket2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "sodalite" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41784a359d15c58bba298cccb7f30a847a1a42d0620c9bdaa0aa42fdb3c280e0" +dependencies = [ + "index-fixed", +] + +[[package]] +name = "sp-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", + "scale-info", + "sp-api-proc-macro", + "sp-core", + "sp-metadata-ir", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-trie", + "sp-version", + "thiserror", +] + +[[package]] +name = "sp-api-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "Inflector", + "blake2", + "expander", + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "sp-application-crypto" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-std", +] + +[[package]] +name = "sp-arithmetic" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "integer-sqrt", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "sp-std", + "static_assertions", +] + +[[package]] +name = "sp-core" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "array-bytes", + "bitflags 1.3.2", + "blake2", + "bounded-collections", + "bs58", + "dyn-clonable", + "ed25519-zebra", + "futures", + "hash-db", + "hash256-std-hasher", + "impl-serde", + "lazy_static", + "libsecp256k1", + "log", + "merlin 2.0.1", + "parity-scale-codec", + "parking_lot", + "paste", + "primitive-types", + "rand 0.8.5", + "regex", + "scale-info", + "schnorrkel 0.9.1", + "secp256k1", + "secrecy", + "serde", + "sp-core-hashing", + "sp-debug-derive", + "sp-externalities", + "sp-runtime-interface", + "sp-std", + "sp-storage", + "ss58-registry", + "substrate-bip39", + "thiserror", + "tiny-bip39", + "zeroize", +] + +[[package]] +name = "sp-core-hashing" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "blake2b_simd", + "byteorder", + "digest 0.10.7", + "sha2 0.10.8", + "sha3", + "sp-std", + "twox-hash", +] + +[[package]] +name = "sp-core-hashing-proc-macro" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "proc-macro2", + "quote", + "sp-core-hashing", + "syn 2.0.66", +] + +[[package]] +name = "sp-debug-derive" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "sp-externalities" +version = "0.13.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-std", + "sp-storage", +] + +[[package]] +name = "sp-inherents" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "async-trait", + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", + "thiserror", +] + +[[package]] +name = "sp-io" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "bytes", + "ed25519", + "ed25519-dalek", + "futures", + "libsecp256k1", + "log", + "parity-scale-codec", + "rustversion", + "secp256k1", + "sp-core", + "sp-externalities", + "sp-keystore", + "sp-runtime-interface", + "sp-state-machine", + "sp-std", + "sp-tracing", + "sp-trie", + "tracing", + "tracing-core", +] + +[[package]] +name = "sp-keystore" +version = "0.13.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "futures", + "parity-scale-codec", + "parking_lot", + "sp-core", + "sp-externalities", + "thiserror", +] + +[[package]] +name = "sp-metadata-ir" +version = "0.1.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "frame-metadata", + "parity-scale-codec", + "scale-info", + "sp-std", +] + +[[package]] +name = "sp-panic-handler" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "backtrace", + "lazy_static", + "regex", +] + +[[package]] +name = "sp-runtime" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "either", + "hash256-std-hasher", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "paste", + "rand 0.8.5", + "scale-info", + "serde", + "sp-application-crypto", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-std", + "sp-weights", +] + +[[package]] +name = "sp-runtime-interface" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec", + "primitive-types", + "sp-externalities", + "sp-runtime-interface-proc-macro", + "sp-std", + "sp-storage", + "sp-tracing", + "sp-wasm-interface", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "Inflector", + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "sp-staking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "sp-state-machine" +version = "0.13.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", + "parking_lot", + "rand 0.8.5", + "smallvec", + "sp-core", + "sp-externalities", + "sp-panic-handler", + "sp-std", + "sp-trie", + "thiserror", + "tracing", +] + +[[package]] +name = "sp-std" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" + +[[package]] +name = "sp-storage" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive", + "sp-std", +] + +[[package]] +name = "sp-tracing" +version = "6.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "parity-scale-codec", + "sp-std", + "tracing", + "tracing-core", + "tracing-subscriber 0.2.25", +] + +[[package]] +name = "sp-trie" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "ahash 0.8.11", + "hash-db", + "hashbrown 0.13.2", + "lazy_static", + "memory-db", + "nohash-hasher", + "parity-scale-codec", + "parking_lot", + "scale-info", + "schnellru", + "sp-core", + "sp-std", + "thiserror", + "tracing", + "trie-db", + "trie-root", +] + +[[package]] +name = "sp-version" +version = "5.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "parity-wasm", + "scale-info", + "serde", + "sp-core-hashing-proc-macro", + "sp-runtime", + "sp-std", + "sp-version-proc-macro", + "thiserror", +] + +[[package]] +name = "sp-version-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "parity-scale-codec", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "sp-wasm-interface" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "anyhow", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "sp-std", + "wasmi", + "wasmtime", +] + +[[package]] +name = "sp-weights" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "smallvec", + "sp-arithmetic", + "sp-core", + "sp-debug-derive", + "sp-std", +] + +[[package]] +name = "spacewalk-primitives" +version = "1.0.7" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=e7a672ba1e21c98a70df30a6ee458317951dd597#e7a672ba1e21c98a70df30a6ee458317951dd597" +dependencies = [ + "base58", + "bstringify", + "frame-support", + "hex", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-std", + "substrate-stellar-sdk", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "ss58-registry" +version = "1.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4743ce898933fbff7bbf414f497c459a782d496269644b3d650a398ae6a487ba" +dependencies = [ + "Inflector", + "num-format", + "proc-macro2", + "quote", + "serde", + "serde_json", + "unicode-xid", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "substrate-bip39" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a7590dc041b9bc2825e52ce5af8416c73dbe9d0654402bfd4b4941938b94d8f" +dependencies = [ + "hmac 0.11.0", + "pbkdf2 0.8.0", + "schnorrkel 0.11.4", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "substrate-stellar-sdk" +version = "0.2.4" +source = "git+https://github.com/pendulum-chain/substrate-stellar-sdk?branch=polkadot-v0.9.42#752c0fa27ffd244fc26fbf2e6988eedcba2cd497" +dependencies = [ + "base64 0.13.1", + "hex", + "lazy_static", + "num-rational", + "scale-info", + "serde", + "serde_json", + "sha2 0.9.9", + "sodalite", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "target-lexicon" +version = "0.12.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" + +[[package]] +name = "tempfile" +version = "3.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +dependencies = [ + "cfg-if", + "fastrand", + "rustix 0.38.34", + "windows-sys 0.52.0", +] + +[[package]] +name = "thiserror" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "tiny-bip39" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62cc94d358b5a1e84a5cb9109f559aa3c4d634d2b1b4de3d0fa4adc7c78e2861" +dependencies = [ + "anyhow", + "hmac 0.12.1", + "once_cell", + "pbkdf2 0.11.0", + "rand 0.8.5", + "rustc-hash", + "sha2 0.10.8", + "thiserror", + "unicode-normalization", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "tokio-metrics" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcb585a0069b53171684e22d5255984ec30d1c7304fd0a4a9a603ffd8c765cdd" +dependencies = [ + "futures-util", + "pin-project-lite", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", + "tokio-util", +] + +[[package]] +name = "tokio-util" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.22.14", +] + +[[package]] +name = "toml_datetime" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.2.6", + "toml_datetime", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap 2.2.6", + "toml_datetime", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.22.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" +dependencies = [ + "indexmap 2.2.6", + "serde", + "serde_spanned", + "toml_datetime", + "winnow 0.6.11", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" +dependencies = [ + "bitflags 2.5.0", + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "http-range-header", + "httpdate", + "mime", + "mime_guess", + "percent-encoding", + "pin-project-lite", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + +[[package]] +name = "tracing-log" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-serde" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +dependencies = [ + "serde", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +dependencies = [ + "ansi_term", + "chrono", + "lazy_static", + "matchers 0.0.1", + "regex", + "serde", + "serde_json", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log 0.1.4", + "tracing-serde", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers 0.1.0", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log 0.2.0", +] + +[[package]] +name = "trie-db" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "767abe6ffed88a1889671a102c2861ae742726f52e0a5a425b92c9fbfa7e9c85" +dependencies = [ + "hash-db", + "hashbrown 0.13.2", + "log", + "rustc-hex", + "smallvec", +] + +[[package]] +name = "trie-root" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4ed310ef5ab98f5fa467900ed906cb9232dd5376597e00fd4cba2a449d06c0b" +dependencies = [ + "hash-db", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "tt-call" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f195fd851901624eee5a58c4bb2b4f06399148fcd0ed336e6f1cb60a9881df" + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "digest 0.10.7", + "rand 0.8.5", + "static_assertions", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "uuid" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wallet" +version = "1.0.7" +source = "git+https://github.com/pendulum-chain/spacewalk?rev=e7a672ba1e21c98a70df30a6ee458317951dd597#e7a672ba1e21c98a70df30a6ee458317951dd597" +dependencies = [ + "async-trait", + "cached", + "dotenv", + "futures", + "parity-scale-codec", + "rand 0.8.5", + "reqwest", + "serde", + "serde_json", + "spacewalk-primitives", + "thiserror", + "tokio", + "tokio-metrics", + "tokio-stream", + "tracing", + "tracing-futures", + "tracing-subscriber 0.2.25", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.66", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" + +[[package]] +name = "wasmi" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06c326c93fbf86419608361a2c925a31754cf109da1b8b55737070b4d6669422" +dependencies = [ + "parity-wasm", + "wasmi-validation", + "wasmi_core", +] + +[[package]] +name = "wasmi-validation" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ff416ad1ff0c42e5a926ed5d5fab74c0f098749aa0ad8b2a34b982ce0e867b" +dependencies = [ + "parity-wasm", +] + +[[package]] +name = "wasmi_core" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d20cb3c59b788653d99541c646c561c9dd26506f25c0cebfe810659c54c6d7" +dependencies = [ + "downcast-rs", + "libm", + "memory_units", + "num-rational", + "num-traits", +] + +[[package]] +name = "wasmparser" +version = "0.100.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64b20236ab624147dfbb62cf12a19aaf66af0e41b8398838b66e997d07d269d4" +dependencies = [ + "indexmap 1.9.3", + "url", +] + +[[package]] +name = "wasmtime" +version = "6.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a222f5fa1e14b2cefc286f1b68494d7a965f4bf57ec04c59bb62673d639af6" +dependencies = [ + "anyhow", + "bincode", + "cfg-if", + "indexmap 1.9.3", + "libc", + "log", + "object 0.29.0", + "once_cell", + "paste", + "psm", + "serde", + "target-lexicon", + "wasmparser", + "wasmtime-environ", + "wasmtime-jit", + "wasmtime-runtime", + "windows-sys 0.42.0", +] + +[[package]] +name = "wasmtime-asm-macros" +version = "6.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4407a7246e7d2f3d8fb1cf0c72fda8dbafdb6dd34d555ae8bea0e5ae031089cc" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "wasmtime-environ" +version = "6.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b8b50962eae38ee319f7b24900b7cf371f03eebdc17400c1dc8575fc10c9a7" +dependencies = [ + "anyhow", + "cranelift-entity", + "gimli 0.26.2", + "indexmap 1.9.3", + "log", + "object 0.29.0", + "serde", + "target-lexicon", + "thiserror", + "wasmparser", + "wasmtime-types", +] + +[[package]] +name = "wasmtime-jit" +version = "6.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffaed4f9a234ba5225d8e64eac7b4a5d13b994aeb37353cde2cbeb3febda9eaa" +dependencies = [ + "addr2line 0.17.0", + "anyhow", + "bincode", + "cfg-if", + "cpp_demangle", + "gimli 0.26.2", + "log", + "object 0.29.0", + "rustc-demangle", + "serde", + "target-lexicon", + "wasmtime-environ", + "wasmtime-jit-icache-coherence", + "wasmtime-runtime", + "windows-sys 0.42.0", +] + +[[package]] +name = "wasmtime-jit-debug" +version = "6.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eed41cbcbf74ce3ff6f1d07d1b707888166dc408d1a880f651268f4f7c9194b2" +dependencies = [ + "once_cell", +] + +[[package]] +name = "wasmtime-jit-icache-coherence" +version = "6.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a28ae1e648461bfdbb79db3efdaee1bca5b940872e4175390f465593a2e54c" +dependencies = [ + "cfg-if", + "libc", + "windows-sys 0.42.0", +] + +[[package]] +name = "wasmtime-runtime" +version = "6.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e704b126e4252788ccfc3526d4d4511d4b23c521bf123e447ac726c14545217b" +dependencies = [ + "anyhow", + "cc", + "cfg-if", + "indexmap 1.9.3", + "libc", + "log", + "mach", + "memfd", + "memoffset", + "paste", + "rand 0.8.5", + "rustix 0.36.17", + "wasmtime-asm-macros", + "wasmtime-environ", + "wasmtime-jit-debug", + "windows-sys 0.42.0", +] + +[[package]] +name = "wasmtime-types" +version = "6.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83e5572c5727c1ee7e8f28717aaa8400e4d22dcbd714ea5457d85b5005206568" +dependencies = [ + "cranelift-entity", + "serde", + "thiserror", + "wasmparser", +] + +[[package]] +name = "web-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +dependencies = [ + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" + +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c52728401e1dc672a56e81e593e912aa54c78f40246869f78359a2bf24d29d" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "zerocopy" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] diff --git a/signer-service-rust/src/api/routes/mod.rs b/signer-service-rust/src/api/routes/mod.rs index 52e566b9..47fca196 100644 --- a/signer-service-rust/src/api/routes/mod.rs +++ b/signer-service-rust/src/api/routes/mod.rs @@ -21,9 +21,9 @@ pub fn v1_routes(state:AppState) -> Router { /// contains the /status and /tokens fn first_level(state:AppState) -> Router { Router::new() - /// GET /v1/status + // GET /v1/status .route("/status", get(status)) - /// GET /v1/tokens + // GET /v1/tokens .route("/tokens", get(tokens)) .with_state(state) } From 3a2daabc675766a015b28050a407fd3fc20e6a6a Mon Sep 17 00:00:00 2001 From: b-yap <2826165+b-yap@users.noreply.github.com> Date: Tue, 11 Jun 2024 18:28:50 +0800 Subject: [PATCH 11/15] update readme to explain what framework is used. --- signer-service-rust/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/signer-service-rust/README.md b/signer-service-rust/README.md index 997abc4c..acdf0b36 100644 --- a/signer-service-rust/README.md +++ b/signer-service-rust/README.md @@ -1,5 +1,5 @@ ## Signer Service in `Rust` -This contains a list of apis equivalent to [signer-service](../signer-service). +This is a rust version of [signer-service](../signer-service), using [axum](https://github.com/tokio-rs/axum) and [diesel](https://github.com/diesel-rs/diesel). Tokens are stored/retrieved in postgres. ## How to Run From ec53a35f9f50f35601e6ecb014e826fbe5e562c0 Mon Sep 17 00:00:00 2001 From: b-yap <2826165+b-yap@users.noreply.github.com> Date: Mon, 17 Jun 2024 23:11:15 +0800 Subject: [PATCH 12/15] https://github.com/pendulum-chain/pendulum-pay/pull/37#pullrequestreview-2118315808, https://github.com/pendulum-chain/pendulum-pay/pull/37#discussion_r1639786073, https://github.com/pendulum-chain/pendulum-pay/pull/37#discussion_r1639790472, https://github.com/pendulum-chain/pendulum-pay/pull/37#discussion_r1639790472, https://github.com/pendulum-chain/pendulum-pay/pull/37#discussion_r1639793028 --- signer-service-rust/Cargo.lock | 7 ++++ signer-service-rust/Cargo.toml | 1 + signer-service-rust/README.md | 5 ++- .../src/api/routes/stellar_impls.rs | 4 ++- signer-service-rust/src/api/sep24Result.rs | 32 +++++++++++-------- 5 files changed, 33 insertions(+), 16 deletions(-) diff --git a/signer-service-rust/Cargo.lock b/signer-service-rust/Cargo.lock index 3add2367..d53a189e 100644 --- a/signer-service-rust/Cargo.lock +++ b/signer-service-rust/Cargo.lock @@ -253,6 +253,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "base64ct" version = "1.6.0" @@ -3062,6 +3068,7 @@ version = "0.1.0" dependencies = [ "anyhow", "axum", + "base64 0.22.1", "deadpool-diesel", "diesel", "diesel_migrations", diff --git a/signer-service-rust/Cargo.toml b/signer-service-rust/Cargo.toml index a63733ab..fba10dcf 100644 --- a/signer-service-rust/Cargo.toml +++ b/signer-service-rust/Cargo.toml @@ -7,6 +7,7 @@ edition = "2021" [dependencies] axum = { version = "0.7.5", features = ["macros"] } +base64 = "0.22.0" # for memo hash deadpool-diesel = { version = "0.6.1", features = ["postgres"] } diesel = { version = "2.2", features = ["postgres", "serde_json", "uuid"]} diff --git a/signer-service-rust/README.md b/signer-service-rust/README.md index acdf0b36..69e28fd9 100644 --- a/signer-service-rust/README.md +++ b/signer-service-rust/README.md @@ -8,7 +8,10 @@ Tokens are stored/retrieved in postgres. See [example](.env.example) ### Prepare Postgres DB -[Postgres docker](https://hub.docker.com/_/postgres) can be used: +Install [Postgres](https://www.postgresql.org/download/) in your platform and make sure it is running. +It can run in [linux](https://www.postgresqltutorial.com/postgresql-getting-started/install-postgresql-linux/), [macOS](https://www.postgresqltutorial.com/postgresql-getting-started/install-postgresql-macos/), [windows](https://www.postgresqltutorial.com/postgresql-getting-started/install-postgresql/). + +[Postgres docker](https://hub.docker.com/_/postgres) can also be used: ```script docker run --name -e POSTGRES_USER= -e POSTGRES_PASSWORD= -d -p : postgres ``` diff --git a/signer-service-rust/src/api/routes/stellar_impls.rs b/signer-service-rust/src/api/routes/stellar_impls.rs index e3b8360d..9ea0423c 100644 --- a/signer-service-rust/src/api/routes/stellar_impls.rs +++ b/signer-service-rust/src/api/routes/stellar_impls.rs @@ -8,6 +8,8 @@ use wallet::HorizonBalance; use crate::api::{build_create_account_tx, build_payment_and_merge_tx, requests}; use crate::AppState; +const XLM_BALANCE_MINIMUM_MARGIN: f64 = 2.5; + /// Performs POST /v1/stellar/create and requires [`StellarCreateRequestBody`] request body /// Calls the function [`build_create_account_tx`] pub(super) async fn create_account( @@ -123,7 +125,7 @@ fn _get_balance_success(public_key_as_str:&str, balances: Vec) - return failed_status; }; - if native_balance.balance < 2.5 { + if native_balance.balance < XLM_BALANCE_MINIMUM_MARGIN { warn!("⚠️{:<6} - XLM balance of Stellar Public Key {public_key_as_str}\n", "INSUFFICIENT"); return failed_status; } diff --git a/signer-service-rust/src/api/sep24Result.rs b/signer-service-rust/src/api/sep24Result.rs index 3176c71e..e5be8756 100644 --- a/signer-service-rust/src/api/sep24Result.rs +++ b/signer-service-rust/src/api/sep24Result.rs @@ -1,7 +1,8 @@ use std::fmt::Debug; +use base64::Engine; +use base64::engine::general_purpose; use serde::{Deserialize, Serialize}; -use substrate_stellar_sdk::{Memo, PublicKey}; -use substrate_stellar_sdk::compound_types::LimitedString; +use substrate_stellar_sdk::{Hash, Memo, PublicKey}; use tracing::error; use crate::api::Error; @@ -23,20 +24,23 @@ impl Sep24Result { match memo_type.as_str() { "1" | "text" | "memotext" => { - let memo = self.memo.clone().into_bytes(); - Ok(Memo::MemoText( - LimitedString::new(memo) - .map_err(|e| { - error!("‼️{:<6} - Convert memo to type Memo: {e:?}", "FAILED"); - Error::InvalidMemo - })? - )) + Memo::from_text_memo(self.memo.clone()).map_err(|e| { + error!("‼️{:<6} - Invalid offramp text memo: {e:?}", "FAILED"); + Error::InvalidMemo + } ) } "3" | "hash" | "memohash" => { - let _memo = self.memo.as_bytes(); - let mut memo = [0;32]; - memo[.._memo.len()].copy_from_slice(_memo); - Ok(Memo::MemoHash(memo)) + // base64 decode + let bytes = general_purpose::STANDARD + .decode(self.memo.as_bytes()).map_err(|e| { + error!("‼️{:<6} - Invalid offramp hash memo: {e:?}", "FAILED"); + Error::InvalidMemo + })?; + + Memo::from_hash_memo::(bytes.try_into().unwrap()).map_err(|e| { + error!("‼️{:<6} - Invalid offramp hash memo: {e:?}", "FAILED"); + Error::InvalidMemo + }) } _ => { error!("‼️{:<6} - Unsupported offramp memo type: {:?}", "FAILED", self.memo_type); From 8fd04ebb55b2d43f23ff35667cbda8e8b3b0b726 Mon Sep 17 00:00:00 2001 From: b-yap <2826165+b-yap@users.noreply.github.com> Date: Mon, 17 Jun 2024 23:45:59 +0800 Subject: [PATCH 13/15] add test case for memos and update memohash --- signer-service-rust/src/api/sep24Result.rs | 63 +++++++++++++++++++++- 1 file changed, 61 insertions(+), 2 deletions(-) diff --git a/signer-service-rust/src/api/sep24Result.rs b/signer-service-rust/src/api/sep24Result.rs index e5be8756..c8e8fc83 100644 --- a/signer-service-rust/src/api/sep24Result.rs +++ b/signer-service-rust/src/api/sep24Result.rs @@ -37,10 +37,12 @@ impl Sep24Result { Error::InvalidMemo })?; - Memo::from_hash_memo::(bytes.try_into().unwrap()).map_err(|e| { + let bytes: Hash = bytes.try_into().map_err(|e| { error!("‼️{:<6} - Invalid offramp hash memo: {e:?}", "FAILED"); Error::InvalidMemo - }) + })?; + + Ok(Memo::MemoHash(bytes)) } _ => { error!("‼️{:<6} - Unsupported offramp memo type: {:?}", "FAILED", self.memo_type); @@ -56,4 +58,61 @@ impl Sep24Result { Error::EncodingFailed("offramping account".to_string()) }) } +} + +#[cfg(test)] +mod test { + use base64::Engine; + use substrate_stellar_sdk::Memo; + use crate::api::Sep24Result; + use base64::engine::general_purpose; + + fn test_sep24Result() -> Sep24Result { + Sep24Result { + amount: "1000000".to_string(), + memo: "grJMNS9wmxB3ezp9qATcThV2Ov3LT7IShivbc9ZjLV4=".to_string(), + memo_type: "hash".to_string(), + offramping_account: "GDNVZLQ4TWVESLVNRWMMH3K6XILRZISHYMOIMGOSYQNRHPXPALX73OM2".to_string(), + } + } + + #[test] + fn test_memo() { + let mut sep24 = test_sep24Result(); + + // --------------------- test hash memo --------------------- + match sep24.memo().expect("should return a hash memo") { + Memo::MemoHash(hash) => assert_eq!( + general_purpose::STANDARD.encode(&hash), + sep24.memo + ), + _ => assert!(false) + } + + sep24.memo = "82b24c352f709b10777b3a7da804dc4e15763afdcb4fb212862bdb73d6632d5e".to_string(); + assert!(sep24.memo().is_err()); + + // --------------------- test text memo --------------------- + sep24.memo_type = "text".to_string(); + // exceeded max characters of 28 + assert!(sep24.memo().is_err()); + + sep24.memo = "testing".to_string(); + match sep24.memo().expect("should return a text memo") { + Memo::MemoText(text) => assert_eq!( + std::str::from_utf8(text.get_vec()).expect("should return ok").to_string(), + sep24.memo + ), + _ => assert!(false) + } + + // --------------------- test non hash or text memo --------------------- + sep24.memo_type = "id".to_string(); + assert!(sep24.memo().is_err()); + + sep24.memo = "".to_string(); + assert!(sep24.memo().is_err()); + } + + } \ No newline at end of file From c58b03f288c7f037f6d1ea9786c4a19f1f4c19fd Mon Sep 17 00:00:00 2001 From: b-yap <2826165+b-yap@users.noreply.github.com> Date: Tue, 18 Jun 2024 15:56:47 +0800 Subject: [PATCH 14/15] https://github.com/pendulum-chain/pendulum-pay/pull/37#pullrequestreview-2123169683, https://github.com/pendulum-chain/pendulum-pay/pull/37#discussion_r1642968456, https://github.com/pendulum-chain/pendulum-pay/pull/37#discussion_r1642983943, https://github.com/pendulum-chain/pendulum-pay/pull/37#discussion_r1642989067, https://github.com/pendulum-chain/pendulum-pay/pull/37#discussion_r1642990053 --- signer-service-rust/README.md | 28 ------ .../src/api/horizon/create_account_tx.rs | 15 ++- signer-service-rust/src/api/horizon/helper.rs | 13 +-- .../src/api/horizon/payment_and_merge_tx.rs | 8 +- signer-service-rust/src/api/mod.rs | 18 ++-- signer-service-rust/src/api/routes/impls.rs | 42 -------- signer-service-rust/src/api/routes/mod.rs | 14 +-- .../src/api/routes/stellar_impls.rs | 2 - signer-service-rust/src/api/token.rs | 97 +++++++++++++++++++ signer-service-rust/src/config/account.rs | 8 +- signer-service-rust/src/config/database.rs | 16 +-- signer-service-rust/src/config/server.rs | 8 +- signer-service-rust/src/infra/mod.rs | 38 ++------ signer-service-rust/src/main.rs | 14 ++- 14 files changed, 153 insertions(+), 168 deletions(-) delete mode 100644 signer-service-rust/src/api/routes/impls.rs create mode 100644 signer-service-rust/src/api/token.rs diff --git a/signer-service-rust/README.md b/signer-service-rust/README.md index 69e28fd9..8c90487a 100644 --- a/signer-service-rust/README.md +++ b/signer-service-rust/README.md @@ -21,13 +21,6 @@ And the log should print: ```log INFO signer_service_rust: 🚀LISTENING - Ok(127.0.0.1:3001) ``` -On the succeeding runs while your db is still up, you might encounter these logs which can be ignored: -```log -WARN signer_service_rust::infra: ⚠️WARNING - inserting BRL to db: Internal server error: duplicate key value violates unique constraint "tokens_asset_code_asset_issuer_key" -WARN signer_service_rust::infra: ⚠️WARNING - inserting EURC to db: Internal server error: duplicate key value violates unique constraint "tokens_asset_code_asset_issuer_key" -``` -It only warns that the following [tokens](./resources/tokens) are already in the table. - ## The routes ### **`GET`** http://127.0.0.1:3001/v1/status @@ -39,27 +32,6 @@ if successful, will show the public key of environment variable `STELLAR_SECRET_ } ``` -### **`GET`** http://127.0.0.1:3001/v1/tokens -returns all the supported tokens -```json -[ - { - "asset_code": "BRL", - "asset_issuer": "GDVKY2GU2DRXWTBEYJJWSFXIGBZV6AZNBVVSUHEPZI54LIS6BA7DVVSP", - "min_withdrawal_amount": "10000000000000", - "toml_url": "https://ntokens.com/.well-known/stellar.toml", - "vault_account_id": "6g7fKQQZ9VfbBTQSaKBcATV4psApFra5EDwKLARFZCCVnSWS" - }, - { - "asset_code": "EURC", - "asset_issuer": "GAQRF3UGHBT6JYQZ7YSUYCIYWAF4T2SAA5237Q5LIQYJOHHFAWDXZ7NM", - "min_withdrawal_amount": "10000000000000", - "toml_url": "https://mykobo.co/.well-known/stellar.toml", - "vault_account_id": "6bsD97dS8ZyomMmp1DLCnCtx25oABtf19dypQKdZe6FBQXSm" - } -] -``` - ### **`POST`** http://127.0.0.1:3001/v1/stellar/payment requires a request body of: ```json diff --git a/signer-service-rust/src/api/horizon/create_account_tx.rs b/signer-service-rust/src/api/horizon/create_account_tx.rs index 4f71950d..c95bf167 100644 --- a/signer-service-rust/src/api/horizon/create_account_tx.rs +++ b/signer-service-rust/src/api/horizon/create_account_tx.rs @@ -1,11 +1,11 @@ use axum::Json; -use deadpool_diesel::postgres::Pool; use serde_json::{json, Value}; use substrate_stellar_sdk::{Operation, PublicKey, Signer, SignerKey}; use tracing::error; use wallet::operations::AppendExt; use crate::api::Error; -use crate::api::horizon::helper::{asset_to_change_trust_asset_type, create_transaction_no_operations, get_single_token, operation_with_custom_err}; +use crate::api::horizon::helper::{asset_to_change_trust_asset_type, create_transaction_no_operations, operation_with_custom_err}; +use crate::api::token::Token; use crate::config::AccountConfig; const SET_OPT_LOW_THRESHOLD:u8 = 2; @@ -26,7 +26,6 @@ const NEW_ACCOUNT_STARTING_BALANCE:&'static str = "2.5"; /// * [Add a trust line](Operation::new_change_trust) from the given `asset_code`. If the asset code does not exist in the db, /// it will return [`NotFound`](crate::infra::Error::NotFound) pub async fn build_create_account_tx( - pool: &Pool, funding_account: &AccountConfig, ephemeral_account_id: &PublicKey, asset_code:&str, @@ -46,8 +45,7 @@ pub async fn build_create_account_tx( let operations = prepare_all_operations( funding_account, ephemeral_account_id.clone(), - asset_code, - pool + asset_code ).await?; // insert all 3 operations @@ -73,7 +71,6 @@ async fn prepare_all_operations( funding_account: &AccountConfig, ephemeral_account_id: PublicKey, asset_code:&str, - pool: &Pool ) -> Result,Error> { // create account op let create_op = operation_with_custom_err!( @@ -103,15 +100,15 @@ async fn prepare_all_operations( set_opt_op.source_account = Some(ephemeral_account_id.clone().into()); // add trust line - let mut change_trust_op = change_trust_op(pool,asset_code).await?; + let mut change_trust_op = change_trust_op(asset_code).await?; change_trust_op.source_account = Some(ephemeral_account_id.into()); Ok(vec![create_op,set_opt_op, change_trust_op]) } #[doc(hidden)] -async fn change_trust_op(pool:&Pool, asset_code:&str) -> Result { - let token = get_single_token(pool,asset_code).await?; +async fn change_trust_op(asset_code:&str) -> Result { + let token = Token::try_by_asset_code(asset_code)?; let tk_asset = asset_to_change_trust_asset_type(&token)?; operation_with_custom_err!( diff --git a/signer-service-rust/src/api/horizon/helper.rs b/signer-service-rust/src/api/horizon/helper.rs index 66716e89..9e606f2a 100644 --- a/signer-service-rust/src/api/horizon/helper.rs +++ b/signer-service-rust/src/api/horizon/helper.rs @@ -1,4 +1,3 @@ -use deadpool_diesel::postgres::Pool; use substrate_stellar_sdk::{Asset, Memo, PublicKey, TimeBounds, Transaction}; use substrate_stellar_sdk::types::{ChangeTrustAsset, Preconditions}; use tracing::error; @@ -20,17 +19,7 @@ macro_rules! operation_with_custom_err { } pub(super) use operation_with_custom_err; -use crate::infra::{get_all_tokens, Token, TokensFilter}; - -pub(super) async fn get_single_token(pool:&Pool, asset_code: &str) -> Result { - let mut tokens = get_all_tokens(pool,TokensFilter{ - asset_code: Some(asset_code.to_string()), - asset_issuer: None, - vault_account_id: None, - }).await?; - - tokens.pop().ok_or(Error::InfraError(crate::infra::Error::DoesNotExist(asset_code.to_string()))) -} +use crate::api::token::Token; /// Returns a basic [`Transaction`] WITHOUT any operations yet diff --git a/signer-service-rust/src/api/horizon/payment_and_merge_tx.rs b/signer-service-rust/src/api/horizon/payment_and_merge_tx.rs index 52034a27..4bc2da46 100644 --- a/signer-service-rust/src/api/horizon/payment_and_merge_tx.rs +++ b/signer-service-rust/src/api/horizon/payment_and_merge_tx.rs @@ -1,13 +1,12 @@ use axum::Json; -use deadpool_diesel::postgres::Pool; use serde_json::{json, Value}; use substrate_stellar_sdk::{Operation, PublicKey, Transaction}; use tracing::error; use wallet::operations::AppendExt; use crate::api::{Error, Sep24Result}; -use crate::api::horizon::helper::{asset_to_change_trust_asset_type, create_transaction_no_operations, get_single_token, operation_with_custom_err}; +use crate::api::horizon::helper::{asset_to_change_trust_asset_type, create_transaction_no_operations, operation_with_custom_err}; +use crate::api::token::Token; use crate::config::AccountConfig; -use crate::infra::Token; const CHANGE_TRUST_LIMIT:&'static str = "0"; @@ -22,7 +21,6 @@ const CHANGE_TRUST_LIMIT:&'static str = "0"; /// it will return [`NotFound`](crate::infra::Error::NotFound) /// * [Merging](Operation::new_account_merge) the `ephemeral_account_id` to the `funding_account` pub async fn build_payment_and_merge_tx( - pool: &Pool, funding_account: &AccountConfig, ephemeral_account_id: PublicKey, ephemeral_sequence: i64, @@ -31,7 +29,7 @@ pub async fn build_payment_and_merge_tx( payment_data: Sep24Result, ) -> Result,Error>{ // retrieve the token - let token = get_single_token(pool, asset_code).await?; + let token = Token::try_by_asset_code(asset_code)?; let payment_tx = payment_transaction( ephemeral_account_id.clone(), diff --git a/signer-service-rust/src/api/mod.rs b/signer-service-rust/src/api/mod.rs index 087fb06d..0fe677ea 100644 --- a/signer-service-rust/src/api/mod.rs +++ b/signer-service-rust/src/api/mod.rs @@ -1,7 +1,9 @@ pub mod routes; mod horizon; +#[allow(non_snake_case)] mod sep24Result; pub mod requests; +mod token; pub use sep24Result::Sep24Result; @@ -9,7 +11,7 @@ pub use sep24Result::Sep24Result; use serde::{Deserialize, Serialize}; use crate::config::Error as ConfigError; -use crate::infra::Error as InfraError; +// use crate::infra::Error as InfraError; pub(super) use horizon::{build_create_account_tx, build_payment_and_merge_tx}; @@ -17,10 +19,12 @@ pub(super) use horizon::{build_create_account_tx, build_payment_and_merge_tx}; pub enum Error { InvalidMemo, EncodingFailed(String), + SerdeError(String), OperationError(String), TransactionError(String), + DoesNotExist(String), ConfigError(ConfigError), - InfraError(InfraError) + // InfraError(InfraError) } impl From for Error { @@ -29,8 +33,8 @@ impl From for Error { } } -impl From for Error { - fn from(value: InfraError) -> Self { - Self::InfraError(value) - } -} \ No newline at end of file +// impl From for Error { +// fn from(value: InfraError) -> Self { +// Self::InfraError(value) +// } +// } \ No newline at end of file diff --git a/signer-service-rust/src/api/routes/impls.rs b/signer-service-rust/src/api/routes/impls.rs deleted file mode 100644 index 63cc3bb2..00000000 --- a/signer-service-rust/src/api/routes/impls.rs +++ /dev/null @@ -1,42 +0,0 @@ -use axum::extract::State; -use axum::Json; -use serde_json::{json, Value}; -use tokio::time::Instant; -use tracing::info; -use crate::AppState; -use crate::infra::{get_all_tokens, Token, TokensFilter}; - -pub(super) async fn tokens(State(state): State,) -> Json { - let start = Instant::now(); - let res = match get_all_tokens( - &state.pool, - TokensFilter::empty() - ).await { - Ok(tokens) => tokens_as_json(tokens), - Err(e) => { - Json(json!({ - "status": 500, - "error": "Server Error", - "details": e - })) - } - }; - - let duration = start.elapsed(); - info!("➡️ {:<6} {duration:?}", "GET tokens"); - res -} - -fn tokens_as_json(tokens:Vec) -> Json { - match serde_json::to_value(tokens) { - Ok(res) => { Json(res) } - Err(e ) => { - let e = e.to_string(); - Json(json!({ - "status": 500, - "error": "Server Error", - "details": e - })) - } - } -} \ No newline at end of file diff --git a/signer-service-rust/src/api/routes/mod.rs b/signer-service-rust/src/api/routes/mod.rs index 47fca196..782df1e0 100644 --- a/signer-service-rust/src/api/routes/mod.rs +++ b/signer-service-rust/src/api/routes/mod.rs @@ -1,11 +1,9 @@ /// implementations of the routes mod stellar_impls; -mod impls; use axum::Router; use axum::routing::{get, post}; -use crate::api::routes::impls::tokens; use crate::api::routes::stellar_impls::{create_account, payment, status}; use crate::AppState; @@ -13,18 +11,14 @@ use crate::AppState; pub fn v1_routes(state:AppState) -> Router { Router::new().nest( "/v1", - first_level(state.clone()) + status_route(state.clone()) .merge(stellar_routes(state)) ) } -/// contains the /status and /tokens -fn first_level(state:AppState) -> Router { - Router::new() - // GET /v1/status - .route("/status", get(status)) - // GET /v1/tokens - .route("/tokens", get(tokens)) +// GET /v1/status +fn status_route(state:AppState) -> Router { + Router::new().route("/status", get(status)) .with_state(state) } diff --git a/signer-service-rust/src/api/routes/stellar_impls.rs b/signer-service-rust/src/api/routes/stellar_impls.rs index 9ea0423c..e04da4c2 100644 --- a/signer-service-rust/src/api/routes/stellar_impls.rs +++ b/signer-service-rust/src/api/routes/stellar_impls.rs @@ -25,7 +25,6 @@ pub(super) async fn create_account( }; let res = build_create_account_tx( - &state.pool, &state.account, &ephemeral_account_id, &payload.asset_code, @@ -62,7 +61,6 @@ pub(super) async fn payment( let res = build_payment_and_merge_tx( - &state.pool, &state.account, ephemeral_account_id, payload.sequence, diff --git a/signer-service-rust/src/api/token.rs b/signer-service-rust/src/api/token.rs new file mode 100644 index 00000000..229318a0 --- /dev/null +++ b/signer-service-rust/src/api/token.rs @@ -0,0 +1,97 @@ +use serde::{Deserialize, Serialize}; +use substrate_stellar_sdk::{Asset, PublicKey}; +use substrate_stellar_sdk::types::{AlphaNum12, AlphaNum4}; +use tracing::error; +use crate::api::Error; + +#[derive(PartialEq, Clone, Debug, Serialize,Deserialize)] +pub struct Token { + pub asset_code: String, + pub asset_issuer: String, + pub vault_account_id: String, + pub toml_url: String, + pub min_withdrawal_amount: Option, +} + +impl Token { + /// Returns a Token based on a supported asset_code + pub fn try_by_asset_code(asset_code:&str) -> Result { + let asset_code = asset_code.to_uppercase(); + let path = format!("./resources/tokens/{asset_code}.json"); + + Self::try_from_path(&path).map_err(|e| { + match e { + Error::DoesNotExist(_) => { + Error::DoesNotExist(asset_code) + } + _ => e + } + }) + } + + #[doc(hidden)] + /// Returns a Token by reading from a json file + pub fn try_from_path(path: &str) -> Result { + let read_file = std::fs::read_to_string(path) + .map_err(|_| { + error!("‼️{:<6} - Reading file {path}", "FAILED"); + Error::DoesNotExist(path.to_string()) + })?; + + serde_json::from_str(&read_file) + .map_err(|e| { + error!("‼️{:<6} - Deserializing to Token struct in file {path}: {e:?}", "FAILED"); + Error::SerdeError(format!("Token struct in file {path}")) + }) + } + + pub fn asset_code_hex(&self) -> String { + let asset_code = self.asset_code.to_uppercase(); + let mut hex = format!("0x{}", hex::encode(&asset_code)); + + for _ in self.asset_code.len()..4 { + hex = hex + "00"; + } + + hex + } + + pub fn asset_type(&self) -> Result { + let _asset_code = self.asset_code.to_uppercase(); + let _asset_code = _asset_code.as_bytes(); + + Ok( + if self.asset_code.len() <= 4 { + let mut asset_code = [0; 4]; + asset_code[.._asset_code.len()].copy_from_slice(_asset_code); + + Asset::AssetTypeCreditAlphanum4( + AlphaNum4 { + asset_code, + issuer: self.asset_issuer_as_public_key()? + } + ) + } else if self.asset_code.len() <= 12 { + let mut asset_code = [0; 12]; + asset_code[.._asset_code.len()].copy_from_slice(_asset_code); + + Asset::AssetTypeCreditAlphanum12( + AlphaNum12 { + asset_code, + issuer: self.asset_issuer_as_public_key()?, + } + ) + } else { + error!("‼️{:<6} - Asset Code {} exceed max characters of 12", "OUT OF RANGE", &self.asset_code); + return Err(Error::EncodingFailed("asset_code".to_string())); + } + ) + } + + fn asset_issuer_as_public_key(&self) -> Result { + PublicKey::from_encoding(&self.asset_issuer).map_err(|e|{ + error!("‼️{:<6} - Encoding asset issuer:{}: {e:?}", "FAILED", &self.asset_issuer); + Error::EncodingFailed("asset issuer".to_string()) + }) + } +} diff --git a/signer-service-rust/src/config/account.rs b/signer-service-rust/src/config/account.rs index 45ede9ae..d519bf03 100644 --- a/signer-service-rust/src/config/account.rs +++ b/signer-service-rust/src/config/account.rs @@ -9,11 +9,11 @@ use crate::helper::public_key_as_string; #[doc(hidden)] /// the environment variable name to store the secret key -const STELLAR_SECRET_KEY:&str = "STELLAR_SECRET_KEY"; +const ENV_VAR_NAME_STELLAR_SECRET_KEY:&str = "STELLAR_SECRET_KEY"; #[doc(hidden)] /// the environment variable name to store whether to use Public network or Test network -const STELLAR_PUBLIC_NETWORK:&str = "STELLAR_PUBLIC_NETWORK"; +const ENV_VAR_NAME_STELLAR_PUBLIC_NETWORK:&str = "STELLAR_PUBLIC_NETWORK"; /// The configuration of the funding account #[derive(Clone)] @@ -34,14 +34,14 @@ impl Debug for AccountConfig { impl AccountConfig { /// Create new config via environment variables pub(super) fn try_from_env() -> Result { - let secret = env::var(STELLAR_SECRET_KEY).map_err(|_| Error::MissingStellarSecretKey)?; + let secret = env::var(ENV_VAR_NAME_STELLAR_SECRET_KEY).map_err(|_| Error::MissingStellarSecretKey)?; let secret = SecretKey::from_encoding(&secret) .map_err(|e| { error!("‼️Failed to parse stellar secret key ******: {e:?}"); Error::ParseFailed("stellar secret key".to_string()) })?; - let is_public_network = env::var(STELLAR_PUBLIC_NETWORK).map_err(|_| Error::MissingStellarNetworkIdentifier)?; + let is_public_network = env::var(ENV_VAR_NAME_STELLAR_PUBLIC_NETWORK).map_err(|_| Error::MissingStellarNetworkIdentifier)?; let is_public_network = is_public_network.parse::() .map_err(|_| { error!("‼️Failed to parse stellar public network {is_public_network}"); diff --git a/signer-service-rust/src/config/database.rs b/signer-service-rust/src/config/database.rs index 4acf2c43..afa15645 100644 --- a/signer-service-rust/src/config/database.rs +++ b/signer-service-rust/src/config/database.rs @@ -6,13 +6,13 @@ use tracing::error; use crate::config::{Error, try_get_port_from_env}; #[doc(hidden)] -const DATABASE_HOST:&str = "DATABASE_HOST"; +const ENV_VAR_NAME_DATABASE_HOST:&str = "DATABASE_HOST"; #[doc(hidden)] -const DATABASE_PORT:&str = "DATABASE_PORT"; +const ENV_VAR_NAME_DATABASE_PORT:&str = "DATABASE_PORT"; #[doc(hidden)] -const POSTGRES_USER:&str = "POSTGRES_USER"; +const ENV_VAR_NAME_POSTGRES_USER:&str = "POSTGRES_USER"; #[doc(hidden)] -const POSTGRES_PASSWORD:&str = "POSTGRES_PASSWORD"; +const ENV_VAR_NAME_POSTGRES_PASSWORD:&str = "POSTGRES_PASSWORD"; /// The configuration of the Postgres db pub struct DatabaseConfig { @@ -40,10 +40,10 @@ impl DatabaseConfig { /// Create new config via environment variables pub(super) fn try_from_env() -> Result { Ok(DatabaseConfig{ - host: env::var(DATABASE_HOST).map_err(|_| Error::MissingDatabaseHost)?, - port: try_get_port_from_env(DATABASE_PORT,Error::MissingDatabasePort)?, - user: env::var(POSTGRES_USER).map_err(|_| Error::MissingDatabaseUser)?, - pass: env::var(POSTGRES_PASSWORD).map_err(|_| Error::MissingDatabaseUser)? + host: env::var(ENV_VAR_NAME_DATABASE_HOST).map_err(|_| Error::MissingDatabaseHost)?, + port: try_get_port_from_env(ENV_VAR_NAME_DATABASE_PORT,Error::MissingDatabasePort)?, + user: env::var(ENV_VAR_NAME_POSTGRES_USER).map_err(|_| Error::MissingDatabaseUser)?, + pass: env::var(ENV_VAR_NAME_POSTGRES_PASSWORD).map_err(|_| Error::MissingDatabaseUser)? }) } diff --git a/signer-service-rust/src/config/server.rs b/signer-service-rust/src/config/server.rs index 164f7a14..005b76e0 100644 --- a/signer-service-rust/src/config/server.rs +++ b/signer-service-rust/src/config/server.rs @@ -5,9 +5,9 @@ use std::{ use crate::config::{Error, try_get_port_from_env}; #[doc(hidden)] -const SERVER_HOST:&str = "SERVER_HOST"; +const ENV_VAR_NAME_SERVER_HOST:&str = "SERVER_HOST"; #[doc(hidden)] -const SERVER_PORT:&str = "SERVER_PORT"; +const ENV_VAR_NAME_SERVER_PORT:&str = "SERVER_PORT"; const DEFAULT_SERVER_HOST:&str = "127.0.0.1"; const DEFAULT_SERVER_PORT:u16 = 3001; @@ -32,8 +32,8 @@ impl ServerConfig { /// Create new config via environment variables pub(super) fn try_from_env() -> Result { Ok(ServerConfig { - host: env::var(SERVER_HOST).map_err(|_| Error::MissingServerHost)?, - port: try_get_port_from_env(SERVER_PORT, Error::MissingServerPort)? + host: env::var(ENV_VAR_NAME_SERVER_HOST).map_err(|_| Error::MissingServerHost)?, + port: try_get_port_from_env(ENV_VAR_NAME_SERVER_PORT, Error::MissingServerPort)? }) } diff --git a/signer-service-rust/src/infra/mod.rs b/signer-service-rust/src/infra/mod.rs index d65f61b1..3664b11e 100644 --- a/signer-service-rust/src/infra/mod.rs +++ b/signer-service-rust/src/infra/mod.rs @@ -1,23 +1,22 @@ mod error; -mod impls; -mod schema; -mod models; + +// ------ we will not import these files; these will serve as examples +// ------ on how to use diesel +// mod impls; +// mod schema; +// mod models; use deadpool_diesel::postgres::Pool; use diesel_migrations::{embed_migrations, EmbeddedMigrations, MigrationHarness}; -use tracing::{error, info, warn}; +use tracing::error; pub use error::Error; -pub use models::{Token,TokensFilter}; -use impls::file::try_by_asset_code; -use impls::insert; -pub use impls::{get_all_tokens, get_token_by_asset_code}; pub const MIGRATIONS: EmbeddedMigrations = embed_migrations!("migrations/"); -pub async fn run_migrations(pool:&Pool) -> Result<(),Error> { - match pool.get().await { +pub async fn run_migrations(connection_pool:&Pool) -> Result<(),Error> { + match connection_pool.get().await { Err(e) => { error!("‼️{:<6} - retrieving object from pool: {e:?}", "FAILED"); return Err(Error::MigrationFailed) @@ -32,22 +31,3 @@ pub async fn run_migrations(pool:&Pool) -> Result<(),Error> { Ok(()) } - - -#[doc(hidden)] -/// Inserts BRL and EURC to db -pub async fn initialize_db(pool: &Pool) -> Result<(),Error> { - let brl_token = try_by_asset_code("brL")?; - match insert(pool,brl_token.clone()).await { - Ok(id) => info!("💰️{:<6} - to db with id {id}: {brl_token:?} ", "INSERTED"), - Err(e) => warn!("⚠️{:<6} - inserting {} to db: {e}", "WARNING", brl_token.asset_code) - }; - - let eurc_token = try_by_asset_code("eurc")?; - match insert(pool, eurc_token.clone()).await { - Ok(id) => info!("💰️{:<6} - to db with id {id}: {eurc_token:?} ", "INSERTED"), - Err(e) => warn!("⚠️{:<6} - inserting {} to db: {e}", "WARNING", eurc_token.asset_code) - }; - - Ok(()) -} diff --git a/signer-service-rust/src/main.rs b/signer-service-rust/src/main.rs index f6e639a9..4e8b03fd 100644 --- a/signer-service-rust/src/main.rs +++ b/signer-service-rust/src/main.rs @@ -1,11 +1,10 @@ mod config; -pub mod infra; +mod infra; mod api; #[doc(hidden)] pub mod helper; - use deadpool_diesel::postgres::Pool; use tracing::info; use tracing_subscriber::{ @@ -16,12 +15,12 @@ use tracing_subscriber::{ }; use crate::api::routes::{v1_routes}; use crate::config::AccountConfig; -use crate::infra::{initialize_db, run_migrations}; +use crate::infra::run_migrations; /// Application State that can be shared amongst routes #[derive(Clone)] pub struct AppState { - pub pool: Pool, + pub connection_pool: Pool, pub account: AccountConfig } @@ -32,16 +31,15 @@ async fn main() { let config = config::Config::try_from_env_file(".env").unwrap(); let db_cfg = config.database_config(); - let pool = db_cfg.create_pool().unwrap(); - run_migrations(&pool).await.unwrap(); - initialize_db(&pool).await.unwrap(); + let connection_pool = db_cfg.create_pool().unwrap(); + run_migrations(&connection_pool).await.unwrap(); let server_addr = config.server_config().socket_address().unwrap(); let listener = tokio::net::TcpListener::bind(server_addr).await.unwrap(); info!("🚀{:<6} - {:?}\n", "LISTENING", listener.local_addr()); let state = AppState { - pool, + connection_pool, account: config.account_config(), }; axum::serve(listener,v1_routes(state)).await.unwrap(); From 9c5023692a03472f566025e8770929d092a1ac94 Mon Sep 17 00:00:00 2001 From: b-yap <2826165+b-yap@users.noreply.github.com> Date: Fri, 5 Jul 2024 22:58:58 +0800 Subject: [PATCH 15/15] https://github.com/pendulum-chain/vortex/pull/37#pullrequestreview-2146657123 --- signer-service-rust/src/{infra => db}/error.rs | 0 signer-service-rust/src/{infra => db}/impls.rs | 0 signer-service-rust/src/{infra => db}/mod.rs | 0 signer-service-rust/src/{infra => db}/models.rs | 0 signer-service-rust/src/{infra => db}/schema.rs | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename signer-service-rust/src/{infra => db}/error.rs (100%) rename signer-service-rust/src/{infra => db}/impls.rs (100%) rename signer-service-rust/src/{infra => db}/mod.rs (100%) rename signer-service-rust/src/{infra => db}/models.rs (100%) rename signer-service-rust/src/{infra => db}/schema.rs (100%) diff --git a/signer-service-rust/src/infra/error.rs b/signer-service-rust/src/db/error.rs similarity index 100% rename from signer-service-rust/src/infra/error.rs rename to signer-service-rust/src/db/error.rs diff --git a/signer-service-rust/src/infra/impls.rs b/signer-service-rust/src/db/impls.rs similarity index 100% rename from signer-service-rust/src/infra/impls.rs rename to signer-service-rust/src/db/impls.rs diff --git a/signer-service-rust/src/infra/mod.rs b/signer-service-rust/src/db/mod.rs similarity index 100% rename from signer-service-rust/src/infra/mod.rs rename to signer-service-rust/src/db/mod.rs diff --git a/signer-service-rust/src/infra/models.rs b/signer-service-rust/src/db/models.rs similarity index 100% rename from signer-service-rust/src/infra/models.rs rename to signer-service-rust/src/db/models.rs diff --git a/signer-service-rust/src/infra/schema.rs b/signer-service-rust/src/db/schema.rs similarity index 100% rename from signer-service-rust/src/infra/schema.rs rename to signer-service-rust/src/db/schema.rs