• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Neptune-Crypto / neptune-core / 16544362308

26 Jul 2025 10:07PM UTC coverage: 74.138% (+1.7%) from 72.422%
16544362308

push

github

Sword-Smith
Merge branch 'reboot'

3111 of 3416 new or added lines in 72 files covered. (91.07%)

28 existing lines in 14 files now uncovered.

22913 of 30906 relevant lines covered (74.14%)

618079.03 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

92.0
/src/models/blockchain/type_scripts/known_type_scripts.rs
1
use tasm_lib::prelude::Digest;
2

3
use super::native_currency::NativeCurrency;
4
use super::native_currency::NativeCurrencyWitness;
5
use super::time_lock::TimeLock;
6
use super::time_lock::TimeLockWitness;
7
use super::TypeScript;
8
use super::TypeScriptAndWitness;
9
use super::TypeScriptWitness;
10
use crate::models::blockchain::transaction::primitive_witness::SaltedUtxos;
11
use crate::models::blockchain::transaction::transaction_kernel::TransactionKernel;
12
use crate::models::blockchain::transaction::utxo::Coin;
13
use crate::models::proof_abstractions::tasm::program::ConsensusProgram;
14

15
pub(crate) fn match_type_script_and_generate_witness(
3,192✔
16
    type_script_hash: Digest,
3,192✔
17
    transaction_kernel: TransactionKernel,
3,192✔
18
    salted_input_utxos: SaltedUtxos,
3,192✔
19
    salted_output_utxos: SaltedUtxos,
3,192✔
20
) -> Option<TypeScriptAndWitness> {
3,192✔
21
    let type_script_and_witness = if type_script_hash == NativeCurrency.hash() {
3,192✔
22
        NativeCurrencyWitness::new(transaction_kernel, salted_input_utxos, salted_output_utxos)
1,748✔
23
            .type_script_and_witness()
1,748✔
24
    } else if type_script_hash == TimeLock.hash() {
1,444✔
25
        TimeLockWitness::new(transaction_kernel, salted_input_utxos, salted_output_utxos)
1,444✔
26
            .type_script_and_witness()
1,444✔
27
    } else {
28
        return None;
×
29
    };
30
    Some(type_script_and_witness)
3,192✔
31
}
3,192✔
32

33
pub(crate) fn is_known_type_script_with_valid_state(coin: &Coin) -> bool {
9,118✔
34
    NativeCurrency.matches_coin(coin) || TimeLock.matches_coin(coin)
9,118✔
35
}
9,118✔
36

37
pub(crate) fn typescript_name(type_script_hash: Digest) -> &'static str {
13✔
38
    if type_script_hash == NativeCurrency.hash() {
13✔
39
        "native currency"
5✔
40
    } else if type_script_hash == TimeLock.hash() {
8✔
41
        "time lock"
8✔
42
    } else {
NEW
43
        "unknown"
×
44
    }
45
}
13✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc