line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bitcoin::Crypto::Script::Transaction; |
2
|
|
|
|
|
|
|
$Bitcoin::Crypto::Script::Transaction::VERSION = '2.000_01'; # TRIAL |
3
|
|
|
|
|
|
|
$Bitcoin::Crypto::Script::Transaction::VERSION = '2.00001'; |
4
|
29
|
|
|
29
|
|
386
|
use v5.10; |
|
29
|
|
|
|
|
134
|
|
5
|
29
|
|
|
29
|
|
484
|
use strict; |
|
29
|
|
|
|
|
225
|
|
|
29
|
|
|
|
|
611
|
|
6
|
29
|
|
|
29
|
|
189
|
use warnings; |
|
29
|
|
|
|
|
88
|
|
|
29
|
|
|
|
|
771
|
|
7
|
29
|
|
|
29
|
|
165
|
use Moo; |
|
29
|
|
|
|
|
68
|
|
|
29
|
|
|
|
|
189
|
|
8
|
29
|
|
|
29
|
|
11576
|
use Mooish::AttributeBuilder -standard; |
|
29
|
|
|
|
|
151
|
|
|
29
|
|
|
|
|
242
|
|
9
|
29
|
|
|
29
|
|
3588
|
use Type::Params -sigs; |
|
29
|
|
|
|
|
204
|
|
|
29
|
|
|
|
|
197
|
|
10
|
|
|
|
|
|
|
|
11
|
29
|
|
|
29
|
|
13060
|
use Bitcoin::Crypto::Types qw(Object InstanceOf PositiveOrZeroInt ByteStr); |
|
29
|
|
|
|
|
179
|
|
|
29
|
|
|
|
|
248
|
|
12
|
29
|
|
|
29
|
|
105011
|
use Bitcoin::Crypto::Exception; |
|
29
|
|
|
|
|
147
|
|
|
29
|
|
|
|
|
689
|
|
13
|
|
|
|
|
|
|
|
14
|
29
|
|
|
29
|
|
169
|
use namespace::clean; |
|
29
|
|
|
|
|
73
|
|
|
29
|
|
|
|
|
294
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has param 'transaction' => ( |
17
|
|
|
|
|
|
|
isa => InstanceOf ['Bitcoin::Crypto::Transaction'], |
18
|
|
|
|
|
|
|
handles => [ |
19
|
|
|
|
|
|
|
qw( |
20
|
|
|
|
|
|
|
version |
21
|
|
|
|
|
|
|
locktime |
22
|
|
|
|
|
|
|
inputs |
23
|
|
|
|
|
|
|
outputs |
24
|
|
|
|
|
|
|
) |
25
|
|
|
|
|
|
|
], |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
has param 'input_index' => ( |
29
|
|
|
|
|
|
|
isa => PositiveOrZeroInt, |
30
|
|
|
|
|
|
|
writer => 1, |
31
|
|
|
|
|
|
|
default => 0, |
32
|
|
|
|
|
|
|
); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
signature_for get_digest => ( |
35
|
|
|
|
|
|
|
method => Object, |
36
|
|
|
|
|
|
|
positional => [ByteStr, PositiveOrZeroInt], |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub get_digest |
40
|
|
|
|
|
|
|
{ |
41
|
|
|
|
|
|
|
my ($self, $subscript, $sighash) = @_; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
return $self->transaction->get_digest( |
44
|
|
|
|
|
|
|
signing_index => $self->input_index, |
45
|
|
|
|
|
|
|
signing_subscript => $subscript, |
46
|
|
|
|
|
|
|
sighash => $sighash |
47
|
|
|
|
|
|
|
); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub this_input |
51
|
|
|
|
|
|
|
{ |
52
|
23
|
|
|
23
|
0
|
55
|
my ($self) = @_; |
53
|
|
|
|
|
|
|
|
54
|
23
|
|
|
|
|
493
|
return $self->inputs->[$self->input_index]; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub is_native_segwit |
58
|
|
|
|
|
|
|
{ |
59
|
15
|
|
|
15
|
0
|
48
|
my ($self) = @_; |
60
|
|
|
|
|
|
|
|
61
|
15
|
|
|
|
|
76
|
return $self->this_input->utxo->output->locking_script->is_native_segwit; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
1; |
65
|
|
|
|
|
|
|
|