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