|
1 | | -use alloy::primitives::{B256, U256}; |
| 1 | +use alloy::primitives::B256; |
2 | 2 | use anyhow::anyhow; |
3 | 3 | use diesel::deserialize::FromSql; |
4 | 4 | use diesel::pg::Pg; |
@@ -178,17 +178,6 @@ impl BlockPtr { |
178 | 178 | self.number |
179 | 179 | } |
180 | 180 |
|
181 | | - // // FIXME: |
182 | | - // // |
183 | | - // // workaround for arweave |
184 | | - // pub fn hash_as_h256(&self) -> H256 { |
185 | | - // H256::from_slice(&self.hash_slice()[..32]) |
186 | | - // } |
187 | | - |
188 | | - pub fn hash_as_b256(&self) -> B256 { |
189 | | - B256::from_slice(&self.hash_slice()[..32]) |
190 | | - } |
191 | | - |
192 | 181 | pub fn hash_slice(&self) -> &[u8] { |
193 | 182 | self.hash.0.as_ref() |
194 | 183 | } |
@@ -268,8 +257,6 @@ impl From<(B256, u64)> for BlockPtr { |
268 | 257 | } |
269 | 258 | } |
270 | 259 |
|
271 | | - |
272 | | - |
273 | 260 | impl From<(alloy::primitives::B256, i64)> for BlockPtr { |
274 | 261 | fn from((hash, number): (alloy::primitives::B256, i64)) -> BlockPtr { |
275 | 262 | let number = i32::try_from(number).unwrap(); |
@@ -341,7 +328,7 @@ impl IntoValue for BlockPtr { |
341 | 328 |
|
342 | 329 | impl From<BlockPtr> for B256 { |
343 | 330 | fn from(ptr: BlockPtr) -> Self { |
344 | | - ptr.hash_as_b256() |
| 331 | + ptr.hash.as_b256() |
345 | 332 | } |
346 | 333 | } |
347 | 334 |
|
@@ -425,22 +412,6 @@ impl ExtendedBlockPtr { |
425 | 412 | pub fn block_number(&self) -> BlockNumber { |
426 | 413 | self.number |
427 | 414 | } |
428 | | - |
429 | | - pub fn hash_as_b256(&self) -> B256 { |
430 | | - B256::from_slice(&self.hash_slice()[..32]) |
431 | | - } |
432 | | - |
433 | | - pub fn parent_hash_as_b256(&self) -> B256 { |
434 | | - B256::from_slice(&self.parent_hash_slice()[..32]) |
435 | | - } |
436 | | - |
437 | | - pub fn hash_slice(&self) -> &[u8] { |
438 | | - self.hash.0.as_ref() |
439 | | - } |
440 | | - |
441 | | - pub fn parent_hash_slice(&self) -> &[u8] { |
442 | | - self.parent_hash.0.as_ref() |
443 | | - } |
444 | 415 | } |
445 | 416 |
|
446 | 417 | impl fmt::Display for ExtendedBlockPtr { |
|
0 commit comments