File Coverage

blib/lib/REFECO/Blockchain/Contract/Solidity/ABI/Type/Address.pm
Criterion Covered Total %
statement 23 23 100.0
branch 2 2 100.0
condition n/a
subroutine 8 8 100.0
pod 0 2 0.0
total 33 35 94.2


line stmt bran cond sub pod time code
1             package REFECO::Blockchain::Contract::Solidity::ABI::Type::Address;
2              
3 3     3   1853 use v5.26;
  3         12  
4 3     3   19 use strict;
  3         7  
  3         89  
5 3     3   17 use warnings;
  3         7  
  3         78  
6 3     3   16 no indirect;
  3         7  
  3         23  
7              
8 3     3   156 use Carp;
  3         8  
  3         242  
9 3     3   25 use parent qw(REFECO::Blockchain::Contract::Solidity::ABI::Type);
  3         7  
  3         20  
10              
11             sub encode {
12 16     16 0 38 my $self = shift;
13 16 100       41 return $self->encoded if $self->encoded;
14 8         27 $self->push_static($self->pad_left(substr($self->data, 2)));
15              
16 8         29 return $self->encoded;
17             }
18              
19             sub decode {
20 8     8 0 14 my $self = shift;
21 8         23 return '0x' . substr $self->data->[0], -40;
22             }
23              
24             1;
25