| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Blockchain::Ethereum::Transaction::EIP2930; |
|
2
|
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
275588
|
use v5.26; |
|
|
2
|
|
|
|
|
10
|
|
|
4
|
2
|
|
|
2
|
|
14
|
use strict; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
99
|
|
|
5
|
2
|
|
|
2
|
|
18
|
use warnings; |
|
|
2
|
|
|
|
|
6
|
|
|
|
2
|
|
|
|
|
221
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# ABSTRACT: Ethereum Access List transaction abstraction (EIP-2930) |
|
8
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:REFECO'; # AUTHORITY |
|
9
|
|
|
|
|
|
|
our $VERSION = '0.021'; # VERSION |
|
10
|
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
548
|
use parent 'Blockchain::Ethereum::Transaction'; |
|
|
2
|
|
|
|
|
351
|
|
|
|
2
|
|
|
|
|
17
|
|
|
12
|
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
191
|
use constant TRANSACTION_PREFIX => pack("H*", '01'); |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
803
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub new { |
|
16
|
4
|
|
|
4
|
0
|
9245
|
my ($class, %args) = @_; |
|
17
|
|
|
|
|
|
|
|
|
18
|
4
|
|
|
|
|
40
|
my $self = $class->SUPER::new(%args); |
|
19
|
|
|
|
|
|
|
|
|
20
|
4
|
|
|
|
|
13
|
foreach (qw( gas_price access_list )) { |
|
21
|
8
|
100
|
|
|
|
49
|
$self->{$_} = $args{$_} if exists $args{$_}; |
|
22
|
|
|
|
|
|
|
} |
|
23
|
|
|
|
|
|
|
|
|
24
|
4
|
|
|
|
|
12
|
bless $self, $class; |
|
25
|
4
|
|
|
|
|
23
|
return $self; |
|
26
|
|
|
|
|
|
|
} |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub gas_price { |
|
29
|
4
|
|
|
4
|
0
|
17
|
return shift->{gas_price}; |
|
30
|
|
|
|
|
|
|
} |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub access_list { |
|
33
|
6
|
|
100
|
6
|
0
|
30
|
return shift->{access_list} // []; |
|
34
|
|
|
|
|
|
|
} |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub serialize { |
|
37
|
4
|
|
|
4
|
1
|
14
|
my $self = shift; |
|
38
|
|
|
|
|
|
|
|
|
39
|
4
|
|
|
|
|
22
|
my @params = |
|
40
|
|
|
|
|
|
|
($self->chain_id, $self->nonce, $self->gas_price, $self->gas_limit, $self->to, $self->value, $self->data, $self->_encode_access_list,); |
|
41
|
|
|
|
|
|
|
|
|
42
|
4
|
|
|
|
|
17
|
@params = $self->_normalize_params(\@params)->@*; |
|
43
|
|
|
|
|
|
|
|
|
44
|
4
|
50
|
66
|
|
|
25
|
push(@params, $self->v, $self->r, $self->s) |
|
|
|
|
66
|
|
|
|
|
|
45
|
|
|
|
|
|
|
if $self->v && $self->r && $self->s; |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# eip-2930 transactions must be prefixed by 1 that is the |
|
48
|
|
|
|
|
|
|
# transaction type |
|
49
|
4
|
|
|
|
|
17
|
return TRANSACTION_PREFIX . $self->rlp->encode(\@params); |
|
50
|
|
|
|
|
|
|
} |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__END__ |