line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Finance::Dogechain::Transaction; |
2
|
|
|
|
|
|
|
$Finance::Dogechain::Transaction::VERSION = '1.20210524.0142'; |
3
|
1
|
|
|
1
|
|
8
|
use Mojo::Base -base, -signatures, 'Finance::Dogechain::Base'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
4
|
1
|
|
|
1
|
|
260
|
use Finance::Dogechain::Address; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
has 'tx_id'; |
7
|
|
|
|
|
|
|
has 'transaction', sub($self) { |
8
|
|
|
|
|
|
|
my $tx = $self->return_field_if_success( '/transaction/' . $self->tx_id, 'transaction' ); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
convert_addresses_in_place( $tx->{inputs}, $tx->{outputs} ) if $tx; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
return $tx; |
13
|
|
|
|
|
|
|
}; |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
0
|
1
|
|
sub inputs($self) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
|
return $self->transaction->{inputs}; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
0
|
1
|
|
sub outputs($self) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
return $self->transaction->{outputs}; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
0
|
0
|
|
sub convert_addresses_in_place(@items) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
while (my $items = shift @items) { |
25
|
0
|
|
|
|
|
|
for my $item (@$items) { |
26
|
0
|
|
|
|
|
|
say $item->{address}; |
27
|
0
|
|
|
|
|
|
$item->{address} = Finance::Dogechain::Address->new( address => $item->{address} ); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
0
|
1
|
|
sub TO_JSON($self) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
return '[Finance::Dogechain::Transaction](tx_id => ' . $self->tx_id . ')'; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
'to the moon'; |
37
|
|
|
|
|
|
|
__END__ |