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

Commit

Permalink
feat: feature to add functions from newly created files
Browse files Browse the repository at this point in the history
these files are untracked and by default git.diff would not see them
  • Loading branch information
ASuciuX committed Dec 1, 2023
1 parent f50b646 commit fdaf4fa
Showing 6 changed files with 475 additions and 2 deletions.
18 changes: 18 additions & 0 deletions mutation-testing/packages-output/pox-locking/missed.txt
Original file line number Diff line number Diff line change
@@ -26,5 +26,23 @@ pox-locking/src/pox_3.rs:87: replace pox_lock_extend_v3 -> Result<u128, LockingE
pox-locking/src/events.rs:47: replace create_event_info_stack_or_delegate_code -> String with "xyzzy".into()
pox-locking/src/pox_2.rs:473: replace handle_contract_call -> Result<(), ClarityError> with Ok(())
pox-locking/src/pox_2.rs:217: replace pox_lock_extend_v2 -> Result<u128, LockingError> with Ok(0)
pox-locking/src/pox_4.rs:42: replace pox_lock_v3 -> Result<(), LockingError> with Ok(())
pox-locking/src/pox_4.rs:72: replace pox_lock_extend_v3_not_tested -> Result<u128, LockingError> with Ok(0)
pox-locking/src/pox_4.rs:72: replace pox_lock_extend_v3_not_tested -> Result<u128, LockingError> with Ok(1)
pox-locking/src/pox_4.rs:87: replace pox_lock_extend_v3 -> Result<u128, LockingError> with Ok(0)
pox-locking/src/pox_4.rs:87: replace pox_lock_extend_v3 -> Result<u128, LockingError> with Ok(1)
pox-locking/src/pox_4.rs:169: replace handle_stack_lockup_pox_v3 -> Result<Option<StacksTransactionEvent>, ClarityError> with Ok(None)
pox-locking/src/pox_4.rs:236: replace handle_stack_lockup_extension_pox_v3 -> Result<Option<StacksTransactionEvent>, ClarityError> with Ok(None)
pox-locking/src/pox_4.rs:300: replace handle_stack_lockup_increase_pox_v3 -> Result<Option<StacksTransactionEvent>, ClarityError> with Ok(None)
pox-locking/src/pox_4.rs:363: replace handle_contract_call -> Result<(), ClarityError> with Ok(())
pox-locking/src/pox_3.rs:72: replace pox_lock_extend_v3_not_tested -> Result<u128, LockingError> with Ok(0)
pox-locking/src/pox_4_remove.rs:42: replace pox_lock_v3 -> Result<(), LockingError> with Ok(())
pox-locking/src/pox_3.rs:72: replace pox_lock_extend_v3_not_tested -> Result<u128, LockingError> with Ok(1)
pox-locking/src/pox_4_remove.rs:72: replace pox_lock_extend_v3_not_tested -> Result<u128, LockingError> with Ok(0)
pox-locking/src/pox_4_remove.rs:72: replace pox_lock_extend_v3_not_tested -> Result<u128, LockingError> with Ok(1)
pox-locking/src/pox_4_remove.rs:87: replace pox_lock_extend_v3 -> Result<u128, LockingError> with Ok(0)
pox-locking/src/pox_4_remove.rs:87: replace pox_lock_extend_v3 -> Result<u128, LockingError> with Ok(1)
pox-locking/src/pox_4_remove.rs:169: replace handle_stack_lockup_pox_v3 -> Result<Option<StacksTransactionEvent>, ClarityError> with Ok(None)
pox-locking/src/pox_4_remove.rs:236: replace handle_stack_lockup_extension_pox_v3 -> Result<Option<StacksTransactionEvent>, ClarityError> with Ok(None)
pox-locking/src/pox_4_remove.rs:300: replace handle_stack_lockup_increase_pox_v3 -> Result<Option<StacksTransactionEvent>, ClarityError> with Ok(None)
pox-locking/src/pox_4_remove.rs:363: replace handle_contract_call -> Result<(), ClarityError> with Ok(())
8 changes: 8 additions & 0 deletions mutation-testing/packages-output/pox-locking/unviable.txt
Original file line number Diff line number Diff line change
@@ -20,3 +20,11 @@ pox-locking/src/pox_2.rs:64: replace parse_pox_stacking_result -> std::result::R
pox-locking/src/pox_1.rs:36: replace parse_pox_stacking_result_v1 -> std::result::Result<(PrincipalData, u128, u64), i128> with Ok((Default::default(), 0, 0))
pox-locking/src/pox_2.rs:345: replace handle_stack_lockup_extension_pox_v2 -> Result<Option<StacksTransactionEvent>, ClarityError> with Ok(Some(Default::default()))
pox-locking/src/pox_2.rs:64: replace parse_pox_stacking_result -> std::result::Result<(PrincipalData, u128, u64), i128> with Ok((Default::default(), 1, 1))
pox-locking/src/pox_4.rs:123: replace pox_lock_increase_v3 -> Result<STXBalance, LockingError> with Ok(Default::default())
pox-locking/src/pox_4.rs:169: replace handle_stack_lockup_pox_v3 -> Result<Option<StacksTransactionEvent>, ClarityError> with Ok(Some(Default::default()))
pox-locking/src/pox_4.rs:236: replace handle_stack_lockup_extension_pox_v3 -> Result<Option<StacksTransactionEvent>, ClarityError> with Ok(Some(Default::default()))
pox-locking/src/pox_4.rs:300: replace handle_stack_lockup_increase_pox_v3 -> Result<Option<StacksTransactionEvent>, ClarityError> with Ok(Some(Default::default()))
pox-locking/src/pox_4_remove.rs:123: replace pox_lock_increase_v3 -> Result<STXBalance, LockingError> with Ok(Default::default())
pox-locking/src/pox_4_remove.rs:169: replace handle_stack_lockup_pox_v3 -> Result<Option<StacksTransactionEvent>, ClarityError> with Ok(Some(Default::default()))
pox-locking/src/pox_4_remove.rs:236: replace handle_stack_lockup_extension_pox_v3 -> Result<Option<StacksTransactionEvent>, ClarityError> with Ok(Some(Default::default()))
pox-locking/src/pox_4_remove.rs:300: replace handle_stack_lockup_increase_pox_v3 -> Result<Option<StacksTransactionEvent>, ClarityError> with Ok(Some(Default::default()))
19 changes: 17 additions & 2 deletions mutation-testing/scripts/git-diff.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
# script that makes .git for the differences
# it saves the .git on scripts folder

# run from scripts folder
cd ..
# add untracked files to git diff
# go to root folder
cd ./../..

# run git status on root
untracked_files=($(git ls-files --others --exclude-standard))

# for each file untracked -> run git add file path
echo "${untracked_files[@]}"
for file in "${untracked_files[@]}"; do
git add -N "$file"
done

cd mutation-testing


# run from mutation-testing folder
git diff > git.diff

# it runs cargo mutants for those specific changed functions and outputs to /temp/mutants.out
1 change: 1 addition & 0 deletions pox-locking/src/lib.rs
Original file line number Diff line number Diff line change
@@ -38,6 +38,7 @@ mod events;
mod pox_1;
mod pox_2;
mod pox_3;
mod pox_4_remove;

#[derive(Debug)]
pub enum LockingError {
8 changes: 8 additions & 0 deletions pox-locking/src/pox_3.rs
Original file line number Diff line number Diff line change
@@ -65,6 +65,14 @@ pub fn pox_lock_v3(
Ok(())
}

pub fn pox_lock_extend_v3_not_tested(
db: &mut ClarityDatabase,
principal: &PrincipalData,
unlock_burn_height: u64,
) -> Result<u128, LockingError> {
Ok(1231)
}

/// Extend a STX lock up for PoX for a time. Does NOT touch the account nonce.
/// Returns Ok(lock_amount) when successful
///
Loading

0 comments on commit fdaf4fa

Please sign in to comment.