diff --git a/Cargo.lock b/Cargo.lock index 6fd7ebc1..f6fff116 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,18 +4,18 @@ version = 3 [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aes" @@ -142,9 +142,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "10f00e1f6e58a40e807377c75c6a7f97bf9044fab57816f2414e6f5f4499d7b8" [[package]] name = "arc-swap" @@ -219,19 +219,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", - "syn 2.0.72", + "quote 1.0.37", + "syn 2.0.77", ] [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", - "syn 2.0.72", + "quote 1.0.37", + "syn 2.0.77", ] [[package]] @@ -257,17 +257,17 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -394,9 +394,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.9.2" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1bc3887947e51b03a2aa6dff41aaf64f2bd8f7369ebcb1ef49b2b54b6a0d1de" +checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" dependencies = [ "memchr", "regex-automata 0.4.7", @@ -417,22 +417,22 @@ checksum = "5ce89b21cab1437276d2650d57e971f9d548a2d9037cc231abdc0562b97498ce" [[package]] name = "bytemuck" -version = "1.16.1" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" +checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.7.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee891b04274a59bd38b412188e24b849617b2e45a0fd8d057deb63e7403761b" +checksum = "0cc8b54b395f2fcfbb3d90c47b01c7f444d94d05bdeb775811dec868ac3bbc26" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", - "syn 2.0.72", + "quote 1.0.37", + "syn 2.0.77", ] [[package]] @@ -443,9 +443,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.1" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "bzip2" @@ -471,7 +471,7 @@ dependencies = [ [[package]] name = "casper-binary-port" version = "1.0.0" -source = "git+https://github.com/casper-network/casper-node.git?branch=feat-2.0#b92f881b8351d88082e90a3addebc84ada87bcd8" +source = "git+https://github.com/casper-network/casper-node.git?branch=feat-2.0#e6456b709ec1da1c6b703db2a04beeba960651c5" dependencies = [ "bincode", "bytes", @@ -502,13 +502,13 @@ dependencies = [ "mockito", "once_cell", "portpicker", - "reqwest 0.12.5", + "reqwest 0.12.7", "serde", "serde_json", "thiserror", "tokio", "tokio-stream", - "tokio-util 0.7.11", + "tokio-util 0.7.12", "tracing", "url", "warp", @@ -534,7 +534,7 @@ dependencies = [ "hex_fmt", "http 0.2.12", "hyper 0.14.30", - "indexmap 2.2.6", + "indexmap 2.5.0", "itertools", "jsonschema", "metrics", @@ -545,7 +545,7 @@ dependencies = [ "pretty_assertions", "rand", "regex", - "reqwest 0.12.5", + "reqwest 0.12.7", "schemars", "sea-query", "serde", @@ -556,7 +556,7 @@ dependencies = [ "thiserror", "tokio", "tokio-stream", - "tokio-util 0.7.11", + "tokio-util 0.7.12", "tower", "tracing", "tracing-subscriber", @@ -673,7 +673,7 @@ dependencies = [ [[package]] name = "casper-types" version = "5.0.0" -source = "git+https://github.com/casper-network/casper-node.git?branch=feat-2.0#b92f881b8351d88082e90a3addebc84ada87bcd8" +source = "git+https://github.com/casper-network/casper-node.git?branch=feat-2.0#e6456b709ec1da1c6b703db2a04beeba960651c5" dependencies = [ "base16", "base64 0.13.1", @@ -716,12 +716,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.6" +version = "1.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f" +checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476" dependencies = [ "jobserver", "libc", + "shlex", ] [[package]] @@ -742,9 +743,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.11" +version = "4.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35723e6a11662c2afb578bcf0b88bf6ea8e21282a953428f240574fcc3a2b5b3" +checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" dependencies = [ "clap_builder", "clap_derive", @@ -752,9 +753,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.11" +version = "4.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49eb96cbfa7cfa35017b7cd548c75b14c3118c98b423041d70562665e07fb0fa" +checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" dependencies = [ "anstream", "anstyle", @@ -764,14 +765,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.11" +version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d029b67f89d30bbb547c89fd5161293c0aec155fc691d7924b64550662db93e" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" dependencies = [ "heck 0.5.0", "proc-macro2 1.0.86", - "quote 1.0.36", - "syn 2.0.72", + "quote 1.0.37", + "syn 2.0.77", ] [[package]] @@ -832,15 +833,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -945,8 +946,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", - "syn 2.0.72", + "quote 1.0.37", + "syn 2.0.77", ] [[package]] @@ -973,7 +974,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613e4ee15899913285b7612004bbd490abd605be7b11d35afada5902fb6b91d5" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", + "quote 1.0.37", "syn 1.0.109", ] @@ -1004,7 +1005,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3418329ca0ad70234b9735dc4ceed10af4df60eff9c8e7b06cb5e520d92c3535" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", + "quote 1.0.37", "syn 1.0.109", ] @@ -1015,8 +1016,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d150dea618e920167e5973d70ae6ece4385b7164e0d799fe7c122dd0a5d912ad" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", - "syn 2.0.72", + "quote 1.0.37", + "syn 2.0.77", ] [[package]] @@ -1027,9 +1028,9 @@ checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "convert_case", "proc-macro2 1.0.86", - "quote 1.0.36", + "quote 1.0.37", "rustc_version", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1103,9 +1104,9 @@ checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" [[package]] name = "dunce" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "dyn-clone" @@ -1277,9 +1278,9 @@ checksum = "a2a2b11eda1d40935b26cf18f6833c526845ae8c41e58d09af6adeb6f0269183" [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "ff" @@ -1299,21 +1300,21 @@ checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "filetime" -version = "0.2.23" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", + "libredox", + "windows-sys 0.59.0", ] [[package]] name = "flate2" -version = "1.0.30" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", "miniz_oxide", @@ -1442,8 +1443,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", - "syn 2.0.72", + "quote 1.0.37", + "syn 2.0.77", ] [[package]] @@ -1502,9 +1503,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" [[package]] name = "gix" @@ -1617,9 +1618,9 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.14.7" +version = "0.14.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b328997d74dd15dc71b2773b162cb4af9a25c424105e4876e6d0686ab41c383e" +checksum = "03f76169faa0dec598eac60f83d7fcdd739ec16596eca8fb144c88973dbe6f8c" dependencies = [ "bitflags 2.6.0", "bstr", @@ -1689,9 +1690,9 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6adf99c27cdf17b1c4d77680c917e0d94d8783d4e1c73d3be0d1d63107163d7a" +checksum = "f2bfe6249cfea6d0c0e0990d5226a4cb36f030444ba9e35e0639275db8f98575" dependencies = [ "fastrand", "gix-features", @@ -1700,9 +1701,9 @@ dependencies = [ [[package]] name = "gix-glob" -version = "0.16.4" +version = "0.16.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7df15afa265cc8abe92813cd354d522f1ac06b29ec6dfa163ad320575cb447" +checksum = "74908b4bbc0a0a40852737e5d7889f676f081e340d5451a16e5b4c50d592f111" dependencies = [ "bitflags 2.6.0", "bstr", @@ -1777,8 +1778,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "999ce923619f88194171a67fb3e6d613653b8d4d6078b529b15a765da0edcc17" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", - "syn 2.0.72", + "quote 1.0.37", + "syn 2.0.77", ] [[package]] @@ -1840,9 +1841,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.10.9" +version = "0.10.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d23d5bbda31344d8abc8de7c075b3cf26e5873feba7c4a15d916bce67382bd9" +checksum = "ebfc4febd088abdcbc9f1246896e57e37b7a34f6909840045a1767c6dafac7af" dependencies = [ "bstr", "gix-trace", @@ -1931,9 +1932,9 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1547d26fa5693a7f34f05b4a3b59a90890972922172653bcb891ab3f09f436df" +checksum = "0fe4d52f30a737bbece5276fab5d3a8b276dc2650df963e293d0673be34e7a5f" dependencies = [ "bitflags 2.6.0", "gix-path", @@ -1943,9 +1944,9 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "14.0.1" +version = "14.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "006acf5a613e0b5cf095d8e4b3f48c12a60d9062aa2b2dd105afaf8344a5600c" +checksum = "046b4927969fa816a150a0cda2e62c80016fe11fb3c3184e4dddf4e542f108aa" dependencies = [ "gix-fs", "libc", @@ -1958,9 +1959,9 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f924267408915fddcd558e3f37295cc7d6a3e50f8bd8b606cee0808c3915157e" +checksum = "6cae0e8661c3ff92688ce1c8b8058b3efb312aba9492bbe93661a21705ab431b" [[package]] name = "gix-traverse" @@ -1981,9 +1982,9 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.27.4" +version = "0.27.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2eb9b35bba92ea8f0b5ab406fad3cf6b87f7929aa677ff10aa042c6da621156" +checksum = "fd280c5e84fb22e128ed2a053a0daeacb6379469be6a85e3d518a0636e160c89" dependencies = [ "bstr", "gix-features", @@ -2036,18 +2037,18 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.2.6", + "indexmap 2.5.0", "slab", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.12", "tracing", ] [[package]] name = "h2" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" +checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" dependencies = [ "atomic-waker", "bytes", @@ -2055,10 +2056,10 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap 2.2.6", + "indexmap 2.5.0", "slab", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.12", "tracing", ] @@ -2288,10 +2289,11 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.5", + "h2 0.4.6", "http 1.1.0", "http-body 1.0.1", "httparse", + "httpdate", "itoa", "pin-project-lite", "smallvec", @@ -2301,15 +2303,15 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", "hyper 1.4.1", "hyper-util", - "rustls 0.23.12", + "rustls 0.23.13", "rustls-pki-types", "tokio", "tokio-rustls", @@ -2347,9 +2349,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" +checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" dependencies = [ "bytes", "futures-channel", @@ -2388,9 +2390,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown 0.14.5", @@ -2404,8 +2406,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0122b7114117e64a63ac49f752a5ca4624d534c7b1c7de796ac196381cd2d947" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", - "syn 2.0.72", + "quote 1.0.37", + "syn 2.0.77", ] [[package]] @@ -2419,9 +2421,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" [[package]] name = "is_terminal_polyfill" @@ -2464,9 +2466,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -2542,9 +2544,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.155" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libm" @@ -2560,6 +2562,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.6.0", "libc", + "redox_syscall", ] [[package]] @@ -2672,18 +2675,18 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ "hermit-abi", "libc", @@ -2714,20 +2717,25 @@ checksum = "af7cbce79ec385a1d4f54baa90a76401eb15d9cab93685f62e7e9f942aa00ae2" dependencies = [ "cfg-if", "proc-macro2 1.0.86", - "quote 1.0.36", - "syn 2.0.72", + "quote 1.0.37", + "syn 2.0.77", ] [[package]] name = "mockito" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2f6e023aa5bdf392aa06c78e4a4e6d498baab5138d0c993503350ebbc37bf1e" +checksum = "09b34bd91b9e5c5b06338d392463e1318d683cf82ec3d3af4014609be6e2108d" dependencies = [ "assert-json-diff", + "bytes", "colored", - "futures-core", - "hyper 0.14.30", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.4.1", + "hyper-util", "log", "rand", "regex", @@ -2861,7 +2869,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", + "quote 1.0.37", "syn 1.0.109", ] @@ -2928,9 +2936,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.2" +version = "0.36.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" dependencies = [ "memchr", ] @@ -2969,8 +2977,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", - "syn 2.0.72", + "quote 1.0.37", + "syn 2.0.77", ] [[package]] @@ -3034,7 +3042,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.3", + "redox_syscall", "smallvec", "windows-targets 0.52.6", ] @@ -3129,8 +3137,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", - "syn 2.0.72", + "quote 1.0.37", + "syn 2.0.77", ] [[package]] @@ -3189,9 +3197,12 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "predicates" @@ -3237,7 +3248,7 @@ checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", "proc-macro2 1.0.86", - "quote 1.0.36", + "quote 1.0.37", "syn 1.0.109", "version_check", ] @@ -3249,7 +3260,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", + "quote 1.0.37", "version_check", ] @@ -3371,9 +3382,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2 1.0.86", ] @@ -3426,15 +3437,6 @@ dependencies = [ "rand_core", ] -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.5.3" @@ -3446,9 +3448,9 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", @@ -3457,9 +3459,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.5" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", @@ -3528,7 +3530,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "sync_wrapper 0.1.2", - "system-configuration", + "system-configuration 0.5.1", "tokio", "tokio-native-tls", "tower-service", @@ -3536,21 +3538,21 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "winreg 0.50.0", + "winreg", ] [[package]] name = "reqwest" -version = "0.12.5" +version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" +checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ "base64 0.22.1", "bytes", "encoding_rs", "futures-core", "futures-util", - "h2 0.4.5", + "h2 0.4.6", "http 1.1.0", "http-body 1.0.1", "http-body-util", @@ -3566,22 +3568,22 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls-pemfile 2.1.2", + "rustls-pemfile 2.1.3", "serde", "serde_json", "serde_urlencoded", "sync_wrapper 1.0.1", - "system-configuration", + "system-configuration 0.6.1", "tokio", "tokio-native-tls", - "tokio-util 0.7.11", + "tokio-util 0.7.12", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "wasm-streams", "web-sys", - "winreg 0.52.0", + "windows-registry", ] [[package]] @@ -3647,9 +3649,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6125dbc8867951125eec87294137f4e9c2c96566e61bf72c45095a7c77761478" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", + "quote 1.0.37", "rust-embed-utils", - "syn 2.0.72", + "syn 2.0.77", "walkdir", ] @@ -3671,18 +3673,18 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "3f55e80d50763938498dd5ebb18647174e0c76dc38c5505294bb224624f30f36" dependencies = [ "bitflags 2.6.0", "errno", @@ -3704,13 +3706,13 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.12" +version = "0.23.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" +checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ "once_cell", "rustls-pki-types", - "rustls-webpki 0.102.6", + "rustls-webpki 0.102.8", "subtle", "zeroize", ] @@ -3726,9 +3728,9 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.2" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" dependencies = [ "base64 0.22.1", "rustls-pki-types", @@ -3736,9 +3738,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" [[package]] name = "rustls-webpki" @@ -3752,9 +3754,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.6" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "ring", "rustls-pki-types", @@ -3796,11 +3798,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3823,9 +3825,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", + "quote 1.0.37", "serde_derive_internals", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -3868,8 +3870,8 @@ checksum = "25a82fcb49253abcb45cdcb2adf92956060ec0928635eb21b4f7a6d8f25ab0bc" dependencies = [ "heck 0.4.1", "proc-macro2 1.0.86", - "quote 1.0.36", - "syn 2.0.72", + "quote 1.0.37", + "syn 2.0.77", "thiserror", ] @@ -3917,9 +3919,9 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.204" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] @@ -3945,13 +3947,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.204" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", - "syn 2.0.72", + "quote 1.0.37", + "syn 2.0.77", ] [[package]] @@ -3961,18 +3963,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", - "syn 2.0.72", + "quote 1.0.37", + "syn 2.0.77", ] [[package]] name = "serde_json" -version = "1.0.120" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.5.0", "itoa", + "memchr", "ryu", "serde", ] @@ -4026,6 +4029,12 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook" version = "0.3.17" @@ -4107,9 +4116,9 @@ dependencies = [ [[package]] name = "sqlformat" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f895e3734318cc55f1fe66258926c9b910c124d47520339efecbb6c59cec7c1f" +checksum = "7bba3a93db0cc4f7bdece8bb09e77e2e785c20bfebf79eb8340ed80708048790" dependencies = [ "nom", "unicode_categories", @@ -4149,7 +4158,7 @@ dependencies = [ "futures-util", "hashlink", "hex", - "indexmap 2.2.6", + "indexmap 2.5.0", "log", "memchr", "native-tls", @@ -4178,7 +4187,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ea40e2345eb2faa9e1e5e326db8c34711317d2b5e08d0d5741619048a803127" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", + "quote 1.0.37", "sqlx-core", "sqlx-macros-core", "syn 1.0.109", @@ -4196,7 +4205,7 @@ dependencies = [ "hex", "once_cell", "proc-macro2 1.0.86", - "quote 1.0.36", + "quote 1.0.37", "serde", "serde_json", "sha2", @@ -4362,7 +4371,7 @@ checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ "heck 0.4.1", "proc-macro2 1.0.86", - "quote 1.0.36", + "quote 1.0.37", "rustversion", "syn 1.0.109", ] @@ -4375,9 +4384,9 @@ checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" dependencies = [ "heck 0.4.1", "proc-macro2 1.0.86", - "quote 1.0.36", + "quote 1.0.37", "rustversion", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -4404,18 +4413,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", + "quote 1.0.37", "unicode-ident", ] [[package]] name = "syn" -version = "2.0.72" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", + "quote 1.0.37", "unicode-ident", ] @@ -4430,6 +4439,9 @@ name = "sync_wrapper" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] [[package]] name = "system-configuration" @@ -4439,7 +4451,18 @@ checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ "bitflags 1.3.2", "core-foundation", - "system-configuration-sys", + "system-configuration-sys 0.5.0", +] + +[[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", + "core-foundation", + "system-configuration-sys 0.6.0", ] [[package]] @@ -4452,6 +4475,16 @@ dependencies = [ "libc", ] +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tabled" version = "0.10.0" @@ -4473,7 +4506,7 @@ dependencies = [ "heck 0.4.1", "proc-macro-error", "proc-macro2 1.0.86", - "quote 1.0.36", + "quote 1.0.37", "syn 1.0.109", ] @@ -4490,14 +4523,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.10.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4522,8 +4556,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", - "syn 2.0.72", + "quote 1.0.37", + "syn 2.0.77", ] [[package]] @@ -4606,9 +4640,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.1" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d040ac2b29ab03b09d4129c2f5bbd012a3ac2f79d38ff506a4bf8dd34b0eac8a" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", @@ -4629,8 +4663,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", - "syn 2.0.72", + "quote 1.0.37", + "syn 2.0.77", ] [[package]] @@ -4649,21 +4683,21 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.12", + "rustls 0.23.13", "rustls-pki-types", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", "pin-project-lite", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.12", ] [[package]] @@ -4694,9 +4728,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", @@ -4725,7 +4759,7 @@ dependencies = [ "pin-project", "pin-project-lite", "tokio", - "tokio-util 0.7.11", + "tokio-util 0.7.12", "tower-layer", "tower-service", "tracing", @@ -4733,15 +4767,15 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -4762,8 +4796,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", - "syn 2.0.72", + "quote 1.0.37", + "syn 2.0.77", ] [[package]] @@ -4890,9 +4924,9 @@ checksum = "7eec5d1121208364f6793f7d2e222bf75a915c19557537745b195b253dd64217" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" @@ -4905,9 +4939,9 @@ dependencies = [ [[package]] name = "unicode-properties" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4259d9d4425d9f0661581b804cb85fe66a4c631cadd8f490d1c13a35d5d9291" +checksum = "52ea75f83c0137a9b98608359a5f1af8144876eb67bcb1ce837368e906a9f524" [[package]] name = "unicode-segmentation" @@ -4980,7 +5014,7 @@ version = "4.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c5afb1a60e207dca502682537fefcfd9921e71d0b83e9576060f09abc6efab23" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.5.0", "serde", "serde_json", "utoipa-gen", @@ -4994,8 +5028,8 @@ checksum = "7bf0e16c02bc4bf5322ab65f10ab1149bdbcaa782cba66dc7057370a3f8190be" dependencies = [ "proc-macro-error", "proc-macro2 1.0.86", - "quote 1.0.36", - "syn 2.0.72", + "quote 1.0.37", + "syn 2.0.77", ] [[package]] @@ -5046,9 +5080,9 @@ dependencies = [ [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "vte" @@ -5068,7 +5102,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e369bee1b05d510a7b4ed645f5faa90619e05437111783ea5848f28d97d3c2e" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", + "quote 1.0.37", ] [[package]] @@ -5124,7 +5158,7 @@ dependencies = [ "serde_urlencoded", "tokio", "tokio-tungstenite", - "tokio-util 0.7.11", + "tokio-util 0.7.12", "tower-service", "tracing", ] @@ -5143,34 +5177,35 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2 1.0.86", - "quote 1.0.36", - "syn 2.0.72", + "quote 1.0.37", + "syn 2.0.77", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ "cfg-if", "js-sys", @@ -5180,32 +5215,32 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ - "quote 1.0.36", + "quote 1.0.37", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", - "syn 2.0.72", + "quote 1.0.37", + "syn 2.0.77", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "wasm-streams" @@ -5222,9 +5257,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", @@ -5244,11 +5279,11 @@ checksum = "62945bc99a6a121cb2759c7bfa7b779ddf0e69b68bb35a9b23ab72276cfdcd3c" [[package]] name = "whoami" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" +checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" dependencies = [ - "redox_syscall 0.4.1", + "redox_syscall", "wasite", ] @@ -5270,11 +5305,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -5283,6 +5318,36 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -5301,6 +5366,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -5424,9 +5498,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.15" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "557404e450152cd6795bb558bca69e43c585055f4606e3bcae5894fc6dac9ba0" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" dependencies = [ "memchr", ] @@ -5441,16 +5515,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "winreg" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - [[package]] name = "xattr" version = "1.3.1" @@ -5483,6 +5547,7 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] @@ -5493,8 +5558,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2 1.0.86", - "quote 1.0.36", - "syn 2.0.72", + "quote 1.0.37", + "syn 2.0.77", ] [[package]] @@ -5544,9 +5609,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.12+zstd.1.5.6" +version = "2.0.13+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a4e40c320c3cb459d9a9ff6de98cff88f4751ee9275d140e2be94a2b74e4c13" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" dependencies = [ "cc", "pkg-config", diff --git a/resources/test/rpc_schema.json b/resources/test/rpc_schema.json index 3182679a..09e16e1a 100644 --- a/resources/test/rpc_schema.json +++ b/resources/test/rpc_schema.json @@ -166,12 +166,13 @@ "name": "transaction", "value": { "Version1": { - "hash": "f5582cb81a5abda63ebaa4edb3b05210ecbd63ffb8dd17bfbeb3b867f4014468", + "serialization_version": 1, + "hash": "df4f6e95afd24c3bdac68862cfd888fea65912f0f3e3de9c42b24cee79b7a581", "header": { "chain_name": "casper-example", "timestamp": "2020-11-17T00:39:24.072Z", "ttl": "1h", - "body_hash": "aa24833ffbf31d62c8c8c4265349e7c09cd71952fcbce6f7b12daf5e340bf2cc", + "body_hash": "7bf1a4f736a9cbb2b692b74522d981213c3a5463d0095ded40d1454cf1b779e1", "pricing_mode": { "Fixed": { "gas_price_tolerance": 5 @@ -228,7 +229,7 @@ "approvals": [ { "signer": "01d9bf2148748a85c89da5aad8ee0b0fc2d105fd39d41a4c796536354f0ae2900c", - "signature": "0137d3f468d8f8a6e63f4110d79be29b8c8428e9cd858a92049660e7851ae16a299640d1fc1c930ab6cb424f1a6eec0b194df74bede14f4af1b5133106f1280d0b" + "signature": "015b407723d54bdfd376d43776d9b92ea465d7ec2e0d41e28b5f646fc17400193bc4e075cab4e8943de09935e3aa96d0bbe456382c2274689b6847a35a94d07309" } ] } @@ -240,7 +241,7 @@ "value": { "api_version": "2.0.0", "transaction_hash": { - "Version1": "f5582cb81a5abda63ebaa4edb3b05210ecbd63ffb8dd17bfbeb3b867f4014468" + "Version1": "df4f6e95afd24c3bdac68862cfd888fea65912f0f3e3de9c42b24cee79b7a581" } } } @@ -404,7 +405,7 @@ } } ], - "size_estimate": 186, + "size_estimate": 206, "effects": [ { "key": "account-hash-2c4a11c062a8a337bfc97e27fd66291caeb2c65865dcb5d3ef3759c4c97efecb", @@ -487,7 +488,7 @@ { "name": "transaction_hash", "value": { - "Version1": "f5582cb81a5abda63ebaa4edb3b05210ecbd63ffb8dd17bfbeb3b867f4014468" + "Version1": "df4f6e95afd24c3bdac68862cfd888fea65912f0f3e3de9c42b24cee79b7a581" } }, { @@ -501,12 +502,13 @@ "api_version": "2.0.0", "transaction": { "Version1": { - "hash": "f5582cb81a5abda63ebaa4edb3b05210ecbd63ffb8dd17bfbeb3b867f4014468", + "serialization_version": 1, + "hash": "df4f6e95afd24c3bdac68862cfd888fea65912f0f3e3de9c42b24cee79b7a581", "header": { "chain_name": "casper-example", "timestamp": "2020-11-17T00:39:24.072Z", "ttl": "1h", - "body_hash": "aa24833ffbf31d62c8c8c4265349e7c09cd71952fcbce6f7b12daf5e340bf2cc", + "body_hash": "7bf1a4f736a9cbb2b692b74522d981213c3a5463d0095ded40d1454cf1b779e1", "pricing_mode": { "Fixed": { "gas_price_tolerance": 5 @@ -563,7 +565,7 @@ "approvals": [ { "signer": "01d9bf2148748a85c89da5aad8ee0b0fc2d105fd39d41a4c796536354f0ae2900c", - "signature": "0137d3f468d8f8a6e63f4110d79be29b8c8428e9cd858a92049660e7851ae16a299640d1fc1c930ab6cb424f1a6eec0b194df74bede14f4af1b5133106f1280d0b" + "signature": "015b407723d54bdfd376d43776d9b92ea465d7ec2e0d41e28b5f646fc17400193bc4e075cab4e8943de09935e3aa96d0bbe456382c2274689b6847a35a94d07309" } ] } @@ -603,7 +605,7 @@ } } ], - "size_estimate": 186, + "size_estimate": 206, "effects": [ { "key": "account-hash-2c4a11c062a8a337bfc97e27fd66291caeb2c65865dcb5d3ef3759c4c97efecb", @@ -750,6 +752,17 @@ ] }, "required": false + }, + { + "name": "include_bytecode", + "schema": { + "description": "Whether to include the entity's bytecode in the response.", + "type": [ + "boolean", + "null" + ] + }, + "required": false } ], "result": { @@ -769,7 +782,7 @@ }, "entity": { "description": "The addressable entity or a legacy account.", - "$ref": "#/components/schemas/EntityOrAccount" + "$ref": "#/components/schemas/EntityWithBackwardCompat" }, "merkle_proof": { "description": "The Merkle proof.", @@ -794,6 +807,10 @@ "value": { "Hash": "0707070707070707070707070707070707070707070707070707070707070707" } + }, + { + "name": "include_bytecode", + "value": null } ], "result": { @@ -845,7 +862,98 @@ "entry_point_payment": "Caller" } } - ] + ], + "bytecode": null + } + }, + "merkle_proof": "01000000006ef2e0949ac76e55812421f755abe129b6244fe7168b77f47a72536147614625016ef2e0949ac76e55812421f755abe129b6244fe7168b77f47a72536147614625000000003529cde5c621f857f75f3810611eb4af3f998caaa9d4a3413cf799f99c67db0307010000006ef2e0949ac76e55812421f755abe129b6244fe7168b77f47a7253614761462501010102000000006e06000000000074769d28aac597a36a03a932d4b43e4f10bf0403ee5c41dd035102553f5773631200b9e173e8f05361b681513c14e25e3138639eb03232581db7557c9e8dbbc83ce94500226a9a7fe4f2b7b88d5103a4fc7400f02bf89c860c9ccdd56951a2afe9be0e0267006d820fb5676eb2960e15722f7725f3f8f41030078f8b2e44bf0dc03f71b176d6e800dc5ae9805068c5be6da1a90b2528ee85db0609cc0fb4bd60bbd559f497a98b67f500e1e3e846592f4918234647fca39830b7e1e6ad6f5b7a99b39af823d82ba1873d000003000000010186ff500f287e9b53f823ae1582b1fa429dfede28015125fd233a31ca04d5012002015cc42669a55467a1fdf49750772bfc1aed59b9b085558eb81510e9b015a7c83b0301e3cf4a34b1db6bfa58808b686cb8fe21ebe0c1bcbcee522649d2b135fe510fe3" + } + } + } + ] + }, + { + "name": "state_get_package", + "summary": "returns a Package from the network", + "params": [ + { + "name": "package_identifier", + "schema": { + "description": "The identifier of the package.", + "$ref": "#/components/schemas/PackageIdentifier" + }, + "required": true + }, + { + "name": "block_identifier", + "schema": { + "description": "The block identifier.", + "anyOf": [ + { + "$ref": "#/components/schemas/BlockIdentifier" + }, + { + "type": "null" + } + ] + }, + "required": false + } + ], + "result": { + "name": "state_get_package_result", + "schema": { + "description": "Result for \"state_get_entity\" RPC response.", + "type": "object", + "required": [ + "api_version", + "merkle_proof", + "package" + ], + "properties": { + "api_version": { + "description": "The RPC API version.", + "type": "string" + }, + "package": { + "description": "The addressable entity or a legacy account.", + "$ref": "#/components/schemas/PackageWithBackwardCompat" + }, + "merkle_proof": { + "description": "The Merkle proof.", + "type": "string" + } + }, + "additionalProperties": false + } + }, + "examples": [ + { + "name": "state_get_package_example", + "params": [ + { + "name": "package_identifier", + "value": { + "ContractPackageHash": "contract-package-0000000000000000000000000000000000000000000000000000000000000000" + } + }, + { + "name": "block_identifier", + "value": { + "Hash": "0707070707070707070707070707070707070707070707070707070707070707" + } + } + ], + "result": { + "name": "state_get_package_example_result", + "value": { + "api_version": "2.0.0", + "package": { + "Package": { + "versions": [], + "disabled_versions": [], + "groups": [], + "lock_status": "Unlocked" } }, "merkle_proof": "01000000006ef2e0949ac76e55812421f755abe129b6244fe7168b77f47a72536147614625016ef2e0949ac76e55812421f755abe129b6244fe7168b77f47a72536147614625000000003529cde5c621f857f75f3810611eb4af3f998caaa9d4a3413cf799f99c67db0307010000006ef2e0949ac76e55812421f755abe129b6244fe7168b77f47a7253614761462501010102000000006e06000000000074769d28aac597a36a03a932d4b43e4f10bf0403ee5c41dd035102553f5773631200b9e173e8f05361b681513c14e25e3138639eb03232581db7557c9e8dbbc83ce94500226a9a7fe4f2b7b88d5103a4fc7400f02bf89c860c9ccdd56951a2afe9be0e0267006d820fb5676eb2960e15722f7725f3f8f41030078f8b2e44bf0dc03f71b176d6e800dc5ae9805068c5be6da1a90b2528ee85db0609cc0fb4bd60bbd559f497a98b67f500e1e3e846592f4918234647fca39830b7e1e6ad6f5b7a99b39af823d82ba1873d000003000000010186ff500f287e9b53f823ae1582b1fa429dfede28015125fd233a31ca04d5012002015cc42669a55467a1fdf49750772bfc1aed59b9b085558eb81510e9b015a7c83b0301e3cf4a34b1db6bfa58808b686cb8fe21ebe0c1bcbcee522649d2b135fe510fe3" @@ -3175,9 +3283,15 @@ "approvals", "body", "hash", - "header" + "header", + "serialization_version" ], "properties": { + "serialization_version": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, "hash": { "$ref": "#/components/schemas/TransactionV1Hash" }, @@ -6952,6 +7066,19 @@ "EntityIdentifier": { "description": "Identifier of an addressable entity.", "oneOf": [ + { + "description": "The hash of a contract.", + "type": "object", + "required": [ + "ContractHash" + ], + "properties": { + "ContractHash": { + "$ref": "#/components/schemas/ContractHash" + } + }, + "additionalProperties": false + }, { "description": "The public key of an account.", "type": "object", @@ -7010,8 +7137,8 @@ } ] }, - "EntityOrAccount": { - "description": "An addressable entity or a legacy account.", + "EntityWithBackwardCompat": { + "description": "An addressable entity or a legacy account or contract.", "oneOf": [ { "description": "An addressable entity.", @@ -7050,6 +7177,17 @@ "items": { "$ref": "#/components/schemas/EntryPointValue" } + }, + "bytecode": { + "description": "The bytecode of the addressable entity. Returned when `include_bytecode` is `true`.", + "anyOf": [ + { + "$ref": "#/components/schemas/ByteCodeWithProof" + }, + { + "type": "null" + } + ] } } } @@ -7057,17 +7195,148 @@ "additionalProperties": false }, { - "description": "A legacy account.", + "description": "An account.", "type": "object", "required": [ - "LegacyAccount" + "Account" ], "properties": { - "LegacyAccount": { + "Account": { "$ref": "#/components/schemas/Account" } }, "additionalProperties": false + }, + { + "description": "A contract.", + "type": "object", + "required": [ + "Contract" + ], + "properties": { + "Contract": { + "type": "object", + "required": [ + "contract" + ], + "properties": { + "contract": { + "description": "The contract.", + "allOf": [ + { + "$ref": "#/components/schemas/Contract" + } + ] + }, + "wasm": { + "description": "The Wasm code of the contract. Returned when `include_bytecode` is `true`.", + "anyOf": [ + { + "$ref": "#/components/schemas/ContractWasmWithProof" + }, + { + "type": "null" + } + ] + } + } + } + }, + "additionalProperties": false + } + ] + }, + "ByteCodeWithProof": { + "description": "Byte code of an entity with a proof.", + "type": "object", + "required": [ + "code", + "merkle_proof" + ], + "properties": { + "code": { + "$ref": "#/components/schemas/ByteCode" + }, + "merkle_proof": { + "type": "string" + } + } + }, + "ContractWasmWithProof": { + "description": "Wasm code of a contract with a proof.", + "type": "object", + "required": [ + "merkle_proof", + "wasm" + ], + "properties": { + "wasm": { + "$ref": "#/components/schemas/ContractWasm" + }, + "merkle_proof": { + "type": "string" + } + } + }, + "PackageIdentifier": { + "description": "Identifier of a package.", + "oneOf": [ + { + "description": "The address of a package.", + "type": "object", + "required": [ + "PackageAddr" + ], + "properties": { + "PackageAddr": { + "$ref": "#/components/schemas/PackageHash" + } + }, + "additionalProperties": false + }, + { + "description": "The hash of a contract package.", + "type": "object", + "required": [ + "ContractPackageHash" + ], + "properties": { + "ContractPackageHash": { + "$ref": "#/components/schemas/ContractPackageHash" + } + }, + "additionalProperties": false + } + ] + }, + "PackageWithBackwardCompat": { + "description": "A package or a legacy contract package.", + "oneOf": [ + { + "description": "A package.", + "type": "object", + "required": [ + "Package" + ], + "properties": { + "Package": { + "$ref": "#/components/schemas/Package" + } + }, + "additionalProperties": false + }, + { + "description": "A contract package.", + "type": "object", + "required": [ + "ContractPackage" + ], + "properties": { + "ContractPackage": { + "$ref": "#/components/schemas/ContractPackage" + } + }, + "additionalProperties": false } ] }, diff --git a/resources/test/speculative_rpc_schema.json b/resources/test/speculative_rpc_schema.json index 867cd792..35118280 100644 --- a/resources/test/speculative_rpc_schema.json +++ b/resources/test/speculative_rpc_schema.json @@ -174,12 +174,13 @@ "name": "transaction", "value": { "Version1": { - "hash": "f5582cb81a5abda63ebaa4edb3b05210ecbd63ffb8dd17bfbeb3b867f4014468", + "serialization_version": 1, + "hash": "df4f6e95afd24c3bdac68862cfd888fea65912f0f3e3de9c42b24cee79b7a581", "header": { "chain_name": "casper-example", "timestamp": "2020-11-17T00:39:24.072Z", "ttl": "1h", - "body_hash": "aa24833ffbf31d62c8c8c4265349e7c09cd71952fcbce6f7b12daf5e340bf2cc", + "body_hash": "7bf1a4f736a9cbb2b692b74522d981213c3a5463d0095ded40d1454cf1b779e1", "pricing_mode": { "Fixed": { "gas_price_tolerance": 5 @@ -236,7 +237,7 @@ "approvals": [ { "signer": "01d9bf2148748a85c89da5aad8ee0b0fc2d105fd39d41a4c796536354f0ae2900c", - "signature": "0137d3f468d8f8a6e63f4110d79be29b8c8428e9cd858a92049660e7851ae16a299640d1fc1c930ab6cb424f1a6eec0b194df74bede14f4af1b5133106f1280d0b" + "signature": "015b407723d54bdfd376d43776d9b92ea465d7ec2e0d41e28b5f646fc17400193bc4e075cab4e8943de09935e3aa96d0bbe456382c2274689b6847a35a94d07309" } ] } @@ -3735,9 +3736,15 @@ "approvals", "body", "hash", - "header" + "header", + "serialization_version" ], "properties": { + "serialization_version": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + }, "hash": { "$ref": "#/components/schemas/TransactionV1Hash" }, diff --git a/rpc_sidecar/src/http_server.rs b/rpc_sidecar/src/http_server.rs index 43f93bcf..2362f204 100644 --- a/rpc_sidecar/src/http_server.rs +++ b/rpc_sidecar/src/http_server.rs @@ -7,7 +7,7 @@ use casper_json_rpc::{CorsOrigin, RequestHandlersBuilder}; use crate::{ rpcs::{ info::{GetPeers, GetReward, GetStatus, GetTransaction}, - state::{GetAddressableEntity, QueryBalanceDetails}, + state::{GetAddressableEntity, GetPackage, QueryBalanceDetails}, }, NodeClient, }; @@ -50,6 +50,7 @@ pub async fn run( GetBalance::register_as_handler(node.clone(), &mut handlers); GetAccountInfo::register_as_handler(node.clone(), &mut handlers); GetAddressableEntity::register_as_handler(node.clone(), &mut handlers); + GetPackage::register_as_handler(node.clone(), &mut handlers); GetDeploy::register_as_handler(node.clone(), &mut handlers); GetTransaction::register_as_handler(node.clone(), &mut handlers); GetPeers::register_as_handler(node.clone(), &mut handlers); diff --git a/rpc_sidecar/src/node_client.rs b/rpc_sidecar/src/node_client.rs index 79817520..395d4ef5 100644 --- a/rpc_sidecar/src/node_client.rs +++ b/rpc_sidecar/src/node_client.rs @@ -15,17 +15,19 @@ use std::{ use tokio_util::codec::Framed; use casper_binary_port::{ - BalanceResponse, BinaryMessage, BinaryMessageCodec, BinaryRequest, BinaryResponse, - BinaryResponseAndRequest, ConsensusValidatorChanges, DictionaryItemIdentifier, - DictionaryQueryResult, EraIdentifier, ErrorCode, GetRequest, GetTrieFullResult, - GlobalStateQueryResult, GlobalStateRequest, InformationRequest, KeyPrefix, NodeStatus, - PayloadEntity, PurseIdentifier, RecordId, RewardResponse, SpeculativeExecutionResult, - TransactionWithExecutionInfo, + AccountInformation, AddressableEntityInformation, BalanceResponse, BinaryMessage, + BinaryMessageCodec, BinaryRequest, BinaryResponse, BinaryResponseAndRequest, + ConsensusValidatorChanges, ContractInformation, DictionaryItemIdentifier, + DictionaryQueryResult, EntityIdentifier, EraIdentifier, ErrorCode, GetRequest, + GetTrieFullResult, GlobalStateQueryResult, GlobalStateRequest, InformationRequest, KeyPrefix, + NodeStatus, PackageIdentifier, PayloadEntity, PurseIdentifier, RecordId, ResponseType, + RewardResponse, SpeculativeExecutionResult, TransactionWithExecutionInfo, ValueWithProof, }; use casper_types::{ bytesrepr::{self, FromBytes, ToBytes}, + contracts::ContractPackage, AvailableBlockRange, BlockHash, BlockHeader, BlockIdentifier, ChainspecRawBytes, Digest, - GlobalStateIdentifier, Key, KeyTag, Peers, ProtocolVersion, PublicKey, SignedBlock, + GlobalStateIdentifier, Key, KeyTag, Package, Peers, ProtocolVersion, PublicKey, SignedBlock, StoredValue, Transaction, TransactionHash, Transfer, }; use std::{ @@ -266,6 +268,53 @@ pub trait NodeClient: Send + Sync { .await?; parse_response::(&resp.into()) } + + async fn read_package( + &self, + state_identifier: Option, + identifier: PackageIdentifier, + ) -> Result, Error> { + let get = InformationRequest::Package { + state_identifier, + identifier, + }; + let resp = self.read_info(get).await?; + match resp.response().returned_data_type_tag() { + Some(type_tag) if type_tag == ResponseType::ContractPackageWithProof as u8 => Ok( + parse_response::>(&resp.into())? + .map(PackageResponse::ContractPackage), + ), + _ => Ok(parse_response::>(&resp.into())? + .map(PackageResponse::Package)), + } + } + + async fn read_entity( + &self, + state_identifier: Option, + identifier: EntityIdentifier, + include_bytecode: bool, + ) -> Result, Error> { + let get = InformationRequest::Entity { + state_identifier, + identifier, + include_bytecode, + }; + let resp = self.read_info(get).await?; + match resp.response().returned_data_type_tag() { + Some(type_tag) if type_tag == ResponseType::ContractInformation as u8 => { + Ok(parse_response::(&resp.into())? + .map(EntityResponse::Contract)) + } + Some(type_tag) if type_tag == ResponseType::AccountInformation as u8 => Ok( + parse_response::(&resp.into())?.map(EntityResponse::Account), + ), + _ => Ok( + parse_response::(&resp.into())? + .map(EntityResponse::Entity), + ), + } + } } #[derive(Debug, thiserror::Error, PartialEq, Eq)] @@ -968,6 +1017,19 @@ impl NodeClient for FramedNodeClient { } } +#[derive(Debug)] +pub enum EntityResponse { + Entity(AddressableEntityInformation), + Account(AccountInformation), + Contract(ContractInformation), +} + +#[derive(Debug)] +pub enum PackageResponse { + Package(ValueWithProof), + ContractPackage(ValueWithProof), +} + fn validate_response( resp: BinaryResponseAndRequest, expected_id: u16, @@ -1002,7 +1064,7 @@ where return Err(Error::from_error_code(resp.error_code())); } match resp.returned_data_type_tag() { - Some(found) if found == u8::from(A::PAYLOAD_TYPE) => { + Some(found) if found == u8::from(A::RESPONSE_TYPE) => { bytesrepr::deserialize_from_slice(resp.payload()) .map(Some) .map_err(|err| Error::Deserialization(err.to_string())) @@ -1023,7 +1085,7 @@ where return Err(Error::from_error_code(resp.error_code())); } match resp.returned_data_type_tag() { - Some(found) if found == u8::from(A::PAYLOAD_TYPE) => bincode::deserialize(resp.payload()) + Some(found) if found == u8::from(A::RESPONSE_TYPE) => bincode::deserialize(resp.payload()) .map(Some) .map_err(|err| Error::Deserialization(err.to_string())), Some(other) => Err(Error::UnexpectedVariantReceived(other)), diff --git a/rpc_sidecar/src/rpcs/common.rs b/rpc_sidecar/src/rpcs/common.rs index 74c64751..62d30654 100644 --- a/rpc_sidecar/src/rpcs/common.rs +++ b/rpc_sidecar/src/rpcs/common.rs @@ -1,16 +1,16 @@ use std::collections::BTreeMap; -use casper_binary_port::{GlobalStateQueryResult, KeyPrefix}; +use casper_binary_port::KeyPrefix; use once_cell::sync::Lazy; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use crate::rpcs::error::Error; use casper_types::{ - account::AccountHash, addressable_entity::NamedKeys, bytesrepr::ToBytes, + addressable_entity::NamedKeys, bytesrepr::ToBytes, contracts::ContractPackage, global_state::TrieMerkleProof, Account, AddressableEntity, AvailableBlockRange, BlockHeader, - BlockIdentifier, EntityAddr, EntryPointValue, GlobalStateIdentifier, Key, SignedBlock, - StoredValue, + BlockIdentifier, ByteCode, Contract, ContractWasm, EntityAddr, EntryPointValue, + GlobalStateIdentifier, Key, Package, SignedBlock, StoredValue, }; use crate::NodeClient; @@ -43,9 +43,9 @@ pub enum ErrorData { }, } -/// An addressable entity or a legacy account. +/// An addressable entity or a legacy account or contract. #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] -pub enum EntityOrAccount { +pub enum EntityWithBackwardCompat { /// An addressable entity. AddressableEntity { /// The addressable entity. @@ -54,9 +54,55 @@ pub enum EntityOrAccount { named_keys: NamedKeys, /// The entry points of the addressable entity. entry_points: Vec, + /// The bytecode of the addressable entity. Returned when `include_bytecode` is `true`. + bytecode: Option, }, - /// A legacy account. - LegacyAccount(Account), + /// An account. + Account(Account), + /// A contract. + Contract { + /// The contract. + contract: Contract, + /// The Wasm code of the contract. Returned when `include_bytecode` is `true`. + wasm: Option, + }, +} + +/// A package or a legacy contract package. +#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] +pub enum PackageWithBackwardCompat { + /// A package. + Package(Package), + /// A contract package. + ContractPackage(ContractPackage), +} + +/// Byte code of an entity with a proof. +#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] +pub struct ByteCodeWithProof { + code: ByteCode, + merkle_proof: String, +} + +impl ByteCodeWithProof { + /// Creates a new `ByteCodeWithProof`. + pub fn new(code: ByteCode, merkle_proof: String) -> Self { + Self { code, merkle_proof } + } +} + +/// Wasm code of a contract with a proof. +#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] +pub struct ContractWasmWithProof { + wasm: ContractWasm, + merkle_proof: String, +} + +impl ContractWasmWithProof { + /// Creates a new `ContractWasmWithProof`. + pub fn new(wasm: ContractWasm, merkle_proof: String) -> Self { + Self { wasm, merkle_proof } + } } pub async fn get_signed_block( @@ -118,87 +164,6 @@ pub async fn get_latest_switch_block_header( } } -pub async fn resolve_account_hash( - node_client: &dyn NodeClient, - account_hash: AccountHash, - state_identifier: Option, -) -> Result>, Error> { - let account_key = Key::Account(account_hash); - let Some((stored_value, account_merkle_proof)) = node_client - .query_global_state(state_identifier, account_key, vec![]) - .await - .map_err(|err| Error::NodeRequest("account stored value", err))? - .map(GlobalStateQueryResult::into_inner) - else { - return Ok(None); - }; - - let (value, merkle_proof) = match stored_value { - StoredValue::Account(account) => ( - EntityOrAccount::LegacyAccount(account), - account_merkle_proof, - ), - StoredValue::CLValue(entity_key_as_clvalue) => { - let key: Key = entity_key_as_clvalue - .into_t() - .map_err(|_| Error::InvalidAddressableEntity)?; - let Some((value, merkle_proof)) = node_client - .query_global_state(state_identifier, key, vec![]) - .await - .map_err(|err| Error::NodeRequest("account owning a purse", err))? - .map(GlobalStateQueryResult::into_inner) - else { - return Ok(None); - }; - let (Key::AddressableEntity(entity_addr), StoredValue::AddressableEntity(entity)) = - (key, value) - else { - return Err(Error::InvalidAddressableEntity); - }; - let named_keys = - get_entity_named_keys(node_client, entity_addr, state_identifier).await?; - let entry_points = - get_entity_entry_points(node_client, entity_addr, state_identifier).await?; - ( - EntityOrAccount::AddressableEntity { - entity, - named_keys, - entry_points, - }, - merkle_proof, - ) - } - _ => return Err(Error::InvalidAccountInfo), - }; - Ok(Some(SuccessfulQueryResult { - value, - merkle_proof, - })) -} - -pub async fn resolve_entity_addr( - node_client: &dyn NodeClient, - entity_addr: EntityAddr, - state_identifier: Option, -) -> Result>, Error> { - let entity_key = Key::AddressableEntity(entity_addr); - let Some((value, merkle_proof)) = node_client - .query_global_state(state_identifier, entity_key, vec![]) - .await - .map_err(|err| Error::NodeRequest("entity stored value", err))? - .map(GlobalStateQueryResult::into_inner) - else { - return Ok(None); - }; - - Ok(Some(SuccessfulQueryResult { - value: value - .into_addressable_entity() - .ok_or(Error::InvalidAddressableEntity)?, - merkle_proof, - })) -} - pub async fn get_entity_named_keys( node_client: &dyn NodeClient, entity_addr: EntityAddr, @@ -271,15 +236,3 @@ pub fn encode_proof(proof: &Vec>) -> Result { - pub value: A, - pub merkle_proof: Vec>, -} - -impl SuccessfulQueryResult { - pub fn into_inner(self) -> (A, Vec>) { - (self.value, self.merkle_proof) - } -} diff --git a/rpc_sidecar/src/rpcs/docs.rs b/rpc_sidecar/src/rpcs/docs.rs index 772f892e..17ab2ae4 100644 --- a/rpc_sidecar/src/rpcs/docs.rs +++ b/rpc_sidecar/src/rpcs/docs.rs @@ -24,7 +24,7 @@ use super::{ }, state::{ GetAccountInfo, GetAddressableEntity, GetAuctionInfo, GetBalance, GetDictionaryItem, - GetItem, QueryBalance, QueryBalanceDetails, QueryGlobalState, + GetItem, GetPackage, QueryBalance, QueryBalanceDetails, QueryGlobalState, }, ApiVersion, NodeClient, RpcError, RpcWithOptionalParams, RpcWithParams, RpcWithoutParams, CURRENT_API_VERSION, @@ -77,6 +77,7 @@ pub(crate) static OPEN_RPC_SCHEMA: Lazy = Lazy::new(|| { schema.push_with_params::("returns an Account from the network"); schema .push_with_params::("returns an AddressableEntity from the network"); + schema.push_with_params::("returns a Package from the network"); schema.push_with_params::("returns an item from a Dictionary"); schema.push_with_params::( "a query to global state using either a Block hash or state root hash", diff --git a/rpc_sidecar/src/rpcs/state.rs b/rpc_sidecar/src/rpcs/state.rs index aeee966e..5f439ef4 100644 --- a/rpc_sidecar/src/rpcs/state.rs +++ b/rpc_sidecar/src/rpcs/state.rs @@ -7,20 +7,28 @@ use once_cell::sync::Lazy; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; +use crate::node_client::{EntityResponse, PackageResponse}; + use super::{ - common::{self, EntityOrAccount, MERKLE_PROOF}, + common::{ + self, ByteCodeWithProof, ContractWasmWithProof, EntityWithBackwardCompat, + PackageWithBackwardCompat, MERKLE_PROOF, + }, docs::{DocExample, DOCS_EXAMPLE_API_VERSION}, ApiVersion, Error, NodeClient, RpcError, RpcWithOptionalParams, RpcWithParams, CURRENT_API_VERSION, }; -use casper_binary_port::DictionaryItemIdentifier; -use casper_binary_port::PurseIdentifier as PortPurseIdentifier; +use casper_binary_port::{ + DictionaryItemIdentifier, EntityIdentifier as PortEntityIdentifier, + PackageIdentifier as PortPackageIdentifier, PurseIdentifier as PortPurseIdentifier, +}; #[cfg(test)] use casper_types::testing::TestRng; use casper_types::{ account::{Account, AccountHash}, addressable_entity::EntityKindTag, bytesrepr::Bytes, + contracts::{ContractHash, ContractPackageHash}, system::{ auction::{ BidKind, EraValidators, SeigniorageRecipientsSnapshot, ValidatorWeights, @@ -30,7 +38,8 @@ use casper_types::{ }, AddressableEntity, AddressableEntityHash, AuctionState, BlockHash, BlockHeader, BlockHeaderV2, BlockIdentifier, BlockTime, BlockV2, CLValue, Digest, EntityAddr, EntryPoint, EntryPointValue, - GlobalStateIdentifier, Key, KeyTag, PublicKey, SecretKey, StoredValue, URef, U512, + GlobalStateIdentifier, Key, KeyTag, Package, PackageHash, PublicKey, SecretKey, StoredValue, + URef, U512, }; #[cfg(test)] use rand::Rng; @@ -82,12 +91,13 @@ static GET_ADDRESSABLE_ENTITY_PARAMS: Lazy = Lazy::new(|| GetAddressableEntityParams { entity_identifier: EntityIdentifier::EntityAddr(EntityAddr::new_account([0; 32])), block_identifier: Some(BlockIdentifier::Hash(*BlockHash::example())), + include_bytecode: None, }); static GET_ADDRESSABLE_ENTITY_RESULT: Lazy = Lazy::new(|| GetAddressableEntityResult { api_version: DOCS_EXAMPLE_API_VERSION, merkle_proof: MERKLE_PROOF.clone(), - entity: EntityOrAccount::AddressableEntity { + entity: EntityWithBackwardCompat::AddressableEntity { entity: AddressableEntity::example().clone(), named_keys: [("key".to_string(), Key::Hash([0u8; 32]))] .iter() @@ -97,8 +107,26 @@ static GET_ADDRESSABLE_ENTITY_RESULT: Lazy = entry_points: vec![EntryPointValue::new_v1_entry_point_value( EntryPoint::default_with_name("entry_point"), )], + bytecode: None, }, }); +static GET_PACKAGE_PARAMS: Lazy = Lazy::new(|| GetPackageParams { + package_identifier: PackageIdentifier::ContractPackageHash(ContractPackageHash::new([0; 32])), + block_identifier: Some(BlockIdentifier::Hash(*BlockHash::example())), +}); +static GET_PACKAGE_RESULT: Lazy = Lazy::new(|| GetPackageResult { + api_version: DOCS_EXAMPLE_API_VERSION, + package: PackageWithBackwardCompat::Package( + Package::new( + Default::default(), + Default::default(), + Default::default(), + Default::default(), + ) + .clone(), + ), + merkle_proof: MERKLE_PROOF.clone(), +}); static GET_DICTIONARY_ITEM_PARAMS: Lazy = Lazy::new(|| GetDictionaryItemParams { state_root_hash: *BlockHeaderV2::example().state_root_hash(), @@ -525,6 +553,8 @@ impl RpcWithParams for GetAccountInfo { #[derive(Serialize, Deserialize, Debug, Clone, JsonSchema)] #[serde(deny_unknown_fields)] pub enum EntityIdentifier { + /// The hash of a contract. + ContractHash(ContractHash), /// The public key of an account. PublicKey(PublicKey), /// The account hash of an account. @@ -543,6 +573,21 @@ impl EntityIdentifier { _ => unreachable!(), } } + + pub fn into_port_entity_identifier(self) -> PortEntityIdentifier { + match self { + EntityIdentifier::ContractHash(contract_hash) => { + PortEntityIdentifier::ContractHash(contract_hash) + } + EntityIdentifier::PublicKey(public_key) => PortEntityIdentifier::PublicKey(public_key), + EntityIdentifier::AccountHash(account_hash) => { + PortEntityIdentifier::AccountHash(account_hash) + } + EntityIdentifier::EntityAddr(entity_addr) => { + PortEntityIdentifier::EntityAddr(entity_addr) + } + } + } } /// Params for "state_get_entity" RPC request @@ -553,6 +598,8 @@ pub struct GetAddressableEntityParams { pub entity_identifier: EntityIdentifier, /// The block identifier. pub block_identifier: Option, + /// Whether to include the entity's bytecode in the response. + pub include_bytecode: Option, } impl DocExample for GetAddressableEntityParams { @@ -569,7 +616,7 @@ pub struct GetAddressableEntityResult { #[schemars(with = "String")] pub api_version: ApiVersion, /// The addressable entity or a legacy account. - pub entity: EntityOrAccount, + pub entity: EntityWithBackwardCompat, /// The Merkle proof. pub merkle_proof: String, } @@ -594,38 +641,58 @@ impl RpcWithParams for GetAddressableEntity { params: Self::RequestParams, ) -> Result { let state_identifier = params.block_identifier.map(GlobalStateIdentifier::from); - let (entity, merkle_proof) = match params.entity_identifier { - EntityIdentifier::EntityAddr(addr) => { - let result = common::resolve_entity_addr(&*node_client, addr, state_identifier) - .await? - .ok_or(Error::AddressableEntityNotFound)?; + let identifier = params.entity_identifier.into_port_entity_identifier(); + let include_bytecode = params.include_bytecode.unwrap_or(false); + + let (entity, merkle_proof) = match node_client + .read_entity(state_identifier, identifier, include_bytecode) + .await + .map_err(|err| Error::NodeRequest("entity", err))? + .ok_or(Error::AddressableEntityNotFound)? + { + EntityResponse::Entity(entity_with_bytecode) => { + let (addr, entity_with_proof, bytecode) = entity_with_bytecode.into_inner(); + let (entity, proof) = entity_with_proof.into_inner(); let named_keys = common::get_entity_named_keys(&*node_client, addr, state_identifier).await?; let entry_points = common::get_entity_entry_points(&*node_client, addr, state_identifier).await?; + let bytecode = bytecode + .map(|code_with_proof| { + let (code, proof) = code_with_proof.into_inner(); + Ok::<_, Error>(ByteCodeWithProof::new(code, common::encode_proof(&proof)?)) + }) + .transpose()?; ( - EntityOrAccount::AddressableEntity { - entity: result.value, + EntityWithBackwardCompat::AddressableEntity { + entity, named_keys, entry_points, + bytecode, }, - result.merkle_proof, + proof, ) } - EntityIdentifier::PublicKey(public_key) => { - let account_hash = public_key.to_account_hash(); - common::resolve_account_hash(&*node_client, account_hash, state_identifier) - .await? - .ok_or(Error::AddressableEntityNotFound)? - .into_inner() + EntityResponse::Account(account) => { + let (account, merkle_proof) = account.into_inner(); + (EntityWithBackwardCompat::Account(account), merkle_proof) } - EntityIdentifier::AccountHash(account_hash) => { - common::resolve_account_hash(&*node_client, account_hash, state_identifier) - .await? - .ok_or(Error::AddressableEntityNotFound)? - .into_inner() + EntityResponse::Contract(contract_with_wasm) => { + let (_, contract_with_proof, wasm) = contract_with_wasm.into_inner(); + let (contract, proof) = contract_with_proof.into_inner(); + let wasm = wasm + .map(|wasm_with_proof| { + let (wasm, proof) = wasm_with_proof.into_inner(); + Ok::<_, Error>(ContractWasmWithProof::new( + wasm, + common::encode_proof(&proof)?, + )) + }) + .transpose()?; + (EntityWithBackwardCompat::Contract { contract, wasm }, proof) } }; + Ok(Self::ResponseResult { api_version: CURRENT_API_VERSION, entity, @@ -634,6 +701,116 @@ impl RpcWithParams for GetAddressableEntity { } } +/// Identifier of a package. +#[derive(Serialize, Deserialize, Debug, Clone, JsonSchema)] +#[serde(deny_unknown_fields)] +pub enum PackageIdentifier { + /// The address of a package. + PackageAddr(PackageHash), + /// The hash of a contract package. + ContractPackageHash(ContractPackageHash), +} + +impl PackageIdentifier { + #[cfg(test)] + pub fn random(rng: &mut TestRng) -> Self { + match rng.gen_range(0..2) { + 0 => Self::PackageAddr(PackageHash::new(rng.gen())), + 1 => Self::ContractPackageHash(ContractPackageHash::new(rng.gen())), + _ => unreachable!(), + } + } + + pub fn into_port_package_identifier(self) -> PortPackageIdentifier { + match self { + Self::PackageAddr(package_addr) => { + PortPackageIdentifier::PackageAddr(package_addr.value()) + } + Self::ContractPackageHash(contract_package_hash) => { + PortPackageIdentifier::ContractPackageHash(contract_package_hash) + } + } + } +} + +/// Params for "state_get_entity" RPC request +#[derive(Serialize, Deserialize, Debug, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct GetPackageParams { + /// The identifier of the package. + pub package_identifier: PackageIdentifier, + /// The block identifier. + pub block_identifier: Option, +} + +impl DocExample for GetPackageParams { + fn doc_example() -> &'static Self { + &GET_PACKAGE_PARAMS + } +} + +/// Result for "state_get_entity" RPC response. +#[derive(PartialEq, Eq, Serialize, Deserialize, Debug, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct GetPackageResult { + /// The RPC API version. + #[schemars(with = "String")] + pub api_version: ApiVersion, + /// The addressable entity or a legacy account. + pub package: PackageWithBackwardCompat, + /// The Merkle proof. + pub merkle_proof: String, +} + +impl DocExample for GetPackageResult { + fn doc_example() -> &'static Self { + &GET_PACKAGE_RESULT + } +} + +/// "state_get_package" RPC. +pub struct GetPackage {} + +#[async_trait] +impl RpcWithParams for GetPackage { + const METHOD: &'static str = "state_get_package"; + type RequestParams = GetPackageParams; + type ResponseResult = GetPackageResult; + + async fn do_handle_request( + node_client: Arc, + params: Self::RequestParams, + ) -> Result { + let state_identifier = params.block_identifier.map(GlobalStateIdentifier::from); + let identifier = params.package_identifier.into_port_package_identifier(); + + let (package, merkle_proof) = match node_client + .read_package(state_identifier, identifier) + .await + .map_err(|err| Error::NodeRequest("package", err))? + .ok_or(Error::AddressableEntityNotFound)? + { + PackageResponse::Package(package_with_proof) => { + let (package, proof) = package_with_proof.into_inner(); + (PackageWithBackwardCompat::Package(package), proof) + } + PackageResponse::ContractPackage(contract_package_with_proof) => { + let (contract_package, proof) = contract_package_with_proof.into_inner(); + ( + PackageWithBackwardCompat::ContractPackage(contract_package), + proof, + ) + } + }; + + Ok(Self::ResponseResult { + api_version: CURRENT_API_VERSION, + package, + merkle_proof: common::encode_proof(&merkle_proof)?, + }) + } +} + #[derive(Serialize, Deserialize, Debug, JsonSchema, Clone)] /// Options for dictionary item lookups. pub enum DictionaryIdentifier { @@ -1146,17 +1323,20 @@ mod tests { use crate::{rpcs::ErrorCode, ClientError, SUPPORTED_PROTOCOL_VERSION}; use casper_binary_port::{ - BalanceResponse, BinaryRequest, BinaryResponse, BinaryResponseAndRequest, - DictionaryQueryResult, ErrorCode as BinaryErrorCode, GetRequest, GlobalStateQueryResult, - GlobalStateRequest, InformationRequestTag, KeyPrefix, + AccountInformation, AddressableEntityInformation, BalanceResponse, BinaryRequest, + BinaryResponse, BinaryResponseAndRequest, ContractInformation, DictionaryQueryResult, + ErrorCode as BinaryErrorCode, GetRequest, GlobalStateQueryResult, GlobalStateRequest, + InformationRequestTag, KeyPrefix, ValueWithProof, }; use casper_types::{ addressable_entity::{MessageTopics, NamedKeyValue, NamedKeys}, + contracts::ContractPackage, global_state::{TrieMerkleProof, TrieMerkleProofStep}, system::auction::{Bid, BidKind, ValidatorBid}, testing::TestRng, - AccessRights, AddressableEntity, AvailableBlockRange, Block, ByteCodeHash, EntityKind, - PackageHash, ProtocolVersion, TestBlockBuilder, TransactionRuntime, + AccessRights, AddressableEntity, AvailableBlockRange, Block, ByteCode, ByteCodeHash, + ByteCodeKind, Contract, ContractWasm, ContractWasmHash, EntityKind, PackageHash, + ProtocolVersion, TestBlockBuilder, TransactionRuntime, }; use pretty_assertions::assert_eq; use rand::Rng; @@ -1620,10 +1800,11 @@ mod tests { use casper_types::addressable_entity::{ActionThresholds, AssociatedKeys}; struct ClientMock { + addr: EntityAddr, entity: AddressableEntity, named_keys: NamedKeys, entry_points: Vec, - entity_hash: AddressableEntityHash, + bytecode: Option, } #[async_trait] @@ -1633,44 +1814,18 @@ mod tests { req: BinaryRequest, ) -> Result { match req { - BinaryRequest::Get(GetRequest::State(req)) - if matches!( - &*req, - GlobalStateRequest::Item { - base_key: Key::Account(_), - .. - } - ) => - { - Ok(BinaryResponseAndRequest::new( - BinaryResponse::from_value( - GlobalStateQueryResult::new( - StoredValue::CLValue( - CLValue::from_t(Key::contract_entity_key(self.entity_hash)) - .unwrap(), - ), - vec![], - ), - SUPPORTED_PROTOCOL_VERSION, - ), - &[], - 0, - )) - } - BinaryRequest::Get(GetRequest::State(req)) - if matches!( - &*req, - GlobalStateRequest::Item { - base_key: Key::AddressableEntity(_), - .. - } - ) => + BinaryRequest::Get(GetRequest::Information { info_type_tag, .. }) + if InformationRequestTag::try_from(info_type_tag) + == Ok(InformationRequestTag::Entity) => { Ok(BinaryResponseAndRequest::new( BinaryResponse::from_value( - GlobalStateQueryResult::new( - StoredValue::AddressableEntity(self.entity.clone()), - vec![], + AddressableEntityInformation::new( + self.addr, + ValueWithProof::new(self.entity.clone(), vec![]), + self.bytecode.as_ref().map(|bytecode| { + ValueWithProof::new(bytecode.clone(), vec![]) + }), ), SUPPORTED_PROTOCOL_VERSION, ), @@ -1760,7 +1915,7 @@ mod tests { MessageTopics::default(), EntityKind::SmartContract(TransactionRuntime::VmCasperV2), ); - let entity_hash: AddressableEntityHash = rng.gen(); + let addr: EntityAddr = rng.gen(); let named_key_count = rng.gen_range(0..10); let named_keys: NamedKeys = @@ -1777,18 +1932,24 @@ mod tests { .take(entry_point_count) .collect::>(); + let bytecode = rng + .gen::() + .then(|| ByteCode::new(ByteCodeKind::V1CasperWasm, rng.random_vec(10..50))); + let entity_identifier = EntityIdentifier::random(rng); let resp = GetAddressableEntity::do_handle_request( Arc::new(ClientMock { + addr, entity: entity.clone(), named_keys: named_keys.clone(), entry_points: entry_points.clone(), - entity_hash, + bytecode: bytecode.clone(), }), GetAddressableEntityParams { block_identifier: None, entity_identifier, + include_bytecode: Some(bytecode.is_some()), }, ) .await @@ -1798,10 +1959,12 @@ mod tests { resp, GetAddressableEntityResult { api_version: CURRENT_API_VERSION, - entity: EntityOrAccount::AddressableEntity { + entity: EntityWithBackwardCompat::AddressableEntity { entity, named_keys, - entry_points + entry_points, + bytecode: bytecode + .map(|bytecode| ByteCodeWithProof::new(bytecode, String::from("00000000"))), }, merkle_proof: String::from("00000000"), } @@ -1813,7 +1976,6 @@ mod tests { use casper_types::account::{ActionThresholds, AssociatedKeys}; let rng = &mut TestRng::new(); - let block = Block::V2(TestBlockBuilder::new().build(rng)); let account = Account::new( rng.gen(), NamedKeys::default(), @@ -1825,12 +1987,12 @@ mod tests { let resp = GetAddressableEntity::do_handle_request( Arc::new(ValidLegacyAccountMock { - block: block.clone(), account: account.clone(), }), GetAddressableEntityParams { block_identifier: None, entity_identifier, + include_bytecode: None, }, ) .await @@ -1840,16 +2002,18 @@ mod tests { resp, GetAddressableEntityResult { api_version: CURRENT_API_VERSION, - entity: EntityOrAccount::LegacyAccount(account), + entity: EntityWithBackwardCompat::Account(account), merkle_proof: String::from("00000000"), } ); } #[tokio::test] - async fn should_reject_read_entity_when_non_existent() { + async fn should_read_entity_legacy_contract() { struct ClientMock { - block: Block, + hash: ContractHash, + contract: Contract, + wasm: Option, } #[async_trait] @@ -1861,25 +2025,87 @@ mod tests { match req { BinaryRequest::Get(GetRequest::Information { info_type_tag, .. }) if InformationRequestTag::try_from(info_type_tag) - == Ok(InformationRequestTag::BlockHeader) => + == Ok(InformationRequestTag::Entity) => { Ok(BinaryResponseAndRequest::new( BinaryResponse::from_value( - self.block.clone_header(), + ContractInformation::new( + self.hash, + ValueWithProof::new(self.contract.clone(), vec![]), + self.wasm.as_ref().map(|bytecode| { + ValueWithProof::new(bytecode.clone(), vec![]) + }), + ), SUPPORTED_PROTOCOL_VERSION, ), &[], 0, )) } - BinaryRequest::Get(GetRequest::State(req)) - if matches!( - &*req, - GlobalStateRequest::Item { - base_key: Key::AddressableEntity(_), - .. - } - ) => + req => unimplemented!("unexpected request: {:?}", req), + } + } + } + + let rng = &mut TestRng::new(); + let contract = Contract::new( + ContractPackageHash::new(rng.gen()), + ContractWasmHash::new(rng.gen()), + Default::default(), + Default::default(), + ProtocolVersion::V2_0_0, + ); + let hash = ContractHash::new(rng.gen()); + + let wasm = rng + .gen::() + .then(|| ContractWasm::new(rng.random_vec(10..50))); + + let entity_identifier = EntityIdentifier::random(rng); + + let resp = GetAddressableEntity::do_handle_request( + Arc::new(ClientMock { + hash, + contract: contract.clone(), + wasm: wasm.clone(), + }), + GetAddressableEntityParams { + block_identifier: None, + entity_identifier, + include_bytecode: Some(wasm.is_some()), + }, + ) + .await + .expect("should handle request"); + + assert_eq!( + resp, + GetAddressableEntityResult { + api_version: CURRENT_API_VERSION, + entity: EntityWithBackwardCompat::Contract { + contract, + wasm: wasm + .map(|wasm| ContractWasmWithProof::new(wasm, String::from("00000000"))), + }, + merkle_proof: String::from("00000000"), + } + ); + } + + #[tokio::test] + async fn should_reject_read_entity_when_non_existent() { + struct ClientMock; + + #[async_trait] + impl NodeClient for ClientMock { + async fn send_request( + &self, + req: BinaryRequest, + ) -> Result { + match req { + BinaryRequest::Get(GetRequest::Information { info_type_tag, .. }) + if InformationRequestTag::try_from(info_type_tag) + == Ok(InformationRequestTag::Entity) => { Ok(BinaryResponseAndRequest::new( BinaryResponse::new_empty(SUPPORTED_PROTOCOL_VERSION), @@ -1893,16 +2119,14 @@ mod tests { } let rng = &mut TestRng::new(); - let block = Block::V2(TestBlockBuilder::new().build(rng)); let entity_identifier = EntityIdentifier::EntityAddr(rng.gen()); let err = GetAddressableEntity::do_handle_request( - Arc::new(ClientMock { - block: block.clone(), - }), + Arc::new(ClientMock), GetAddressableEntityParams { block_identifier: None, entity_identifier, + include_bytecode: None, }, ) .await @@ -1911,12 +2135,138 @@ mod tests { assert_eq!(err.code(), ErrorCode::NoSuchAddressableEntity as i64); } + #[tokio::test] + async fn should_read_package() { + struct ClientMock { + package: Package, + } + + #[async_trait] + impl NodeClient for ClientMock { + async fn send_request( + &self, + req: BinaryRequest, + ) -> Result { + match req { + BinaryRequest::Get(GetRequest::Information { info_type_tag, .. }) + if InformationRequestTag::try_from(info_type_tag) + == Ok(InformationRequestTag::Package) => + { + Ok(BinaryResponseAndRequest::new( + BinaryResponse::from_value( + ValueWithProof::new(self.package.clone(), vec![]), + SUPPORTED_PROTOCOL_VERSION, + ), + &[], + 0, + )) + } + req => unimplemented!("unexpected request: {:?}", req), + } + } + } + + let rng = &mut TestRng::new(); + let package = Package::new( + Default::default(), + Default::default(), + Default::default(), + Default::default(), + ); + + let package_identifier = PackageIdentifier::random(rng); + + let resp = GetPackage::do_handle_request( + Arc::new(ClientMock { + package: package.clone(), + }), + GetPackageParams { + block_identifier: None, + package_identifier, + }, + ) + .await + .expect("should handle request"); + + assert_eq!( + resp, + GetPackageResult { + api_version: CURRENT_API_VERSION, + package: PackageWithBackwardCompat::Package(package), + merkle_proof: String::from("00000000"), + } + ); + } + + #[tokio::test] + async fn should_read_contract_package() { + struct ClientMock { + package: ContractPackage, + } + + #[async_trait] + impl NodeClient for ClientMock { + async fn send_request( + &self, + req: BinaryRequest, + ) -> Result { + match req { + BinaryRequest::Get(GetRequest::Information { info_type_tag, .. }) + if InformationRequestTag::try_from(info_type_tag) + == Ok(InformationRequestTag::Package) => + { + Ok(BinaryResponseAndRequest::new( + BinaryResponse::from_value( + ValueWithProof::new(self.package.clone(), vec![]), + SUPPORTED_PROTOCOL_VERSION, + ), + &[], + 0, + )) + } + req => unimplemented!("unexpected request: {:?}", req), + } + } + } + + let rng = &mut TestRng::new(); + let package = ContractPackage::new( + rng.gen(), + Default::default(), + Default::default(), + Default::default(), + Default::default(), + ); + + let package_identifier = PackageIdentifier::random(rng); + + let resp = GetPackage::do_handle_request( + Arc::new(ClientMock { + package: package.clone(), + }), + GetPackageParams { + block_identifier: None, + package_identifier, + }, + ) + .await + .expect("should handle request"); + + assert_eq!( + resp, + GetPackageResult { + api_version: CURRENT_API_VERSION, + package: PackageWithBackwardCompat::ContractPackage(package), + merkle_proof: String::from("00000000"), + } + ); + } + #[tokio::test] async fn should_read_account_info() { use casper_types::account::{ActionThresholds, AssociatedKeys}; let rng = &mut TestRng::new(); - let block = Block::V2(TestBlockBuilder::new().build(rng)); let account = Account::new( rng.gen(), NamedKeys::default(), @@ -1928,7 +2278,6 @@ mod tests { let resp = GetAccountInfo::do_handle_request( Arc::new(ValidLegacyAccountMock { - block: block.clone(), account: account.clone(), }), GetAccountInfoParams { @@ -2332,7 +2681,6 @@ mod tests { } struct ValidLegacyAccountMock { - block: Block, account: Account, } @@ -2345,11 +2693,11 @@ mod tests { match req { BinaryRequest::Get(GetRequest::Information { info_type_tag, .. }) if InformationRequestTag::try_from(info_type_tag) - == Ok(InformationRequestTag::BlockHeader) => + == Ok(InformationRequestTag::Entity) => { Ok(BinaryResponseAndRequest::new( BinaryResponse::from_value( - self.block.clone_header(), + AccountInformation::new(self.account.clone(), vec![]), SUPPORTED_PROTOCOL_VERSION, ), &[], diff --git a/types/src/legacy_sse_data/fixtures.rs b/types/src/legacy_sse_data/fixtures.rs index b51c4d8f..c444c7b6 100644 --- a/types/src/legacy_sse_data/fixtures.rs +++ b/types/src/legacy_sse_data/fixtures.rs @@ -366,6 +366,7 @@ const RAW_TRANSACTION_ACCEPTED: &str = r#" { "TransactionAccepted": { "Version1": { + "serialization_version": 1, "hash": "2084a40f58874fb2997e029e61ec55e3d5a6cd5f6de77a1d42dcaf21aeddc760", "header": { "chain_name":"⸻⋉◬⸗ⶨ⼄≙⡫⨁ⶃℍ⊨⇏ⴲⲋ⪝⣬ⴂ⨨⪯⿉⺙⚚⻰⒯ⶖ⟽⬪❴⴯╽♥⅏⏵❲⃽ⶁ⾠⸗◩⋑Ⅹ♼⺓⊻⼠Ⓩ∇Ⅺ⸔◘⠝◓⚾◯⦁★⢹␄⍆⨿⵮⭭⮛⸹⃻⹶⎶⟆⛎⤑₇⩐╨⋸⠸₈⥡ⷔ⹪⤛⭺⵫Ⲗ⃁⪏⫵⚎⁘⦳☉␛Ⲹ⥝⇡Ⰰ⫂⁎⍆⼸",