diff --git a/Cargo.lock b/Cargo.lock index b37da5b1a..fc9bbbf93 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -80,7 +80,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 2.0.48", + "syn 2.0.68", ] [[package]] @@ -193,7 +193,7 @@ dependencies = [ "actix-router", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", ] [[package]] @@ -242,7 +242,7 @@ checksum = "9aa0b287c8de4a76b691f29dbb5451e8dd5b79d777eaf87350c9b0cbfdb5e968" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", ] [[package]] @@ -410,7 +410,7 @@ checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", ] [[package]] @@ -624,7 +624,7 @@ source = "git+https://github.com/trilitech/boa.git?branch=ryutamago/fix-undefine dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", "synstructure 0.13.0", ] @@ -827,7 +827,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", ] [[package]] @@ -1048,7 +1048,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", ] [[package]] @@ -1081,7 +1081,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.48", + "syn 2.0.68", ] [[package]] @@ -1092,7 +1092,7 @@ checksum = "1d1545d67a2149e1d93b7e5c7752dce5a7426eb5d1357ddcfd89336b94444f77" dependencies = [ "darling_core", "quote", - "syn 2.0.48", + "syn 2.0.68", ] [[package]] @@ -1132,7 +1132,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", ] [[package]] @@ -1187,7 +1187,16 @@ version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309" dependencies = [ - "dirs-sys", + "dirs-sys 0.3.7", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys 0.4.1", ] [[package]] @@ -1211,6 +1220,18 @@ dependencies = [ "winapi", ] +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + [[package]] name = "dirs-sys-next" version = "0.1.2" @@ -1230,7 +1251,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", ] [[package]] @@ -1603,7 +1624,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", ] [[package]] @@ -2043,7 +2064,7 @@ checksum = "2060258edfcfe32ca7058849bf0f146cb5c59aadbedf480333c0d0002f97bc99" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", ] [[package]] @@ -2224,7 +2245,7 @@ dependencies = [ "daemonize", "derive_more", "dialoguer", - "dirs", + "dirs 3.0.2", "env_logger", "fs_extra", "futures", @@ -2261,7 +2282,7 @@ dependencies = [ "tempfile", "tezos-smart-rollup", "tezos-smart-rollup-mock", - "tezos_crypto_rs", + "tezos_crypto_rs 0.6.0", "tiny-bip39", "tokio", "tokio-util", @@ -2301,7 +2322,7 @@ dependencies = [ "proptest", "serde", "serde_json", - "tezos_crypto_rs", + "tezos_crypto_rs 0.6.0", ] [[package]] @@ -2319,7 +2340,7 @@ dependencies = [ "num-traits", "serde", "tezos-smart-rollup", - "tezos_crypto_rs", + "tezos_crypto_rs 0.6.0", ] [[package]] @@ -2333,7 +2354,7 @@ dependencies = [ "base64 0.13.1", "bincode", "clap 4.4.18", - "dirs", + "dirs 3.0.2", "env_logger", "futures-util", "hex", @@ -2351,8 +2372,8 @@ dependencies = [ "serde_json", "tezos-smart-rollup", "tezos-smart-rollup-encoding", - "tezos_crypto_rs", - "tezos_data_encoding", + "tezos_crypto_rs 0.6.0", + "tezos_data_encoding 0.6.0", "thiserror", "tokio", "tokio-stream", @@ -2387,7 +2408,7 @@ dependencies = [ "bincode", "clap 4.4.18", "derive_more", - "dirs", + "dirs 3.0.2", "figment", "fs_extra", "hex", @@ -2397,7 +2418,7 @@ dependencies = [ "tezos-smart-rollup-host", "tezos-smart-rollup-installer", "tezos-smart-rollup-installer-config", - "tezos_crypto_rs", + "tezos_crypto_rs 0.6.0", ] [[package]] @@ -2767,7 +2788,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", ] [[package]] @@ -2856,7 +2877,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", ] [[package]] @@ -2877,6 +2898,12 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + [[package]] name = "os_str_bytes" version = "6.6.1" @@ -2977,7 +3004,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.48", + "syn 2.0.68", ] [[package]] @@ -3016,7 +3043,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", ] [[package]] @@ -3140,9 +3167,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.76" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] @@ -3155,7 +3182,7 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", "version_check", "yansi", ] @@ -3197,9 +3224,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -3691,7 +3718,7 @@ checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", ] [[package]] @@ -3757,7 +3784,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", ] [[package]] @@ -3814,6 +3841,15 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" +[[package]] +name = "shellexpand" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da03fa3b94cc19e3ebfc88c4229c49d8f08cdbd1228870a45f0ffdf84988e14b" +dependencies = [ + "dirs 5.0.1", +] + [[package]] name = "signal-hook" version = "0.3.17" @@ -4012,9 +4048,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" dependencies = [ "proc-macro2", "quote", @@ -4047,7 +4083,7 @@ checksum = "285ba80e733fac80aa4270fbcdf83772a79b80aa35c97075320abfee4a915b06" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", "unicode-xid", ] @@ -4165,29 +4201,31 @@ checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "tezos-smart-rollup" version = "0.2.2" -source = "git+https://gitlab.com/tezos/tezos.git#391c1f573b989ff8988d313b49b75310ea4f33ce" +source = "git+https://gitlab.com/tezos/tezos.git#048424a9f80d0c516bbf7c3c84307bd488128493" dependencies = [ "hermit", + "hex", "tezos-smart-rollup-core", "tezos-smart-rollup-debug", "tezos-smart-rollup-encoding", "tezos-smart-rollup-entrypoint", "tezos-smart-rollup-host", + "tezos-smart-rollup-macros", "tezos-smart-rollup-mock", "tezos-smart-rollup-storage", - "tezos_crypto_rs", - "tezos_data_encoding", + "tezos_crypto_rs 0.6.0", + "tezos_data_encoding 0.6.0", ] [[package]] name = "tezos-smart-rollup-constants" version = "0.2.2" -source = "git+https://gitlab.com/tezos/tezos.git#391c1f573b989ff8988d313b49b75310ea4f33ce" +source = "git+https://gitlab.com/tezos/tezos.git#048424a9f80d0c516bbf7c3c84307bd488128493" [[package]] name = "tezos-smart-rollup-core" version = "0.2.2" -source = "git+https://gitlab.com/tezos/tezos.git#391c1f573b989ff8988d313b49b75310ea4f33ce" +source = "git+https://gitlab.com/tezos/tezos.git#048424a9f80d0c516bbf7c3c84307bd488128493" dependencies = [ "tezos-smart-rollup-constants", ] @@ -4195,7 +4233,7 @@ dependencies = [ [[package]] name = "tezos-smart-rollup-debug" version = "0.2.2" -source = "git+https://gitlab.com/tezos/tezos.git#391c1f573b989ff8988d313b49b75310ea4f33ce" +source = "git+https://gitlab.com/tezos/tezos.git#048424a9f80d0c516bbf7c3c84307bd488128493" dependencies = [ "tezos-smart-rollup-core", "tezos-smart-rollup-host", @@ -4204,18 +4242,18 @@ dependencies = [ [[package]] name = "tezos-smart-rollup-encoding" version = "0.2.2" -source = "git+https://gitlab.com/tezos/tezos.git#391c1f573b989ff8988d313b49b75310ea4f33ce" +source = "git+https://gitlab.com/tezos/tezos.git#048424a9f80d0c516bbf7c3c84307bd488128493" dependencies = [ "hex", "nom", - "num-bigint 0.3.3", + "num-bigint 0.4.4", "num-traits", + "paste", "regex", "tezos-smart-rollup-core", "tezos-smart-rollup-host", - "tezos_crypto_rs", - "tezos_data_encoding", - "tezos_data_encoding_derive", + "tezos_crypto_rs 0.6.0", + "tezos_data_encoding 0.6.0", "thiserror", "time", ] @@ -4223,8 +4261,9 @@ dependencies = [ [[package]] name = "tezos-smart-rollup-entrypoint" version = "0.2.2" -source = "git+https://gitlab.com/tezos/tezos.git#391c1f573b989ff8988d313b49b75310ea4f33ce" +source = "git+https://gitlab.com/tezos/tezos.git#048424a9f80d0c516bbf7c3c84307bd488128493" dependencies = [ + "cfg-if", "dlmalloc", "tezos-smart-rollup-core", "tezos-smart-rollup-debug", @@ -4235,11 +4274,11 @@ dependencies = [ [[package]] name = "tezos-smart-rollup-host" version = "0.2.2" -source = "git+https://gitlab.com/tezos/tezos.git#391c1f573b989ff8988d313b49b75310ea4f33ce" +source = "git+https://gitlab.com/tezos/tezos.git#048424a9f80d0c516bbf7c3c84307bd488128493" dependencies = [ "tezos-smart-rollup-core", - "tezos_crypto_rs", - "tezos_data_encoding", + "tezos_crypto_rs 0.6.0", + "tezos_data_encoding 0.6.0", "thiserror", ] @@ -4255,7 +4294,7 @@ dependencies = [ "tezos-smart-rollup-encoding", "tezos-smart-rollup-host", "tezos-smart-rollup-installer-config", - "tezos_data_encoding", + "tezos_data_encoding 0.5.2", "thiserror", "wasm-gen", ] @@ -4273,28 +4312,39 @@ dependencies = [ "tezos-smart-rollup-core", "tezos-smart-rollup-encoding", "tezos-smart-rollup-host", - "tezos_crypto_rs", - "tezos_data_encoding", + "tezos_crypto_rs 0.5.2", + "tezos_data_encoding 0.5.2", "thiserror", ] +[[package]] +name = "tezos-smart-rollup-macros" +version = "0.2.2" +source = "git+https://gitlab.com/tezos/tezos.git#048424a9f80d0c516bbf7c3c84307bd488128493" +dependencies = [ + "proc-macro-error", + "quote", + "shellexpand", + "syn 2.0.68", +] + [[package]] name = "tezos-smart-rollup-mock" version = "0.2.2" -source = "git+https://gitlab.com/tezos/tezos.git#391c1f573b989ff8988d313b49b75310ea4f33ce" +source = "git+https://gitlab.com/tezos/tezos.git#048424a9f80d0c516bbf7c3c84307bd488128493" dependencies = [ "hex", "tezos-smart-rollup-core", "tezos-smart-rollup-encoding", "tezos-smart-rollup-host", - "tezos_crypto_rs", - "tezos_data_encoding", + "tezos_crypto_rs 0.6.0", + "tezos_data_encoding 0.6.0", ] [[package]] name = "tezos-smart-rollup-panic-hook" version = "0.2.2" -source = "git+https://gitlab.com/tezos/tezos.git#391c1f573b989ff8988d313b49b75310ea4f33ce" +source = "git+https://gitlab.com/tezos/tezos.git#048424a9f80d0c516bbf7c3c84307bd488128493" dependencies = [ "tezos-smart-rollup-core", ] @@ -4302,7 +4352,7 @@ dependencies = [ [[package]] name = "tezos-smart-rollup-storage" version = "0.2.2" -source = "git+https://gitlab.com/tezos/tezos.git#391c1f573b989ff8988d313b49b75310ea4f33ce" +source = "git+https://gitlab.com/tezos/tezos.git#048424a9f80d0c516bbf7c3c84307bd488128493" dependencies = [ "tezos-smart-rollup-core", "tezos-smart-rollup-debug", @@ -4335,6 +4385,32 @@ dependencies = [ "zeroize", ] +[[package]] +name = "tezos_crypto_rs" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8954f27b00228b1fc669cddfa0e604a40adc5ee443002d3d31abdea0b911fcb6" +dependencies = [ + "anyhow", + "bs58", + "byteorder 1.5.0", + "cryptoxide", + "ed25519-dalek", + "hex", + "libsecp256k1", + "nom", + "num-bigint 0.4.4", + "num-traits", + "p256", + "rand 0.7.3", + "serde", + "strum 0.20.0", + "strum_macros 0.20.1", + "tezos_data_encoding 0.6.0", + "thiserror", + "zeroize", +] + [[package]] name = "tezos_data_encoding" version = "0.5.2" @@ -4349,8 +4425,26 @@ dependencies = [ "num-bigint 0.3.3", "num-traits", "serde", - "tezos_crypto_rs", - "tezos_data_encoding_derive", + "tezos_crypto_rs 0.5.2", + "tezos_data_encoding_derive 0.5.2", + "thiserror", +] + +[[package]] +name = "tezos_data_encoding" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1fff433d41c778d27df21b91e766e182b05d9a7c1331e1156ee081273d704a4" +dependencies = [ + "bit-vec", + "bitvec", + "hex", + "lazy_static", + "nom", + "num-bigint 0.4.4", + "num-traits", + "serde", + "tezos_data_encoding_derive 0.6.0", "thiserror", ] @@ -4368,6 +4462,20 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "tezos_data_encoding_derive" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f614c81c10c1ac47fdb792ce23e928591fca685d534260e073f83bc5d5f080e0" +dependencies = [ + "lazy_static", + "once_cell", + "parse-display", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "thin-vec" version = "0.2.13" @@ -4391,7 +4499,7 @@ checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", ] [[package]] @@ -4500,7 +4608,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", ] [[package]] @@ -4581,7 +4689,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", ] [[package]] @@ -4847,7 +4955,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", "wasm-bindgen-shared", ] @@ -4881,7 +4989,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5216,7 +5324,7 @@ checksum = "9e6936f0cce458098a201c245a11bef556c6a0181129c7034d10d76d1ec3a2b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", "synstructure 0.13.0", ] @@ -5237,7 +5345,7 @@ checksum = "b3c129550b3e6de3fd0ba67ba5c81818f9805e58b8d7fee80a3a59d2c9fc601a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", ] [[package]] @@ -5257,7 +5365,7 @@ checksum = "e6a647510471d372f2e6c2e6b7219e44d8c574d24fdc11c610a61455782f18c3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", "synstructure 0.13.0", ] @@ -5278,7 +5386,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", ] [[package]] @@ -5300,7 +5408,7 @@ checksum = "7b4e5997cbf58990550ef1f0e5124a05e47e1ebd33a84af25739be6031a62c20" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.68", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index ee5f2fe8d..a820d74ef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -78,7 +78,7 @@ version = "0.2.2" version = "0.2.2" [workspace.dependencies.tezos_crypto_rs] -version = "0.5.2" +version = "0.6.0" default-features = false [patch.crates-io] @@ -97,4 +97,4 @@ boa_gc = { git = "https://github.com/trilitech/boa.git", branch = "ryutamago/fix boa_interner = { git = "https://github.com/trilitech/boa.git", branch = "ryutamago/fix-undefined-to-json" } boa_macros = { git = "https://github.com/trilitech/boa.git", branch = "ryutamago/fix-undefined-to-json" } boa_parser = { git = "https://github.com/trilitech/boa.git", branch = "ryutamago/fix-undefined-to-json" } -boa_profiler = { git = "https://github.com/trilitech/boa.git", branch = "ryutamago/fix-undefined-to-json" } +boa_profiler = { git = "https://github.com/trilitech/boa.git", branch = "ryutamago/fix-undefined-to-json" } \ No newline at end of file diff --git a/crates/jstz_crypto/src/error.rs b/crates/jstz_crypto/src/error.rs index ced34e53a..6f9e0bc13 100644 --- a/crates/jstz_crypto/src/error.rs +++ b/crates/jstz_crypto/src/error.rs @@ -1,16 +1,11 @@ use derive_more::{Display, Error, From}; -use tezos_crypto_rs::{ - base58::FromBase58CheckError, - hash::{FromBytesError, TryFromPKError}, - CryptoError, -}; +use tezos_crypto_rs::{base58::FromBase58CheckError, hash::FromBytesError, CryptoError}; #[derive(Display, Debug, Error, From)] pub enum Error { TezosFromBase58Error { source: FromBase58CheckError }, TezosFromBytesError { source: FromBytesError }, - TezosTryFromPKError { source: TryFromPKError }, TezosCryptoError { source: CryptoError }, InvalidSignature, } diff --git a/crates/jstz_crypto/src/hash.rs b/crates/jstz_crypto/src/hash.rs index c0d0c499a..c25475544 100644 --- a/crates/jstz_crypto/src/hash.rs +++ b/crates/jstz_crypto/src/hash.rs @@ -27,7 +27,7 @@ impl ToString for Blake2b { impl<'a> From<&'a [u8]> for Blake2b { fn from(data: &'a [u8]) -> Self { - let digest = tezos_crypto_rs::blake2b::digest_256(data).unwrap(); + let digest = tezos_crypto_rs::blake2b::digest_256(data); Self(digest.try_into().unwrap()) } } diff --git a/crates/jstz_crypto/src/lib.rs b/crates/jstz_crypto/src/lib.rs index 541d1bce5..252cd66a3 100644 --- a/crates/jstz_crypto/src/lib.rs +++ b/crates/jstz_crypto/src/lib.rs @@ -13,7 +13,7 @@ use crate::{hash::Blake2b, public_key::PublicKey, secret_key::SecretKey}; pub fn keypair_from_passphrase(passphrase: &str) -> Result<(SecretKey, PublicKey)> { let ikm = Blake2b::from(passphrase.as_bytes()).as_array().to_vec(); - let seed = SeedEd25519(ikm); + let seed = SeedEd25519::try_from(ikm)?; let (pk, sk) = seed.keypair()?; Ok((SecretKey::Ed25519(sk), PublicKey::Ed25519(pk))) } diff --git a/crates/jstz_crypto/src/public_key_hash.rs b/crates/jstz_crypto/src/public_key_hash.rs index 27a8a0fff..f7f468f3c 100644 --- a/crates/jstz_crypto/src/public_key_hash.rs +++ b/crates/jstz_crypto/src/public_key_hash.rs @@ -50,7 +50,7 @@ impl PublicKeyHash { pub fn as_bytes(&self) -> &[u8] { let PublicKeyHash::Tz1(tz1) = self; - &tz1.0 + tz1.as_ref() } pub fn digest(data: &[u8]) -> Result { let out_len = ContractTz1Hash::hash_size(); @@ -70,7 +70,7 @@ impl TryFrom<&PublicKey> for PublicKeyHash { fn try_from(pk: &PublicKey) -> Result { let PublicKey::Ed25519(key) = pk; - let tz1 = key.pk_hash()?; + let tz1 = key.pk_hash(); Ok(PublicKeyHash::Tz1(tz1)) } } diff --git a/crates/jstz_crypto/src/secret_key.rs b/crates/jstz_crypto/src/secret_key.rs index b475c98a1..8e85057e1 100644 --- a/crates/jstz_crypto/src/secret_key.rs +++ b/crates/jstz_crypto/src/secret_key.rs @@ -23,15 +23,14 @@ impl Debug for SecretKey { impl SecretKey { pub fn to_base58(&self) -> String { - let SecretKey::Ed25519(SecretKeyEd25519(sk)) = self; - let sk = SeedEd25519(sk.clone()); + let Self::Ed25519(sk) = self; sk.to_base58_check() } pub fn from_base58(data: &str) -> Result { - let SeedEd25519(sk) = SeedEd25519::from_base58_check(data)?; + let sk = SecretKeyEd25519::from_base58_check(data)?; - Ok(SecretKey::Ed25519(SecretKeyEd25519(sk))) + Ok(SecretKey::Ed25519(sk)) } pub fn sign(&self, message: impl AsRef<[u8]>) -> Result { @@ -53,14 +52,16 @@ enum SecretKeySerde { impl From for SecretKeySerde { fn from(s: SecretKey) -> Self { - let SecretKey::Ed25519(SecretKeyEd25519(sk)) = s; - Self::Ed25519(SeedEd25519(sk)) + let SecretKey::Ed25519(sk) = s; + let sk: Vec = sk.into(); + Self::Ed25519(SeedEd25519::try_from(sk).unwrap()) } } impl From for SecretKey { fn from(s: SecretKeySerde) -> Self { - let SecretKeySerde::Ed25519(SeedEd25519(sk)) = s; - Self::Ed25519(SecretKeyEd25519(sk)) + let SecretKeySerde::Ed25519(sk) = s; + let sk: Vec = sk.into(); + Self::Ed25519(SecretKeyEd25519::try_from(sk).unwrap()) } } diff --git a/crates/jstz_crypto/src/signature.rs b/crates/jstz_crypto/src/signature.rs index 6e2580906..55fc9d45a 100644 --- a/crates/jstz_crypto/src/signature.rs +++ b/crates/jstz_crypto/src/signature.rs @@ -5,7 +5,7 @@ use crate::{public_key::PublicKey, Error, Result}; #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] pub enum Signature { - Ed25519(tezos_crypto_rs::hash::Signature), + Ed25519(tezos_crypto_rs::hash::Ed25519Signature), } impl Signature { diff --git a/crates/jstz_kernel/src/inbox.rs b/crates/jstz_kernel/src/inbox.rs index 53adf52ec..fae5f4c98 100644 --- a/crates/jstz_kernel/src/inbox.rs +++ b/crates/jstz_kernel/src/inbox.rs @@ -41,7 +41,7 @@ fn read_transfer( } }; - if transfer.destination.hash().0 != &rt.reveal_metadata().raw_rollup_address { + if transfer.destination.hash().as_ref() != &rt.reveal_metadata().raw_rollup_address { debug_msg!( rt, "Deposit ignored because of different smart rollup address" diff --git a/crates/jstz_kernel/src/lib.rs b/crates/jstz_kernel/src/lib.rs index 5d51719e6..ce43777d8 100644 --- a/crates/jstz_kernel/src/lib.rs +++ b/crates/jstz_kernel/src/lib.rs @@ -2,7 +2,7 @@ use jstz_core::kv::{Storage, Transaction}; use jstz_proto::{executor, Result}; use tezos_crypto_rs::hash::ContractKt1Hash; use tezos_smart_rollup::{ - kernel_entry, + entrypoint, prelude::{debug_msg, Runtime}, storage::path::RefPath, }; @@ -38,6 +38,7 @@ fn handle_message(hrt: &mut impl Runtime, message: Message) -> Result<()> { } // kernel entry +#[entrypoint::main] pub fn entry(rt: &mut impl Runtime) { let ticketer = read_ticketer(rt); @@ -46,5 +47,3 @@ pub fn entry(rt: &mut impl Runtime) { .unwrap_or_else(|err| debug_msg!(rt, "[🔴] {err:?}\n")); } } - -kernel_entry!(entry); diff --git a/crates/jstz_node/Cargo.toml b/crates/jstz_node/Cargo.toml index 32443c88a..8e3af8ed7 100644 --- a/crates/jstz_node/Cargo.toml +++ b/crates/jstz_node/Cargo.toml @@ -42,7 +42,7 @@ actix-cors = "0.6.5" base64 = "0.13.1" tezos-smart-rollup.workspace = true tezos-smart-rollup-encoding.workspace = true -tezos_data_encoding = "0.5.2" +tezos_data_encoding = "0.6.0" tezos_crypto_rs.workspace = true [[bin]] diff --git a/nix/jstz.nix b/nix/jstz.nix index 2d10babb4..82687564b 100644 --- a/nix/jstz.nix +++ b/nix/jstz.nix @@ -42,7 +42,7 @@ cargoLock = { lockFile = ../Cargo.lock; outputHashes = { - "tezos-smart-rollup-0.2.2" = "sha256-v0ayPeHzhGzCdaHLpYh0bQm1569KrHgR/IxCXwBwhQU="; + "tezos-smart-rollup-0.2.2" = "sha256-sw+7iPP4rdtrS4rmtNy0t/Rhua2Nh726y/+x7YmyfdQ="; "boa_engine-0.17.0" = "sha256-xMLwVEORTJgoSBxi3znF8AIOOZ8RF6aX0OXMdjEs2K0="; "boa_gc-0.17.0" = "sha256-bf6i5ESIHwepb1a4dUYREPprz7Rijq+P5z+NXpsT16Q="; "hermit-0.7.2" = "sha256-GJLujJml6IpT1+rbOG0BdDVkoI1PQGc3McryTggPu+o=";