Crypto/Transaction/Digest/Config.pm

filter: Statementstmt 100% 23 / 23 Branchbran 100% 2 / 2 Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 91.4% 32 / 35 CC 3 SCAR 6.2
CC
3
Cov
96%
_default_sighash
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.9
« Crypto/Role/SignVerify.pm ↑ Summary Crypto/Transaction/UTXO.pm »
1 package Bitcoin::Crypto::Transaction::Digest::Config;
2 38 $Bitcoin::Crypto::Transaction::Digest::Config::VERSION = '4.006';
3 38 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 38 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 38 ▶use Mooish::Base -standard;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 38 ▶use Bitcoin::Crypto::Types -types;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 38 has param 'signing_index' => (
11 isa => PositiveOrZeroInt,
12 );
13  
14 38 has param 'signing_subscript' => (
15 coerce => ByteStr,
16 required => 0,
17 );
18  
19 38 has param 'sighash' => (
20 isa => PositiveOrZeroInt,
21 required => 0,
22 writer => -hidden,
23 );
24  
25 38 has param 'taproot_ext_flag' => (
26 isa => PositiveOrZeroInt,
27 default => 0,
28 );
29  
30 38 has param 'taproot_ext' => (
31 coerce => ByteStr,
32 required => 0,
33 );
34  
35 38 has param 'taproot_annex' => (
36 coerce => ByteStr,
37 required => 0,
38 );
39  
40 sub _default_sighash
41 260 ▶{
Subroutine _default_sighash: called CC=3 SCAR=11.0
42 260 my ($self, $value) = @_;
43  
44 260 my $sighash = $self->sighash;
45 260 ▶ $self->_set_sighash($value)
Branch: 1 branch
BranchTrueFalseTotal
unless defined $sighash 74 186 260
46 unless defined $sighash;
47  
48 260 ▶ return $sighash // $value;
Condition66%2/3
$sighash // $value
l!l&&r!l&&!r
186740
MC/DC0%0/2
$sighash // $value
$sighash $value
Truth table66%2/3
A // B
A= $sighashB= $value
ABresult
1X1
011
000
49 }
50  
51 38 1;
52  
« Crypto/Role/SignVerify.pm ↑ Summary Crypto/Transaction/UTXO.pm »