Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
chore: adding dummy proof size for spammer
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Paitrault <[email protected]>
  • Loading branch information
Freyskeyd authored and hadjiszs committed Aug 2, 2023
1 parent 226fc90 commit c8060e6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/topos-certificate-spammer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ tracing-opentelemetry.workspace = true
opentelemetry.workspace = true
tiny-keccak.workspace = true
uuid.workspace = true
lazy_static.workspace = true

toml = "0.5.9"

Expand Down
6 changes: 5 additions & 1 deletion crates/topos-certificate-spammer/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ use topos_core::uci::{Certificate, SubnetId};

use crate::{error::Error, SourceSubnet};

lazy_static::lazy_static! {
static ref PROOF_SIZE: usize = std::env::var("PROOF_SIZE_KB").map(|v| v.parse::<usize>().unwrap_or(0)).unwrap_or(0) * 1024;
}

pub fn generate_random_32b_array() -> [u8; 32] {
(0..32)
.map(|_| rand::random::<u8>())
Expand All @@ -22,7 +26,7 @@ pub fn generate_test_certificate(
generate_random_32b_array(),
target_subnet_ids,
0,
Vec::new(),
vec![254u8; *PROOF_SIZE],
)?;
new_cert
.update_signature(&source_subnet.signing_key)
Expand Down

0 comments on commit c8060e6

Please sign in to comment.