Skip to content

Commit

Permalink
Use SLOTS_PER_USER in build_stackerdb_contract
Browse files Browse the repository at this point in the history
Signed-off-by: Jacinta Ferrant <[email protected]>
  • Loading branch information
jferrant committed Sep 14, 2023
1 parent 0365753 commit db51c04
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion stacks-signer/src/stacks_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ use stacks_common::{debug, types::chainstate::StacksPrivateKey, warn};

use crate::config::Config;

const SLOTS_PER_USER: u32 = 10;
/// Temporary placeholder for the number of slots allocated to a stacker-db writer. This will be retrieved from the stacker-db instance in the future
/// See: https://github.com/stacks-network/stacks-blockchain/issues/3921
/// Is equal to the number of message types
pub const SLOTS_PER_USER: u32 = 10;

#[derive(thiserror::Error, Debug)]
/// Client error type
Expand Down
5 changes: 4 additions & 1 deletion stacks-signer/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use stacks_common::{
};
use wsts::Scalar;

use crate::stacks_client::SLOTS_PER_USER;

/// Helper function for building a signer config for each provided signer private key
pub fn build_signer_config_tomls(
signer_stacks_private_keys: &[StacksPrivateKey],
Expand Down Expand Up @@ -90,7 +92,8 @@ pub fn build_stackerdb_contract(signer_stacks_addresses: &[StacksAddress]) -> St
stackerdb_contract += " {\n";
stackerdb_contract +=
format!(" signer: '{},\n", signer_stacks_address).as_str();
stackerdb_contract += format!(" num-slots: u{}\n", 10).as_str(); // We only have 10 Message Types
stackerdb_contract +=
format!(" num-slots: u{}\n", SLOTS_PER_USER).as_str();
stackerdb_contract += " }\n";
}
stackerdb_contract += " )))\n";
Expand Down

0 comments on commit db51c04

Please sign in to comment.