mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Replace custom read/write impls in router with borsh
This commit is contained in:
@@ -2,12 +2,27 @@
|
||||
#![doc = include_str!("../README.md")]
|
||||
#![deny(missing_docs)]
|
||||
|
||||
use ::borsh::{BorshSerialize, BorshDeserialize};
|
||||
|
||||
use group::ff::PrimeField;
|
||||
use k256::Scalar;
|
||||
|
||||
use alloy_primitives::PrimitiveSignature;
|
||||
use alloy_consensus::{SignableTransaction, Signed, TxLegacy};
|
||||
|
||||
mod borsh;
|
||||
pub use borsh::*;
|
||||
|
||||
/// An index of a log within a block.
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, BorshSerialize, BorshDeserialize)]
|
||||
#[borsh(crate = "::borsh")]
|
||||
pub struct LogIndex {
|
||||
/// The hash of the block which produced this log.
|
||||
pub block_hash: [u8; 32],
|
||||
/// The index of this log within the execution of the block.
|
||||
pub index_within_block: u64,
|
||||
}
|
||||
|
||||
/// The Keccak256 hash function.
|
||||
pub fn keccak256(data: impl AsRef<[u8]>) -> [u8; 32] {
|
||||
alloy_primitives::keccak256(data.as_ref()).into()
|
||||
|
||||
Reference in New Issue
Block a user