Blockchain-Ethereum-Keystore

 view release on metacpan or  search on metacpan

lib/Blockchain/Ethereum/Keystore/Keyfile.pm  view on Meta::CPAN

}

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.275 second using v1.01-cache-2.11-cpan-d6f9594c0a5 )