| 1 | package Bitcoin::Crypto::Transaction::Flags; | ||||||||||||||||||||||||||||||||||
| 2 | 65 | $Bitcoin::Crypto::Transaction::Flags::VERSION = '4.005'; | |||||||||||||||||||||||||||||||||
| 3 | 65 | ▶ | use v5.14; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 4 | 65 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||
| 6 | 65 | ▶ | use Mooish::Base -standard; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||
| 8 | # BIP16 | ||||||||||||||||||||||||||||||||||
| 9 | 65 | has param 'p2sh' => ( | |||||||||||||||||||||||||||||||||
| 10 | coerce => Bool, | ||||||||||||||||||||||||||||||||||
| 11 | default => 1, | ||||||||||||||||||||||||||||||||||
| 12 | writer => 1, | ||||||||||||||||||||||||||||||||||
| 13 | ); | ||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||
| 15 | # BIP65 | ||||||||||||||||||||||||||||||||||
| 16 | 65 | has param 'checklocktimeverify' => ( | |||||||||||||||||||||||||||||||||
| 17 | coerce => Bool, | ||||||||||||||||||||||||||||||||||
| 18 | default => 1, | ||||||||||||||||||||||||||||||||||
| 19 | writer => 1, | ||||||||||||||||||||||||||||||||||
| 20 | ); | ||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||
| 22 | # BIP66 | ||||||||||||||||||||||||||||||||||
| 23 | 65 | has param 'der_signatures' => ( | |||||||||||||||||||||||||||||||||
| 24 | coerce => Bool, | ||||||||||||||||||||||||||||||||||
| 25 | default => 1, | ||||||||||||||||||||||||||||||||||
| 26 | writer => 1, | ||||||||||||||||||||||||||||||||||
| 27 | ); | ||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||
| 29 | # BIP112 | ||||||||||||||||||||||||||||||||||
| 30 | 65 | has param 'checksequenceverify' => ( | |||||||||||||||||||||||||||||||||
| 31 | coerce => Bool, | ||||||||||||||||||||||||||||||||||
| 32 | default => 1, | ||||||||||||||||||||||||||||||||||
| 33 | writer => 1, | ||||||||||||||||||||||||||||||||||
| 34 | ); | ||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||
| 36 | # BIP141 | ||||||||||||||||||||||||||||||||||
| 37 | 65 | has param 'segwit' => ( | |||||||||||||||||||||||||||||||||
| 38 | coerce => Bool, | ||||||||||||||||||||||||||||||||||
| 39 | default => 1, | ||||||||||||||||||||||||||||||||||
| 40 | writer => 1, | ||||||||||||||||||||||||||||||||||
| 41 | ); | ||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||
| 43 | # BIP147 | ||||||||||||||||||||||||||||||||||
| 44 | 65 | has param 'null_dummy' => ( | |||||||||||||||||||||||||||||||||
| 45 | coerce => Bool, | ||||||||||||||||||||||||||||||||||
| 46 | default => 1, | ||||||||||||||||||||||||||||||||||
| 47 | writer => 1, | ||||||||||||||||||||||||||||||||||
| 48 | ); | ||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||
| 50 | # BIP341 | ||||||||||||||||||||||||||||||||||
| 51 | 65 | has param 'taproot' => ( | |||||||||||||||||||||||||||||||||
| 52 | coerce => Bool, | ||||||||||||||||||||||||||||||||||
| 53 | default => 1, | ||||||||||||||||||||||||||||||||||
| 54 | writer => 1, | ||||||||||||||||||||||||||||||||||
| 55 | ); | ||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||
| 57 | # optional standardness rules below | ||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||
| 59 | 65 | has param 'signature_pushes_only' => ( | |||||||||||||||||||||||||||||||||
| 60 | coerce => Bool, | ||||||||||||||||||||||||||||||||||
| 61 | default => 0, | ||||||||||||||||||||||||||||||||||
| 62 | writer => 1, | ||||||||||||||||||||||||||||||||||
| 63 | ); | ||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||
| 65 | # segwit only | ||||||||||||||||||||||||||||||||||
| 66 | 65 | has param 'minimal_if' => ( | |||||||||||||||||||||||||||||||||
| 67 | coerce => Bool, | ||||||||||||||||||||||||||||||||||
| 68 | default => 0, | ||||||||||||||||||||||||||||||||||
| 69 | writer => 1, | ||||||||||||||||||||||||||||||||||
| 70 | ); | ||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||
| 72 | # segwit only | ||||||||||||||||||||||||||||||||||
| 73 | 65 | has param 'compressed_pubkeys' => ( | |||||||||||||||||||||||||||||||||
| 74 | coerce => Bool, | ||||||||||||||||||||||||||||||||||
| 75 | default => 0, | ||||||||||||||||||||||||||||||||||
| 76 | writer => 1, | ||||||||||||||||||||||||||||||||||
| 77 | ); | ||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||
| 79 | 65 | has param 'strict_encoding' => ( | |||||||||||||||||||||||||||||||||
| 80 | coerce => Bool, | ||||||||||||||||||||||||||||||||||
| 81 | default => 0, | ||||||||||||||||||||||||||||||||||
| 82 | writer => 1, | ||||||||||||||||||||||||||||||||||
| 83 | ); | ||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||
| 85 | 65 | has param 'low_s_signatures' => ( | |||||||||||||||||||||||||||||||||
| 86 | coerce => Bool, | ||||||||||||||||||||||||||||||||||
| 87 | default => 0, | ||||||||||||||||||||||||||||||||||
| 88 | writer => 1, | ||||||||||||||||||||||||||||||||||
| 89 | ); | ||||||||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||||||||
| 91 | 65 | has param 'minimal_data' => ( | |||||||||||||||||||||||||||||||||
| 92 | coerce => Bool, | ||||||||||||||||||||||||||||||||||
| 93 | default => 0, | ||||||||||||||||||||||||||||||||||
| 94 | writer => 1, | ||||||||||||||||||||||||||||||||||
| 95 | ); | ||||||||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||||||||
| 97 | 65 | has param 'null_fail' => ( | |||||||||||||||||||||||||||||||||
| 98 | coerce => Bool, | ||||||||||||||||||||||||||||||||||
| 99 | default => 0, | ||||||||||||||||||||||||||||||||||
| 100 | writer => 1, | ||||||||||||||||||||||||||||||||||
| 101 | ); | ||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||
| 103 | 65 | has param 'clean_stack' => ( | |||||||||||||||||||||||||||||||||
| 104 | coerce => Bool, | ||||||||||||||||||||||||||||||||||
| 105 | default => 0, | ||||||||||||||||||||||||||||||||||
| 106 | writer => 1, | ||||||||||||||||||||||||||||||||||
| 107 | ); | ||||||||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||||||||
| 109 | 65 | has param 'const_script' => ( | |||||||||||||||||||||||||||||||||
| 110 | coerce => Bool, | ||||||||||||||||||||||||||||||||||
| 111 | default => 0, | ||||||||||||||||||||||||||||||||||
| 112 | writer => 1, | ||||||||||||||||||||||||||||||||||
| 113 | ); | ||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||
| 115 | 65 | has param 'known_witness' => ( | |||||||||||||||||||||||||||||||||
| 116 | coerce => Bool, | ||||||||||||||||||||||||||||||||||
| 117 | default => 0, | ||||||||||||||||||||||||||||||||||
| 118 | writer => 1, | ||||||||||||||||||||||||||||||||||
| 119 | ); | ||||||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||||||
| 121 | 65 | has param 'illegal_upgradeable_nops' => ( | |||||||||||||||||||||||||||||||||
| 122 | coerce => Bool, | ||||||||||||||||||||||||||||||||||
| 123 | default => 0, | ||||||||||||||||||||||||||||||||||
| 124 | writer => 1, | ||||||||||||||||||||||||||||||||||
| 125 | ); | ||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||
| 127 | sub new_empty | ||||||||||||||||||||||||||||||||||
| 128 | 8 | ▶ | { | ||||||||||||||||||||||||||||||||
|
Subroutine
new_empty: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 129 | 8 | my ($self, %args) = @_; | |||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||
| 131 | 8 | return $self->new( | |||||||||||||||||||||||||||||||||
| 132 | p2sh => !!0, | ||||||||||||||||||||||||||||||||||
| 133 | checklocktimeverify => !!0, | ||||||||||||||||||||||||||||||||||
| 134 | der_signatures => !!0, | ||||||||||||||||||||||||||||||||||
| 135 | checksequenceverify => !!0, | ||||||||||||||||||||||||||||||||||
| 136 | segwit => !!0, | ||||||||||||||||||||||||||||||||||
| 137 | null_dummy => !!0, | ||||||||||||||||||||||||||||||||||
| 138 | taproot => !!0, | ||||||||||||||||||||||||||||||||||
| 139 | %args, | ||||||||||||||||||||||||||||||||||
| 140 | ); | ||||||||||||||||||||||||||||||||||
| 141 | } | ||||||||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||||||||
| 143 | sub new_full | ||||||||||||||||||||||||||||||||||
| 144 | 2 | ▶ | { | ||||||||||||||||||||||||||||||||
|
Subroutine
new_full: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 145 | 2 | my ($self, %args) = @_; | |||||||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||||||||
| 147 | 2 | return $self->new( | |||||||||||||||||||||||||||||||||
| 148 | signature_pushes_only => !!1, | ||||||||||||||||||||||||||||||||||
| 149 | minimal_if => !!1, | ||||||||||||||||||||||||||||||||||
| 150 | compressed_pubkeys => !!1, | ||||||||||||||||||||||||||||||||||
| 151 | strict_encoding => !!1, | ||||||||||||||||||||||||||||||||||
| 152 | low_s_signatures => !!1, | ||||||||||||||||||||||||||||||||||
| 153 | minimal_data => !!1, | ||||||||||||||||||||||||||||||||||
| 154 | null_fail => !!1, | ||||||||||||||||||||||||||||||||||
| 155 | clean_stack => !!1, | ||||||||||||||||||||||||||||||||||
| 156 | const_script => !!1, | ||||||||||||||||||||||||||||||||||
| 157 | known_witness => !!1, | ||||||||||||||||||||||||||||||||||
| 158 | illegal_upgradeable_nops => !!1, | ||||||||||||||||||||||||||||||||||
| 159 | %args, | ||||||||||||||||||||||||||||||||||
| 160 | ); | ||||||||||||||||||||||||||||||||||
| 161 | } | ||||||||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||||||||
| 163 | sub strict_signatures | ||||||||||||||||||||||||||||||||||
| 164 | 266 | ▶ | { | ||||||||||||||||||||||||||||||||
|
Subroutine
strict_signatures: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 165 | 266 | my ($self) = @_; | |||||||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||||||||
| 167 | 266 | ▶ | return $self->der_signatures | ||||||||||||||||||||||||||||||||
|
Condition83%5/6
$self->der_signatures || $self->low_s_signatures || $self->strict_encoding
$self->der_signatures or $self->low_s_signatures
MC/DC66%2/3
$self->der_signatures || $self->low_s_signatures || $self->strict_encoding
$self->der_signatures
$self->low_s_signatures
$self->strict_encoding
Truth table75%3/4
A or B || C
A= $self->der_signaturesB= $self->low_s_signaturesC= $self->strict_encoding
| |||||||||||||||||||||||||||||||||||
| 168 | || $self->low_s_signatures | ||||||||||||||||||||||||||||||||||
| 169 | || $self->strict_encoding; | ||||||||||||||||||||||||||||||||||
| 170 | } | ||||||||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||||||||
| 172 | 65 | 1; | |||||||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||||||||
| 174 | __END__ | ||||||||||||||||||||||||||||||||||