Contract/Helper/ImportHelper.pm

filter: Statementstmt 77.7% 14 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 1 totaltotal 75.0% 18 / 24 CC 1 SCAR 1.8
CC
1
Cov
78%
from_truffle_build
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Contract/Helper/UnitConversion.pm ↑ Summary
1 package Ethereum::RPC::Contract::Helper::ImportHelper;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 ▶use Path::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 3 our $VERSION = '0.05';
9  
10 =head1 NAME
11  
12 Ethereum::RPC::Contract::Helper::ImportHelper - ImportHelper
13  
14 =cut
15  
16 3 ▶use JSON::MaybeXS;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 =head2 to_hex
19  
20 Auxiliar to get bytecode and the ABI from the compiled truffle json.
21  
22 Parameters:
23 file path
24  
25 Return:
26 {abi, bytecode}
27  
28 =cut
29  
30 0 ▶sub from_truffle_build {
Subroutine from_truffle_build: not called CC=1 SCAR=6.9
Pod undocumented
31 0 my $file = shift;
32  
33 0 my $document = path($file)->slurp_utf8;
34  
35 0 my $decoded_json = decode_json($document);
36  
37 return {
38 abi => encode_json($decoded_json->{abi}),
39 0 bytecode => $decoded_json->{bytecode}};
40 }
41  
42 3 1;
« Contract/Helper/UnitConversion.pm ↑ Summary