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/PSBT/FieldType.pm »
1 package Bitcoin::Crypto::Transaction::Digest::Config;
2 34 $Bitcoin::Crypto::Transaction::Digest::Config::VERSION = '4.005';
3 34 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 34 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 34 ▶use Mooish::Base -standard;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 34 ▶use Bitcoin::Crypto::Types -types;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 34 has param 'signing_index' => (
11 isa => PositiveOrZeroInt,
12 );
13  
14 34 has param 'signing_subscript' => (
15 coerce => ByteStr,
16 required => 0,
17 );
18  
19 34 has param 'sighash' => (
20 isa => PositiveOrZeroInt,
21 required => 0,
22 writer => -hidden,
23 );
24  
25 34 has param 'taproot_ext_flag' => (
26 isa => PositiveOrZeroInt,
27 default => 0,
28 );
29  
30 34 has param 'taproot_ext' => (
31 coerce => ByteStr,
32 required => 0,
33 );
34  
35 34 has param 'taproot_annex' => (
36 coerce => ByteStr,
37 required => 0,
38 );
39  
40 sub _default_sighash
41 213 ▶{
Subroutine _default_sighash: called CC=3 SCAR=11.0
42 213 my ($self, $value) = @_;
43  
44 213 my $sighash = $self->sighash;
45 213 ▶ $self->_set_sighash($value)
Branch: 1 branch
BranchTrueFalseTotal
unless defined $sighash 50 163 213
46 unless defined $sighash;
47  
48 213 ▶ return $sighash // $value;
Condition66%2/3
$sighash // $value
l!l&&r!l&&!r
163500
MC/DC0%0/2
$sighash // $value
$sighash $value
Truth table66%2/3
A // B
A= $sighashB= $value
ABresult
1X1
011
000
49 }
50  
51 34 1;
52  
« Crypto/Role/SignVerify.pm ↑ Summary Crypto/PSBT/FieldType.pm »