| 1 | package Finance::Dogechain::Transaction; | ||||||||||
| 2 | 1 | $Finance::Dogechain::Transaction::VERSION = '1.20210524.0142'; | |||||||||
| 3 | 1 | ▶ | use Mojo::Base -base, -signatures, 'Finance::Dogechain::Base'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use Finance::Dogechain::Address; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | has 'tx_id'; | |||||||||
| 7 | ▶ | has 'transaction', sub($self) { | |||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||
| 8 | 0 | my $tx = $self->return_field_if_success( '/transaction/' . $self->tx_id, 'transaction' ); | |||||||||
| 9 | |||||||||||
| 10 | 0 | ▶ | convert_addresses_in_place( $tx->{inputs}, $tx->{outputs} ) if $tx; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 11 | |||||||||||
| 12 | 0 | return $tx; | |||||||||
| 13 | 1 | }; | |||||||||
| 14 | |||||||||||
| 15 | ▶ | sub inputs($self) { | |||||||||
|
Subroutine
inputs: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 16 | 0 | return $self->transaction->{inputs}; | |||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | ▶ | sub outputs($self) { | |||||||||
|
Subroutine
outputs: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 20 | 0 | return $self->transaction->{outputs}; | |||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | ▶ | sub convert_addresses_in_place(@items) { | |||||||||
|
Subroutine
convert_addresses_in_place: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 24 | 0 | ▶ | while (my $items = shift @items) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 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 | ▶ | sub TO_JSON($self) { | |||||||||
|
Subroutine
TO_JSON: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 33 | 0 | return '[Finance::Dogechain::Transaction](tx_id => ' . $self->tx_id . ')'; | |||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 1 | 'to the moon'; | |||||||||
| 37 | __END__ | ||||||||||