From 3dcd47c42927ca98770ad95d72b60420f8c569bc Mon Sep 17 00:00:00 2001 From: Kolby Moroz Liebl <31669092+KolbyML@users.noreply.github.com> Date: Fri, 29 Mar 2024 00:26:10 -0600 Subject: [PATCH 1/4] chore(deps): change ethereum-types to alloy-primitives Update Cargo.toml --- Cargo.toml | 8 ++++---- src/fixed_vector.rs | 8 ++++---- src/tree_hash.rs | 2 +- src/variable_list.rs | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c007941..ed37e83 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,9 +11,9 @@ keywords = ["ethereum"] categories = ["cryptography::cryptocurrencies"] [dependencies] -tree_hash = "0.6.0" -ethereum_ssz = "0.5.0" -ethereum_serde_utils = "0.5.0" +tree_hash = { git = "https://github.com/KolbyML/tree_hash.git", rev = "8aaf8bb4184148768d48e2cfbbdd0b95d1da8730" } +ethereum_ssz = { git = "https://github.com/KolbyML/ethereum_ssz.git", rev = "364a2d93229e638b72c99186cbc2a56590585151" } +ethereum_serde_utils = { git = "https://github.com/KolbyML/ethereum_serde_utils.git", rev = "b0f9fcf3ed6a983561925f1b520a725cfe2191f2" } serde = "1.0.0" serde_derive = "1.0.0" typenum = "1.12.0" @@ -24,4 +24,4 @@ itertools = "0.10.0" [dev-dependencies] serde_json = "1.0.0" -tree_hash_derive = "0.6.0" +tree_hash_derive = { git = "https://github.com/KolbyML/tree_hash.git", rev = "8aaf8bb4184148768d48e2cfbbdd0b95d1da8730" } diff --git a/src/fixed_vector.rs b/src/fixed_vector.rs index fe0e6f9..78dd309 100644 --- a/src/fixed_vector.rs +++ b/src/fixed_vector.rs @@ -480,25 +480,25 @@ mod test { let fixed: FixedVector = FixedVector::from(vec![a]); assert_eq!( fixed.tree_hash_root(), - merkle_root(a.tree_hash_root().as_bytes(), 0) + merkle_root(a.tree_hash_root().as_slice(), 0) ); let fixed: FixedVector = FixedVector::from(vec![a; 8]); assert_eq!( fixed.tree_hash_root(), - merkle_root(&repeat(a.tree_hash_root().as_bytes(), 8), 0) + merkle_root(&repeat(a.tree_hash_root().as_slice(), 8), 0) ); let fixed: FixedVector = FixedVector::from(vec![a; 13]); assert_eq!( fixed.tree_hash_root(), - merkle_root(&repeat(a.tree_hash_root().as_bytes(), 13), 0) + merkle_root(&repeat(a.tree_hash_root().as_slice(), 13), 0) ); let fixed: FixedVector = FixedVector::from(vec![a; 16]); assert_eq!( fixed.tree_hash_root(), - merkle_root(&repeat(a.tree_hash_root().as_bytes(), 16), 0) + merkle_root(&repeat(a.tree_hash_root().as_slice(), 16), 0) ); } } diff --git a/src/tree_hash.rs b/src/tree_hash.rs index e08c1d6..d1509c3 100644 --- a/src/tree_hash.rs +++ b/src/tree_hash.rs @@ -29,7 +29,7 @@ where for item in vec { hasher - .write(item.tree_hash_root().as_bytes()) + .write(item.tree_hash_root().as_slice()) .expect("ssz_types vec should not contain more elements than max"); } diff --git a/src/variable_list.rs b/src/variable_list.rs index 4ffd0a1..9816839 100644 --- a/src/variable_list.rs +++ b/src/variable_list.rs @@ -469,7 +469,7 @@ mod test { let fixed: VariableList = VariableList::from(vec![a; i]); assert_eq!( fixed.tree_hash_root(), - padded_root_with_length(&repeat(a.tree_hash_root().as_bytes(), i), i, 1), + padded_root_with_length(&repeat(a.tree_hash_root().as_slice(), i), i, 1), "U1 {}", i ); @@ -479,7 +479,7 @@ mod test { let fixed: VariableList = VariableList::from(vec![a; i]); assert_eq!( fixed.tree_hash_root(), - padded_root_with_length(&repeat(a.tree_hash_root().as_bytes(), i), i, 8), + padded_root_with_length(&repeat(a.tree_hash_root().as_slice(), i), i, 8), "U8 {}", i ); @@ -489,7 +489,7 @@ mod test { let fixed: VariableList = VariableList::from(vec![a; i]); assert_eq!( fixed.tree_hash_root(), - padded_root_with_length(&repeat(a.tree_hash_root().as_bytes(), i), i, 13), + padded_root_with_length(&repeat(a.tree_hash_root().as_slice(), i), i, 13), "U13 {}", i ); @@ -499,7 +499,7 @@ mod test { let fixed: VariableList = VariableList::from(vec![a; i]); assert_eq!( fixed.tree_hash_root(), - padded_root_with_length(&repeat(a.tree_hash_root().as_bytes(), i), i, 16), + padded_root_with_length(&repeat(a.tree_hash_root().as_slice(), i), i, 16), "U16 {}", i ); From d107b54024db99e69ebad233b19ebdb10eefbb6f Mon Sep 17 00:00:00 2001 From: Milos Stankovic <82043364+morph-dev@users.noreply.github.com> Date: Fri, 5 Apr 2024 22:01:27 +0300 Subject: [PATCH 2/4] chore: use public ethereum_ssz and ethereum_serde_utils (#1) --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ed37e83..7e29c59 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,8 +12,8 @@ categories = ["cryptography::cryptocurrencies"] [dependencies] tree_hash = { git = "https://github.com/KolbyML/tree_hash.git", rev = "8aaf8bb4184148768d48e2cfbbdd0b95d1da8730" } -ethereum_ssz = { git = "https://github.com/KolbyML/ethereum_ssz.git", rev = "364a2d93229e638b72c99186cbc2a56590585151" } -ethereum_serde_utils = { git = "https://github.com/KolbyML/ethereum_serde_utils.git", rev = "b0f9fcf3ed6a983561925f1b520a725cfe2191f2" } +ethereum_serde_utils = "0.5" +ethereum_ssz = "0.5" serde = "1.0.0" serde_derive = "1.0.0" typenum = "1.12.0" From 4c4ea6f5eb5f6c52677ab3abf2de47253c032cc4 Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Thu, 15 Aug 2024 13:11:26 +1000 Subject: [PATCH 3/4] Update to released versions --- Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7e29c59..887de80 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,9 +11,9 @@ keywords = ["ethereum"] categories = ["cryptography::cryptocurrencies"] [dependencies] -tree_hash = { git = "https://github.com/KolbyML/tree_hash.git", rev = "8aaf8bb4184148768d48e2cfbbdd0b95d1da8730" } -ethereum_serde_utils = "0.5" -ethereum_ssz = "0.5" +tree_hash = "0.7.0" +ethereum_serde_utils = "0.6" +ethereum_ssz = "0.6" serde = "1.0.0" serde_derive = "1.0.0" typenum = "1.12.0" @@ -24,4 +24,4 @@ itertools = "0.10.0" [dev-dependencies] serde_json = "1.0.0" -tree_hash_derive = { git = "https://github.com/KolbyML/tree_hash.git", rev = "8aaf8bb4184148768d48e2cfbbdd0b95d1da8730" } +tree_hash_derive = "0.7.0" From fef2813ff480ac8711b767bd2da8f33fe1426cf6 Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Thu, 15 Aug 2024 13:24:16 +1000 Subject: [PATCH 4/4] Informational coverage --- .github/workflows/test-suite.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index a83755b..f5688e5 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -47,3 +47,4 @@ jobs: with: fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} + informational: true