Blockchain-Ethereum-Keystore
view release on metacpan or search on metacpan
lib/Blockchain/Ethereum/Keystore/Keyfile.pm view on Meta::CPAN
6061626364656667686970717273747576777879808182}
sub
_json {
return
shift
->{json} //= JSON::MaybeXS->new(
utf8
=> 1);
}
sub
import_file {
my
(
$self
,
$file_path
,
$password
) =
@_
;
my
$content
= read_file(
$file_path
);
my
$decoded
=
$self
->_json->decode(
lc
$content
);
return
$self
->_from_object(
$decoded
,
$password
);
}
sub
_from_object {
my
(
$self
,
$object
,
$password
) =
@_
;
my
$version
=
$object
->{version};
croak
'Version not supported'
unless
$version
&&
$version
== 3;
return
$self
->_from_v3(
$object
,
$password
);
( run in 0.240 second using v1.01-cache-2.11-cpan-1dc43b0fbd2 )