From 11caf9a18b5c050e48d0d2fa7ca1b9d4b24ab6ea Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Mon, 18 Nov 2024 11:08:20 -0500 Subject: [PATCH] fix: store TXs, not block --- Cargo.lock | 1152 ++++++++--------- firefly-cardanoconnect/Cargo.toml | 2 +- .../V000004__create_block_records_table.sql | 1 - ...V000006__add_block_record_transactions.sql | 3 + .../src/blockchain/blockfrost.rs | 16 +- .../src/blockchain/mocks.rs | 2 +- firefly-cardanoconnect/src/blockchain/n2c.rs | 8 +- .../src/persistence/sqlite.rs | 26 +- firefly-cardanoconnect/src/streams/types.rs | 2 +- 9 files changed, 608 insertions(+), 604 deletions(-) create mode 100644 firefly-cardanoconnect/db/migrations/sqlite/V000006__add_block_record_transactions.sql diff --git a/Cargo.lock b/Cargo.lock index 237ea93..c9c73b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -53,7 +53,7 @@ version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b0e3b97a21e41ec5c19bfd9b4fc1f7086be104f8b988681230247ffc91cc8ed" dependencies = [ - "axum 0.7.7", + "axum", "bytes", "cfg-if", "http 1.1.0", @@ -62,7 +62,7 @@ dependencies = [ "serde", "serde_json", "serde_qs", - "thiserror", + "thiserror 1.0.69", "tower-layer", "tower-service", "tracing", @@ -85,9 +85,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.17" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23a1e53f0f5d86382dafe1cf314783b2044280f406e7e1506368220ad11b1338" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -100,9 +100,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8365de52b16c035ff4fcafe0092ba9390540e3e352870ac09933bebcaa2c8c56" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" @@ -134,15 +134,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.91" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" +checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" [[package]] name = "arbitrary" -version = "1.3.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" dependencies = [ "derive_arbitrary", ] @@ -172,7 +172,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -183,7 +183,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -222,40 +222,12 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "axum" -version = "0.6.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" -dependencies = [ - "async-trait", - "axum-core 0.3.4", - "bitflags 1.3.2", - "bytes", - "futures-util", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.31", - "itoa", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "sync_wrapper 0.1.2", - "tower 0.4.13", - "tower-layer", - "tower-service", -] - -[[package]] -name = "axum" -version = "0.7.7" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "504e3947307ac8326a5437504c517c4b56716c9d98fac0028c2acc7ca47d70ae" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" dependencies = [ "async-trait", - "axum-core 0.4.5", + "axum-core", "axum-macros", "base64 0.22.1", "bytes", @@ -286,23 +258,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "axum-core" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http 0.2.12", - "http-body 0.4.6", - "mime", - "rustversion", - "tower-layer", - "tower-service", -] - [[package]] name = "axum-core" version = "0.4.5" @@ -332,7 +287,7 @@ checksum = "57d123550fa8d071b7255cb0cc04dc302baa6c8c4a79f55701552684d8399bce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -353,21 +308,23 @@ dependencies = [ [[package]] name = "balius-runtime" version = "0.1.0" -source = "git+https://github.com/SupernaviX/balius.git?rev=5f0c81a#5f0c81ae2a43e2fe6a827016f385248c656ef5a9" +source = "git+https://github.com/SupernaviX/balius.git?rev=3a899f9#3a899f9f1ed839a10719a441469a433f243520f4" dependencies = [ "async-trait", "flate2", "hex", "itertools 0.13.0", "pallas", + "prost", "redb", - "reqwest", "serde", "serde_json", "tar", - "thiserror", + "thiserror 1.0.69", "tokio", + "tokio-util", "tracing", + "utxorpc", "warp", "wasmtime", ] @@ -430,12 +387,6 @@ dependencies = [ "hex-conservative", ] -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - [[package]] name = "bitflags" version = "2.6.0" @@ -462,7 +413,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "toml", "url", ] @@ -505,9 +456,9 @@ checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "cc" -version = "1.1.31" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" +checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" dependencies = [ "jobserver", "libc", @@ -543,9 +494,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.20" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" +checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" dependencies = [ "clap_builder", "clap_derive", @@ -553,9 +504,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.20" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" +checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" dependencies = [ "anstream", "anstyle", @@ -572,14 +523,14 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" [[package]] name = "cobs" @@ -629,9 +580,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "0ca741a962e1b0bff6d724a1a0958b686406e853bb14061f218562e1896f95e6" dependencies = [ "libc", ] @@ -859,7 +810,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.85", + "syn", ] [[package]] @@ -870,7 +821,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -914,13 +865,13 @@ dependencies = [ [[package]] name = "derive_arbitrary" -version = "1.3.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" +checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -962,7 +913,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -974,7 +925,7 @@ dependencies = [ "chrono", "rust_decimal", "serde", - "thiserror", + "thiserror 1.0.69", "time", "winnow", ] @@ -1117,7 +1068,7 @@ dependencies = [ "aide", "anyhow", "async-trait", - "axum 0.7.7", + "axum", "balius-runtime", "blockfrost", "blockfrost-openapi", @@ -1127,13 +1078,13 @@ dependencies = [ "firefly-server", "futures", "hex", - "minicbor 0.25.1", - "pallas-addresses 0.31.0", - "pallas-codec 0.31.0", - "pallas-crypto 0.31.0", - "pallas-network 0.31.0", - "pallas-primitives 0.31.0", - "pallas-traverse 0.31.0", + "minicbor", + "pallas-addresses", + "pallas-codec", + "pallas-crypto", + "pallas-network", + "pallas-primitives", + "pallas-traverse", "rand", "rand_chacha", "refinery", @@ -1154,16 +1105,16 @@ version = "0.1.0" dependencies = [ "aide", "anyhow", - "axum 0.7.7", + "axum", "bech32 0.11.0", "clap", "firefly-server", "hex", - "minicbor 0.25.1", - "pallas-addresses 0.31.0", - "pallas-crypto 0.31.0", - "pallas-primitives 0.31.0", - "pallas-wallet 0.31.0", + "minicbor", + "pallas-addresses", + "pallas-crypto", + "pallas-primitives", + "pallas-wallet", "rand", "schemars", "serde", @@ -1178,7 +1129,7 @@ version = "0.1.0" dependencies = [ "aide", "anyhow", - "axum 0.7.7", + "axum", "convert_case", "duration-str", "figment", @@ -1203,9 +1154,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.34" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "miniz_oxide", @@ -1223,21 +1174,6 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" -[[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" @@ -1303,7 +1239,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -1351,7 +1287,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27d12c0aed7f1e24276a241aadc4cb8ea9f83000f34bc062b7cc2d51e3b0fabd" dependencies = [ - "bitflags 2.6.0", + "bitflags", "debugid", "fxhash", "serde", @@ -1436,12 +1372,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "half" -version = "1.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" - [[package]] name = "half" version = "2.4.1" @@ -1479,9 +1409,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" dependencies = [ "foldhash", ] @@ -1691,29 +1621,14 @@ dependencies = [ [[package]] name = "hyper-timeout" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" -dependencies = [ - "hyper 0.14.31", - "pin-project-lite", - "tokio", - "tokio-io-timeout", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" dependencies = [ - "bytes", - "http-body-util", "hyper 1.5.0", "hyper-util", - "native-tls", + "pin-project-lite", "tokio", - "tokio-native-tls", "tower-service", ] @@ -1759,6 +1674,124 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "id-arena" version = "2.2.1" @@ -1773,12 +1806,23 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] @@ -1799,7 +1843,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.15.0", + "hashbrown 0.15.1", "serde", ] @@ -1821,15 +1865,6 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" -[[package]] -name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.12.1" @@ -1906,9 +1941,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.161" +version = "0.2.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" +checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f" [[package]] name = "libm" @@ -1922,7 +1957,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.6.0", + "bitflags", "libc", "redox_syscall", ] @@ -1944,6 +1979,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" + [[package]] name = "lock_api" version = "0.4.12" @@ -2012,35 +2053,14 @@ dependencies = [ "unicase", ] -[[package]] -name = "minicbor" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d15f4203d71fdf90903c2696e55426ac97a363c67b218488a73b534ce7aca10" -dependencies = [ - "half 1.8.3", - "minicbor-derive 0.13.0", -] - [[package]] name = "minicbor" version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0452a60c1863c1f50b5f77cd295e8d2786849f35883f0b9e18e7e6e1b5691b0" dependencies = [ - "half 2.4.1", - "minicbor-derive 0.15.3", -] - -[[package]] -name = "minicbor-derive" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1154809406efdb7982841adb6311b3d095b46f78342dd646736122fe6b19e267" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "half", + "minicbor-derive", ] [[package]] @@ -2051,7 +2071,7 @@ checksum = "bd2209fff77f705b00c737016a48e73733d7fbccb8b007194db148f03561fb70" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -2099,23 +2119,6 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" -[[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 = "nu-ansi-term" version = "0.46.0" @@ -2178,7 +2181,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "crc32fast", - "hashbrown 0.15.0", + "hashbrown 0.15.1", "indexmap 2.6.0", "memchr", ] @@ -2189,50 +2192,12 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" -dependencies = [ - "bitflags 2.6.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.85", -] - [[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.104" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "overload" version = "0.1.1" @@ -2241,37 +2206,21 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "pallas" -version = "0.30.2" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c40fbf2a77397c2a719f3cb50931502a46c8b0e355801e5103f788e7eb0c15e" +checksum = "acf49f6ccfaebd82bebd93f3d050eda2c0dfba6d8265e25528e96f083ee066be" dependencies = [ - "pallas-addresses 0.30.2", - "pallas-codec 0.30.2", + "pallas-addresses", + "pallas-codec", "pallas-configs", - "pallas-crypto 0.30.2", - "pallas-network 0.30.2", - "pallas-primitives 0.30.2", - "pallas-traverse 0.30.2", + "pallas-crypto", + "pallas-network", + "pallas-primitives", + "pallas-traverse", "pallas-txbuilder", "pallas-utxorpc", ] -[[package]] -name = "pallas-addresses" -version = "0.30.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84460293bb3323066e9ce608702750c14f02bc36d41c469e44b3eef5ec0fdbf6" -dependencies = [ - "base58", - "bech32 0.9.1", - "crc", - "cryptoxide", - "hex", - "pallas-codec 0.30.2", - "pallas-crypto 0.30.2", - "thiserror", -] - [[package]] name = "pallas-addresses" version = "0.31.0" @@ -2283,38 +2232,26 @@ dependencies = [ "crc", "cryptoxide", "hex", - "pallas-codec 0.31.0", - "pallas-crypto 0.31.0", - "thiserror", + "pallas-codec", + "pallas-crypto", + "thiserror 1.0.69", ] [[package]] name = "pallas-applying" -version = "0.30.2" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "590a3a00f6981396ba2ad38b2b672c7bfd52ba215f98d1b5aecc61184fd0da09" +checksum = "66756768a0d37bcb23be9c9bcf4b1f1b53d2692981bdb720e689a38da954989e" dependencies = [ "hex", - "pallas-addresses 0.30.2", - "pallas-codec 0.30.2", - "pallas-crypto 0.30.2", - "pallas-primitives 0.30.2", - "pallas-traverse 0.30.2", + "pallas-addresses", + "pallas-codec", + "pallas-crypto", + "pallas-primitives", + "pallas-traverse", "rand", ] -[[package]] -name = "pallas-codec" -version = "0.30.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747279d1bc612986035619a3eaded8f9f4ceae29668aa7a5feae83681a0e93f4" -dependencies = [ - "hex", - "minicbor 0.20.0", - "serde", - "thiserror", -] - [[package]] name = "pallas-codec" version = "0.31.0" @@ -2322,43 +2259,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1389b47a97864a7cb167e2392b44332930af90f6aaaac45eb2f369ccab95f4c7" dependencies = [ "hex", - "minicbor 0.25.1", + "minicbor", "serde", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "pallas-configs" -version = "0.30.2" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12dc7f456f61479407f22afd29a58671c148c50c703b16ef09653406d131f0e0" +checksum = "78e964ec9c2cd1f21dbe93176ea3ca43d3da16ef13e653fcc5004a55adc5f926" dependencies = [ "base64 0.22.1", "hex", "num-rational", - "pallas-addresses 0.30.2", - "pallas-codec 0.30.2", - "pallas-crypto 0.30.2", - "pallas-primitives 0.30.2", + "pallas-addresses", + "pallas-codec", + "pallas-crypto", + "pallas-primitives", "serde", "serde_json", "serde_with", ] -[[package]] -name = "pallas-crypto" -version = "0.30.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b6f8b08e32c7dbb50302222701ae15ef9ac1a7cc39225ce29c253f6ddab2aa7" -dependencies = [ - "cryptoxide", - "hex", - "pallas-codec 0.30.2", - "rand_core", - "serde", - "thiserror", -] - [[package]] name = "pallas-crypto" version = "0.31.0" @@ -2367,31 +2290,13 @@ checksum = "f5d84346a1f0da5240b2aa16fde96998b84cdcc466cb7c04ba24bb1e1630e0d3" dependencies = [ "cryptoxide", "hex", - "pallas-codec 0.31.0", + "pallas-codec", "rand_core", "serde", - "thiserror", + "thiserror 1.0.69", "zeroize", ] -[[package]] -name = "pallas-network" -version = "0.30.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c081efb304917ec0025182e11295c6e1727b779888b83cc93d89533c71db50c" -dependencies = [ - "byteorder", - "hex", - "itertools 0.13.0", - "pallas-codec 0.30.2", - "pallas-crypto 0.30.2", - "rand", - "socket2", - "thiserror", - "tokio", - "tracing", -] - [[package]] name = "pallas-network" version = "0.31.0" @@ -2401,31 +2306,15 @@ dependencies = [ "byteorder", "hex", "itertools 0.13.0", - "pallas-codec 0.31.0", - "pallas-crypto 0.31.0", + "pallas-codec", + "pallas-crypto", "rand", "socket2", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", ] -[[package]] -name = "pallas-primitives" -version = "0.30.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24929d461308626183d5bf15290e6315f4cc67fa38a1a66469425919683cceb2" -dependencies = [ - "base58", - "bech32 0.9.1", - "hex", - "log", - "pallas-codec 0.30.2", - "pallas-crypto 0.30.2", - "serde", - "serde_json", -] - [[package]] name = "pallas-primitives" version = "0.31.0" @@ -2436,29 +2325,12 @@ dependencies = [ "bech32 0.9.1", "hex", "log", - "pallas-codec 0.31.0", - "pallas-crypto 0.31.0", + "pallas-codec", + "pallas-crypto", "serde", "serde_json", ] -[[package]] -name = "pallas-traverse" -version = "0.30.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73ca94c2278a160c226d6f5bb1756ea5f355421158aaa697445f59f09477a6a4" -dependencies = [ - "hex", - "itertools 0.13.0", - "pallas-addresses 0.30.2", - "pallas-codec 0.30.2", - "pallas-crypto 0.30.2", - "pallas-primitives 0.30.2", - "paste", - "serde", - "thiserror", -] - [[package]] name = "pallas-traverse" version = "0.31.0" @@ -2467,61 +2339,46 @@ checksum = "5d04fc75a2144eb257c68b4604cdde647e07404ea185b791c0005826960dfb35" dependencies = [ "hex", "itertools 0.13.0", - "pallas-addresses 0.31.0", - "pallas-codec 0.31.0", - "pallas-crypto 0.31.0", - "pallas-primitives 0.31.0", + "pallas-addresses", + "pallas-codec", + "pallas-crypto", + "pallas-primitives", "paste", "serde", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "pallas-txbuilder" -version = "0.30.2" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302a05b5e1dc266c88fc33df1f5e623f5a591815806afb6b76c33f364247cc59" +checksum = "7d6454a6439726ff2645a5c8e981c0cd4a6fc0338f7ef1a216e9e9be751dc4db" dependencies = [ "hex", - "pallas-addresses 0.30.2", - "pallas-codec 0.30.2", - "pallas-crypto 0.30.2", - "pallas-primitives 0.30.2", - "pallas-traverse 0.30.2", - "pallas-wallet 0.30.2", + "pallas-addresses", + "pallas-codec", + "pallas-crypto", + "pallas-primitives", + "pallas-traverse", + "pallas-wallet", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "pallas-utxorpc" -version = "0.30.2" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a650f2617a39b45fadbc6333fe5b183b9e581b8d02d5bcd762847b94ed1c00" +checksum = "bdc07262343b18927a86dee4838f2ded8e1e586bab81eb5f0e865fe091ca7dc6" dependencies = [ "pallas-applying", - "pallas-codec 0.30.2", - "pallas-crypto 0.30.2", - "pallas-primitives 0.30.2", - "pallas-traverse 0.30.2", - "prost-types 0.13.3", - "utxorpc-spec", -] - -[[package]] -name = "pallas-wallet" -version = "0.30.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a4bf755a844bcc9eacaa8907d002b02ca861898acf7a07f60216b4fba58f1f4" -dependencies = [ - "bech32 0.9.1", - "bip39", - "cryptoxide", - "ed25519-bip32", - "pallas-crypto 0.30.2", - "rand", - "thiserror", + "pallas-codec", + "pallas-crypto", + "pallas-primitives", + "pallas-traverse", + "prost-types", + "utxorpc-spec 0.11.0", ] [[package]] @@ -2534,9 +2391,9 @@ dependencies = [ "bip39", "cryptoxide", "ed25519-bip32", - "pallas-crypto 0.31.0", + "pallas-crypto", "rand", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2570,9 +2427,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pbjson" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1030c719b0ec2a2d25a5df729d6cff1acf3cc230bf766f4f97833591f7577b90" +checksum = "c7e6349fa080353f4a597daffd05cb81572a9c031a6d4fff7e504947496fcc68" dependencies = [ "base64 0.21.7", "serde", @@ -2580,27 +2437,27 @@ dependencies = [ [[package]] name = "pbjson-build" -version = "0.6.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2580e33f2292d34be285c5bc3dba5259542b083cfad6037b6d70345f24dcb735" +checksum = "6eea3058763d6e656105d1403cb04e0a41b7bbac6362d413e7c33be0c32279c9" dependencies = [ - "heck 0.4.1", - "itertools 0.11.0", - "prost 0.12.6", - "prost-types 0.12.6", + "heck 0.5.0", + "itertools 0.13.0", + "prost", + "prost-types", ] [[package]] name = "pbjson-types" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18f596653ba4ac51bdecbb4ef6773bc7f56042dc13927910de1684ad3d32aa12" +checksum = "e54e5e7bfb1652f95bc361d76f3c780d8e526b134b85417e774166ee941f0887" dependencies = [ "bytes", "chrono", "pbjson", "pbjson-build", - "prost 0.12.6", + "prost", "prost-build", "serde", ] @@ -2625,7 +2482,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -2661,7 +2518,7 @@ checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -2716,7 +2573,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.85", + "syn", ] [[package]] @@ -2736,21 +2593,11 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", "version_check", "yansi", ] -[[package]] -name = "prost" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" -dependencies = [ - "bytes", - "prost-derive 0.12.6", -] - [[package]] name = "prost" version = "0.13.3" @@ -2758,43 +2605,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f" dependencies = [ "bytes", - "prost-derive 0.13.3", + "prost-derive", ] [[package]] name = "prost-build" -version = "0.12.6" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" +checksum = "0c1318b19085f08681016926435853bbf7858f9c082d0999b80550ff5d9abe15" dependencies = [ "bytes", "heck 0.5.0", - "itertools 0.12.1", + "itertools 0.13.0", "log", "multimap", "once_cell", "petgraph", "prettyplease", - "prost 0.12.6", - "prost-types 0.12.6", + "prost", + "prost-types", "regex", - "syn 2.0.85", + "syn", "tempfile", ] -[[package]] -name = "prost-derive" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" -dependencies = [ - "anyhow", - "itertools 0.12.1", - "proc-macro2", - "quote", - "syn 2.0.85", -] - [[package]] name = "prost-derive" version = "0.13.3" @@ -2805,16 +2639,7 @@ dependencies = [ "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.85", -] - -[[package]] -name = "prost-types" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" -dependencies = [ - "prost 0.12.6", + "syn", ] [[package]] @@ -2823,7 +2648,7 @@ version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4759aa0d3a6232fb8dbdb97b61de2c20047c68aca932c7ed76da9d788508d670" dependencies = [ - "prost 0.13.3", + "prost", ] [[package]] @@ -2837,9 +2662,9 @@ dependencies = [ [[package]] name = "quinn" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" dependencies = [ "bytes", "pin-project-lite", @@ -2848,33 +2673,36 @@ dependencies = [ "rustc-hash 2.0.0", "rustls", "socket2", - "thiserror", + "thiserror 2.0.3", "tokio", "tracing", ] [[package]] name = "quinn-proto" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" dependencies = [ "bytes", + "getrandom", "rand", "ring", "rustc-hash 2.0.0", "rustls", + "rustls-pki-types", "slab", - "thiserror", + "thiserror 2.0.3", "tinyvec", "tracing", + "web-time", ] [[package]] name = "quinn-udp" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e346e016eacfff12233c243718197ca12f148c84e1e84268a896699b41c71780" +checksum = "7d5a626c6807713b15cac82a6acaccd6043c9a5408c24baae07611fec3f243da" dependencies = [ "cfg_aliases", "libc", @@ -2958,7 +2786,7 @@ version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ - "bitflags 2.6.0", + "bitflags", ] [[package]] @@ -2969,7 +2797,7 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2995,7 +2823,7 @@ dependencies = [ "rusqlite", "serde", "siphasher", - "thiserror", + "thiserror 1.0.69", "time", "toml", "url", @@ -3013,7 +2841,7 @@ dependencies = [ "quote", "refinery-core", "regex", - "syn 2.0.85", + "syn", ] [[package]] @@ -3043,9 +2871,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -3067,7 +2895,6 @@ dependencies = [ "base64 0.22.1", "bytes", "encoding_rs", - "futures-channel", "futures-core", "futures-util", "h2 0.4.6", @@ -3076,14 +2903,12 @@ dependencies = [ "http-body-util", "hyper 1.5.0", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", "mime_guess", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", @@ -3097,7 +2922,6 @@ dependencies = [ "sync_wrapper 1.0.1", "system-configuration", "tokio", - "tokio-native-tls", "tokio-rustls", "tower-service", "url", @@ -3117,7 +2941,7 @@ dependencies = [ "async-tungstenite", "futures-util", "reqwest", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-util", "tracing", @@ -3146,7 +2970,7 @@ version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b838eba278d213a8beaf485bd313fd580ca4505a00d5871caeb1457c55322cae" dependencies = [ - "bitflags 2.6.0", + "bitflags", "fallible-iterator", "fallible-streaming-iterator", "hashlink", @@ -3174,7 +2998,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.85", + "syn", "walkdir", ] @@ -3222,7 +3046,7 @@ version = "0.38.41" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" dependencies = [ - "bitflags 2.6.0", + "bitflags", "errno", "libc", "linux-raw-sys", @@ -3231,10 +3055,11 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.16" +version = "0.23.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee87ff5d9b36712a58574e12e9f0ea80f915a5b0ac518d322b24a465617925e" +checksum = "7f1a745511c54ba6d4465e8d5dfbd81b45791756de28d4981af70d6dca128f1e" dependencies = [ + "log", "once_cell", "ring", "rustls-pki-types", @@ -3243,6 +3068,19 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls-native-certs" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "rustls-pki-types", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pemfile" version = "2.2.0" @@ -3257,6 +3095,9 @@ name = "rustls-pki-types" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +dependencies = [ + "web-time", +] [[package]] name = "rustls-webpki" @@ -3321,7 +3162,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.85", + "syn", ] [[package]] @@ -3342,7 +3183,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.6.0", + "bitflags", "core-foundation", "core-foundation-sys", "libc", @@ -3370,22 +3211,22 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -3396,14 +3237,14 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] name = "serde_json" -version = "1.0.132" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "itoa", "memchr", @@ -3427,11 +3268,11 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd34f36fe4c5ba9654417139a9b3a20d2e1de6012ee678ad14d240c22c78d8d6" dependencies = [ - "axum 0.7.7", + "axum", "futures", "percent-encoding", "serde", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -3482,7 +3323,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -3631,20 +3472,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[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.85" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -3666,13 +3496,24 @@ dependencies = [ "futures-core", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "system-configuration" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 2.6.0", + "bitflags", "core-foundation", "system-configuration-sys", ] @@ -3728,22 +3569,42 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.65" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" +dependencies = [ + "thiserror-impl 2.0.3", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ - "thiserror-impl", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "thiserror-impl" -version = "1.0.65" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -3787,6 +3648,16 @@ dependencies = [ "time-core", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -3804,9 +3675,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.41.0" +version = "1.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" +checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" dependencies = [ "backtrace", "bytes", @@ -3820,16 +3691,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "tokio-io-timeout" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" -dependencies = [ - "pin-project-lite", - "tokio", -] - [[package]] name = "tokio-macros" version = "2.4.0" @@ -3838,17 +3699,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", -] - -[[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", + "syn", ] [[package]] @@ -3958,24 +3809,30 @@ dependencies = [ [[package]] name = "tonic" -version = "0.11.0" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13" +checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" dependencies = [ "async-stream", "async-trait", - "axum 0.6.20", - "base64 0.21.7", + "axum", + "base64 0.22.1", "bytes", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.31", + "h2 0.4.6", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.5.0", "hyper-timeout", + "hyper-util", "percent-encoding", "pin-project", - "prost 0.12.6", + "prost", + "rustls-native-certs", + "rustls-pemfile", + "socket2", "tokio", + "tokio-rustls", "tokio-stream", "tower 0.4.13", "tower-layer", @@ -4021,11 +3878,11 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8437150ab6bbc8c5f0f519e3d5ed4aa883a83dd4cdd3d1b21f9482936046cb97" +checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697" dependencies = [ - "bitflags 2.6.0", + "bitflags", "bytes", "http 1.1.0", "http-body 1.0.1", @@ -4067,7 +3924,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -4125,7 +3982,7 @@ dependencies = [ "log", "rand", "sha1", - "thiserror", + "thiserror 1.0.69", "url", "utf-8", ] @@ -4144,7 +4001,7 @@ dependencies = [ "log", "rand", "sha1", - "thiserror", + "thiserror 1.0.69", "utf-8", ] @@ -4180,12 +4037,6 @@ version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" -[[package]] -name = "unicode-bidi" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" - [[package]] name = "unicode-ident" version = "1.0.13" @@ -4233,9 +4084,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.2" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" dependencies = [ "form_urlencoded", "idna", @@ -4248,6 +4099,18 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -4256,9 +4119,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "utoipa" -version = "5.1.3" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d9ba0ade4e2f024cd1842dfbaf9dbc540639fc082299acf7649d71bd14eaca3" +checksum = "514a48569e4e21c86d0b84b5612b5e73c0b2cf09db63260134ba426d4e8ea714" dependencies = [ "indexmap 2.6.0", "serde", @@ -4268,13 +4131,13 @@ dependencies = [ [[package]] name = "utoipa-gen" -version = "5.1.3" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cf390d6503c9c9eac988447c38ba934a707b0b768b14511a493b4fc0e8ecb00" +checksum = "5629efe65599d0ccd5d493688cbf6e03aa7c1da07fe59ff97cf5977ed0637f66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -4283,7 +4146,7 @@ version = "8.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5c80b4dd79ea382e8374d67dcce22b5c6663fa13a82ad3886441d1bbede5e35" dependencies = [ - "axum 0.7.7", + "axum", "mime_guess", "regex", "rust-embed", @@ -4294,17 +4157,47 @@ dependencies = [ "zip", ] +[[package]] +name = "utxorpc" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1b94946745af6df920d4dc6e14f2cc73417520c9a7823133e5436660ee3fac9" +dependencies = [ + "bytes", + "thiserror 1.0.69", + "tokio", + "tonic", + "utxorpc-spec 0.12.0", +] + [[package]] name = "utxorpc-spec" -version = "0.10.0" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd510ca9b5937fe5e62be72924f0a9a217c35fdcd10f0959be60319f4cac639b" +dependencies = [ + "bytes", + "futures-core", + "pbjson", + "pbjson-types", + "prost", + "prost-types", + "serde", + "tonic", +] + +[[package]] +name = "utxorpc-spec" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "343c17df63049cee293d3262cb741d1c97dc0c73f080336132b16d48f264b885" +checksum = "3f5bb265be0e071adf7675ac8003a1c94772516a7a62d4fb1005f61ee288f3d3" dependencies = [ "bytes", "futures-core", "pbjson", "pbjson-types", - "prost 0.12.6", + "prost", + "prost-types", "serde", "tonic", ] @@ -4413,7 +4306,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.85", + "syn", "wasm-bindgen-shared", ] @@ -4447,7 +4340,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4500,7 +4393,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d28bc49ba1e5c5b61ffa7a2eace10820443c4b7d1c0b144109261d14570fdf8" dependencies = [ "ahash", - "bitflags 2.6.0", + "bitflags", "hashbrown 0.14.5", "indexmap 2.6.0", "semver", @@ -4514,7 +4407,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e246c2772ce3ebc83f89a2d4487ac5794cad6c309b2071818a88c7db7c36d87b" dependencies = [ "ahash", - "bitflags 2.6.0", + "bitflags", "hashbrown 0.14.5", "indexmap 2.6.0", "semver", @@ -4540,7 +4433,7 @@ dependencies = [ "addr2line 0.21.0", "anyhow", "async-trait", - "bitflags 2.6.0", + "bitflags", "bumpalo", "cc", "cfg-if", @@ -4625,7 +4518,7 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.85", + "syn", "wasmtime-component-util", "wasmtime-wit-bindgen", "wit-parser 0.212.0", @@ -4655,7 +4548,7 @@ dependencies = [ "log", "object", "target-lexicon", - "thiserror", + "thiserror 1.0.69", "wasmparser 0.212.0", "wasmtime-environ", "wasmtime-versioned-export-macros", @@ -4755,7 +4648,7 @@ checksum = "a2bde986038b819bc43a21fef0610aeb47aabfe3ea09ca3533a7b81023b84ec6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", ] [[package]] @@ -5023,7 +4916,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73ccedf54cc65f287da268d64d2bf4f7530d2cfb2296ffbe3ad5f65567e4cf53" dependencies = [ "anyhow", - "bitflags 2.6.0", + "bitflags", "indexmap 2.6.0", "log", "serde", @@ -5071,6 +4964,18 @@ dependencies = [ "wasmparser 0.220.0", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "xattr" version = "1.3.1" @@ -5088,6 +4993,30 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -5106,7 +5035,28 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn", +] + +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", ] [[package]] @@ -5115,6 +5065,28 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "zip" version = "2.2.0" @@ -5128,7 +5100,7 @@ dependencies = [ "flate2", "indexmap 2.6.0", "memchr", - "thiserror", + "thiserror 1.0.69", "zopfli", ] diff --git a/firefly-cardanoconnect/Cargo.toml b/firefly-cardanoconnect/Cargo.toml index 3d95b8a..b5c2cbf 100644 --- a/firefly-cardanoconnect/Cargo.toml +++ b/firefly-cardanoconnect/Cargo.toml @@ -9,7 +9,7 @@ aide = { version = "0.13", features = ["axum"] } anyhow = "1" async-trait = "0.1" axum = { version = "0.7", features = ["macros", "ws"] } -balius-runtime = { git = "https://github.com/SupernaviX/balius.git", rev = "5f0c81a" } +balius-runtime = { git = "https://github.com/SupernaviX/balius.git", rev = "3a899f9" } blockfrost = { git = "https://github.com/blockfrost/blockfrost-rust.git", rev = "14e22b5", default-features = false, features = ["rustls-tls"] } blockfrost-openapi = "0.1.69" clap = { version = "4", features = ["derive"] } diff --git a/firefly-cardanoconnect/db/migrations/sqlite/V000004__create_block_records_table.sql b/firefly-cardanoconnect/db/migrations/sqlite/V000004__create_block_records_table.sql index e7929e1..a611a12 100644 --- a/firefly-cardanoconnect/db/migrations/sqlite/V000004__create_block_records_table.sql +++ b/firefly-cardanoconnect/db/migrations/sqlite/V000004__create_block_records_table.sql @@ -5,7 +5,6 @@ CREATE TABLE "block_records" ( "block_slot" BIGINT NULL, "block_hash" TEXT NOT NULL, "parent_hash" TEXT NULL, - "cbor" BLOB NOT NULL, "transaction_hashes" TEXT NOT NULL, "rolled_back" TINYINT NOT NULL, FOREIGN KEY ("listener_id") REFERENCES "listeners" ("id") ON DELETE CASCADE diff --git a/firefly-cardanoconnect/db/migrations/sqlite/V000006__add_block_record_transactions.sql b/firefly-cardanoconnect/db/migrations/sqlite/V000006__add_block_record_transactions.sql new file mode 100644 index 0000000..7b321e6 --- /dev/null +++ b/firefly-cardanoconnect/db/migrations/sqlite/V000006__add_block_record_transactions.sql @@ -0,0 +1,3 @@ +ALTER TABLE "block_records" +ADD COLUMN "transactions" BLOB NOT NULL +DEFAULT x'80' \ No newline at end of file diff --git a/firefly-cardanoconnect/src/blockchain/blockfrost.rs b/firefly-cardanoconnect/src/blockchain/blockfrost.rs index c578e69..6466a3c 100644 --- a/firefly-cardanoconnect/src/blockchain/blockfrost.rs +++ b/firefly-cardanoconnect/src/blockchain/blockfrost.rs @@ -1,11 +1,12 @@ use std::{collections::VecDeque, time::Duration}; -use anyhow::{bail, Result}; +use anyhow::{bail, Context as _, Result}; use async_trait::async_trait; use blockfrost::{ BlockFrostSettings, BlockfrostAPI, BlockfrostError, BlockfrostResult, Pagination, }; use blockfrost_openapi::models::BlockContent; +use futures::future::try_join_all; use pallas_primitives::conway::Tx; use tokio::time; @@ -272,12 +273,16 @@ async fn parse_block(api: &BlockfrostAPI, block: BlockContent) -> Result BlockfrostResultExt for BlockfrostResult { } } } + +async fn fetch_tx(blockfrost: &BlockfrostAPI, hash: &str) -> Result> { + let tx_body = blockfrost + .transactions_cbor(hash) + .await + .context("could not fetch tx body")?; + let bytes = hex::decode(&tx_body.cbor)?; + Ok(bytes) +} diff --git a/firefly-cardanoconnect/src/blockchain/mocks.rs b/firefly-cardanoconnect/src/blockchain/mocks.rs index 1372085..6825fac 100644 --- a/firefly-cardanoconnect/src/blockchain/mocks.rs +++ b/firefly-cardanoconnect/src/blockchain/mocks.rs @@ -192,8 +192,8 @@ impl MockChain { block_slot: block_height, block_hash: Self::generate_hash(rng), parent_hash, - cbor: vec![], transaction_hashes, + transactions: vec![], }; indexes.insert(block.block_hash.clone(), chain.len()); chain.push(block); diff --git a/firefly-cardanoconnect/src/blockchain/n2c.rs b/firefly-cardanoconnect/src/blockchain/n2c.rs index 23a0aa5..85be165 100644 --- a/firefly-cardanoconnect/src/blockchain/n2c.rs +++ b/firefly-cardanoconnect/src/blockchain/n2c.rs @@ -233,6 +233,12 @@ impl N2cChainSync { let block_hash = hex::encode(block.hash()); let parent_hash = block.header().previous_hash().map(hex::encode); + let mut transaction_hashes = vec![]; + let mut transactions = vec![]; + for tx in block.txs() { + transaction_hashes.push(hex::encode(tx.hash())); + transactions.push(tx.encode()); + } let transaction_hashes = block .txs() .iter() @@ -243,8 +249,8 @@ impl N2cChainSync { block_slot: Some(block_slot), block_hash, parent_hash, - cbor: content.0, transaction_hashes, + transactions, }) } } diff --git a/firefly-cardanoconnect/src/persistence/sqlite.rs b/firefly-cardanoconnect/src/persistence/sqlite.rs index d61ee9d..7d9b601 100644 --- a/firefly-cardanoconnect/src/persistence/sqlite.rs +++ b/firefly-cardanoconnect/src/persistence/sqlite.rs @@ -263,7 +263,7 @@ impl Persistence for SqlitePersistence { self.conn .call_unwrap(move |c| { c.prepare_cached( - "SELECT block_height, block_slot, block_hash, parent_hash, cbor, transaction_hashes, rolled_back + "SELECT block_height, block_slot, block_hash, parent_hash, transaction_hashes, transactions, rolled_back FROM block_records WHERE listener_id = ?1 ORDER BY id", @@ -286,7 +286,7 @@ impl Persistence for SqlitePersistence { self.conn.call_unwrap(move |c| { let tx = c.transaction()?; let mut insert = tx.prepare_cached( - "INSERT INTO block_records (listener_id, block_height, block_slot, block_hash, parent_hash, cbor, transaction_hashes, rolled_back) + "INSERT INTO block_records (listener_id, block_height, block_slot, block_hash, parent_hash, transaction_hashes, transactions, rolled_back) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8)", )?; @@ -295,11 +295,15 @@ impl Persistence for SqlitePersistence { let block_slot = record.block.block_slot; let block_hash = record.block.block_hash.clone(); let parent_hash = record.block.parent_hash.clone(); - let cbor = record.block.cbor; let transaction_hashes = serde_json::to_string(&record.block.transaction_hashes)?; + let transactions = { + let mut bytes = vec![]; + minicbor::encode(&record.block.transactions, &mut bytes).expect("infallible"); + bytes + }; let rolled_back = record.rolled_back; - insert.execute(params![listener_id, block_height, block_slot, block_hash, parent_hash, cbor, transaction_hashes, rolled_back])?; + insert.execute(params![listener_id, block_height, block_slot, block_hash, parent_hash, transaction_hashes, transactions, rolled_back])?; } drop(insert); @@ -396,8 +400,14 @@ fn parse_block_record(row: &Row) -> Result { let block_slot: Option = row.get("block_slot")?; let block_hash: String = row.get("block_hash")?; let parent_hash: Option = row.get("parent_hash")?; - let cbor: Vec = row.get("cbor")?; - let transaction_hashes: String = row.get("transaction_hashes")?; + let transaction_hashes = { + let raw: String = row.get("transaction_hashes")?; + serde_json::from_str(&raw)? + }; + let transactions = { + let raw: Vec = row.get("transactions")?; + minicbor::decode(&raw)? + }; let rolled_back: bool = row.get("rolled_back")?; Ok(BlockRecord { block: BlockInfo { @@ -405,8 +415,8 @@ fn parse_block_record(row: &Row) -> Result { block_slot, block_hash, parent_hash, - cbor, - transaction_hashes: serde_json::from_str(&transaction_hashes)?, + transaction_hashes, + transactions, }, rolled_back, }) diff --git a/firefly-cardanoconnect/src/streams/types.rs b/firefly-cardanoconnect/src/streams/types.rs index 16fd04c..8032917 100644 --- a/firefly-cardanoconnect/src/streams/types.rs +++ b/firefly-cardanoconnect/src/streams/types.rs @@ -101,8 +101,8 @@ pub struct BlockInfo { pub block_slot: Option, pub block_hash: String, pub parent_hash: Option, - pub cbor: Vec, pub transaction_hashes: Vec, + pub transactions: Vec>, } impl BlockInfo { pub fn as_reference(&self) -> BlockReference {