add tests

This commit is contained in:
Sergio Chouhy 2025-08-13 01:55:56 -03:00
parent 4bdd2c6d9f
commit 63cca0f30f
2 changed files with 14 additions and 5 deletions

View File

@ -24,3 +24,13 @@ impl PrivateKey {
&self.0
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_value_getter() {
let key = PrivateKey::try_new([1; 32]).unwrap();
assert_eq!(key.value(), &key.0);
}
}

View File

@ -73,11 +73,6 @@ impl V01State {
pub(crate) fn builtin_programs(&self) -> &HashMap<ProgramId, Program> {
&self.builtin_programs
}
#[cfg(test)]
pub fn force_insert_account(&mut self, address: Address, account: Account) {
self.public_state.insert(address, account);
}
}
#[cfg(test)]
@ -283,6 +278,10 @@ mod tests {
}
impl V01State {
pub fn force_insert_account(&mut self, address: Address, account: Account) {
self.public_state.insert(address, account);
}
/// Include test programs in the builtin programs map
pub fn with_test_programs(mut self) -> Self {
self.insert_program(Program::nonce_changer_program());