mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-05-13 19:49:29 +00:00
CI fixes
This commit is contained in:
parent
9ef69ef684
commit
469d5bdad9
@ -85,11 +85,15 @@ impl HashableBlockData {
|
||||
signing_key: &nssa::PrivateKey,
|
||||
bedrock_parent_id: MantleMsgId,
|
||||
) -> Block {
|
||||
const PREFIX: &[u8; 32] =
|
||||
b"/LEE/v0.3/Message/Block/\x00\x00\x00\x00\x00\x00\x00\x00";
|
||||
const PREFIX: &[u8; 32] = b"/LEE/v0.3/Message/Block/\x00\x00\x00\x00\x00\x00\x00\x00";
|
||||
|
||||
let data_bytes = borsh::to_vec(&self).unwrap();
|
||||
let mut bytes = Vec::with_capacity(PREFIX.len() + data_bytes.len());
|
||||
let mut bytes = Vec::with_capacity(
|
||||
PREFIX
|
||||
.len()
|
||||
.checked_add(data_bytes.len())
|
||||
.expect("length overflow"),
|
||||
);
|
||||
bytes.extend_from_slice(PREFIX);
|
||||
bytes.extend_from_slice(&data_bytes);
|
||||
|
||||
|
||||
@ -121,13 +121,17 @@ impl Message {
|
||||
|
||||
#[must_use]
|
||||
pub fn hash_message(&self) -> [u8; 32] {
|
||||
const PREFIX: &[u8; 32] =
|
||||
b"/LEE/v0.3/Message/Privacy/\x00\x00\x00\x00\x00\x00";
|
||||
const PREFIX: &[u8; 32] = b"/LEE/v0.3/Message/Privacy/\x00\x00\x00\x00\x00\x00";
|
||||
|
||||
let mut bytes = Vec::with_capacity(PREFIX.len() + self.to_bytes().len());
|
||||
let mut bytes = Vec::with_capacity(
|
||||
PREFIX
|
||||
.len()
|
||||
.checked_add(self.to_bytes().len())
|
||||
.expect("length overflow"),
|
||||
);
|
||||
bytes.extend_from_slice(PREFIX);
|
||||
bytes.extend_from_slice(&self.to_bytes());
|
||||
|
||||
|
||||
Sha256::digest(bytes).into()
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,13 +67,17 @@ impl Message {
|
||||
|
||||
#[must_use]
|
||||
pub fn hash_message(&self) -> [u8; 32] {
|
||||
const PREFIX: &[u8; 32] =
|
||||
b"/LEE/v0.3/Message/Public/\x00\x00\x00\x00\x00\x00\x00";
|
||||
const PREFIX: &[u8; 32] = b"/LEE/v0.3/Message/Public/\x00\x00\x00\x00\x00\x00\x00";
|
||||
|
||||
let mut bytes = Vec::with_capacity(PREFIX.len() + self.to_bytes().len());
|
||||
let mut bytes = Vec::with_capacity(
|
||||
PREFIX
|
||||
.len()
|
||||
.checked_add(self.to_bytes().len())
|
||||
.expect("length overflow"),
|
||||
);
|
||||
bytes.extend_from_slice(PREFIX);
|
||||
bytes.extend_from_slice(&self.to_bytes());
|
||||
|
||||
|
||||
Sha256::digest(bytes).into()
|
||||
}
|
||||
}
|
||||
|
||||
@ -134,7 +134,7 @@ pub fn test_vectors() -> Vec<TestVector> {
|
||||
// "EEFDEA4CDB677750A420FEE807EACF21EB9898AE79B9768766E4FAA04A2D4A34",
|
||||
// )).unwrap(),
|
||||
// aux_rand: None,
|
||||
// message:
|
||||
// message:
|
||||
//
|
||||
// hex::decode("243F6A8885A308D313198A2E03707344A4093822299F31D0082EFA98EC4E6C89").
|
||||
// unwrap(), ),
|
||||
@ -289,7 +289,7 @@ pub fn test_vectors() -> Vec<TestVector> {
|
||||
// "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC30",
|
||||
// )).unwrap(),
|
||||
// aux_rand: None,
|
||||
// message:
|
||||
// message:
|
||||
//
|
||||
// hex::decode("243F6A8885A308D313198A2E03707344A4093822299F31D0082EFA98EC4E6C89").
|
||||
// unwrap(), ),
|
||||
@ -369,7 +369,7 @@ pub fn test_vectors() -> Vec<TestVector> {
|
||||
// aux_rand: hex_to_bytes::<32>(
|
||||
// "0000000000000000000000000000000000000000000000000000000000000000",
|
||||
// )),
|
||||
// message:
|
||||
// message:
|
||||
// hex::decode("99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999").unwrap(),
|
||||
// ),
|
||||
// signature: Signature {
|
||||
|
||||
@ -37,7 +37,8 @@ impl FromStr for Signature {
|
||||
|
||||
impl Signature {
|
||||
#[must_use]
|
||||
/// This function expects the incoming message to be prehashed to be pre-2022 BIP-340/Keycard compatible.
|
||||
/// This function expects the incoming message to be prehashed to be pre-2022 BIP-340/Keycard
|
||||
/// compatible.
|
||||
pub fn new(key: &PrivateKey, message: &[u8; 32]) -> Self {
|
||||
let mut aux_random = [0_u8; 32];
|
||||
OsRng.fill_bytes(&mut aux_random);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user