| 1 | package Finance::Dogechain::Block; | ||||||||||
| 2 | 1 | $Finance::Dogechain::Block::VERSION = '1.20210418.2306'; | |||||||||
| 3 | 1 | ▶ | use Mojo::Base -base, -signatures, 'Finance::Dogechain::Base'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use Finance::Dogechain::Transaction; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | has 'block_id'; | |||||||||
| 7 | |||||||||||
| 8 | ▶ | sub block($self) { | |||||||||
|
Subroutine
block: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 9 | 0 | my $block = $self->return_field_if_success( '/block/' . $self->block_id, 'block' ); | |||||||||
| 10 | 0 | say JSON->new->pretty->encode( $block ); | |||||||||
| 11 | |||||||||||
| 12 | 0 | ▶ | if ($block) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | 0 | $self->convert_transactions_in_place( $block->{txs} ); | |||||||||
| 14 | } | ||||||||||
| 15 | |||||||||||
| 16 | 0 | return $block; | |||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | ▶ | sub convert_transactions_in_place($self, $txs) { | |||||||||
|
Subroutine
convert_transactions_in_place: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 20 | 0 | ▶ | while (my ($i, $tx_id) = each @$txs) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | 0 | $txs->[$i] = Finance::Dogechain::Transaction->new( tx_id => $tx_id ); | |||||||||
| 22 | } | ||||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | ▶ | sub TO_JSON($self) { | |||||||||
|
Subroutine
TO_JSON: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 26 | 0 | return '[Finance::Dogechain::Block](block_id => ' . $self->block_id . ')'; | |||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | 1 | 'to the moon'; | |||||||||
| 30 | __END__ | ||||||||||