• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cartesi / rollups-explorer / 11726651411

07 Nov 2024 03:57PM CUT coverage: 86.104% (-0.5%) from 86.605%
11726651411

Pull #256

github

nevendyulgerov
chore(packages/ui): Cleanup
Pull Request #256: #251 Add ABI encoding for raw input form

1366 of 1627 branches covered (83.96%)

Branch coverage included in aggregate %.

756 of 920 new or added lines in 13 files covered. (82.17%)

9428 of 10909 relevant lines covered (86.42%)

47.35 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.56
/packages/ui/src/GenericInputForm/FunctionSignature.tsx
1
import { AbiFunction, AbiParameter } from "viem";
1✔
2
import { FC, Fragment } from "react";
1✔
3
import { Box, Text } from "@mantine/core";
1✔
4
import { AbiInputParam } from "./types";
5

6
interface FunctionParamLabelProps {
7
    input: AbiParameter;
8
}
9

10
export const FunctionParamLabel: FC<FunctionParamLabelProps> = ({ input }) => {
1✔
11
    return (
164✔
12
        <Box display="inline">
164✔
13
            <Text c="cyan" span fz="sm">
164✔
14
                {input.type}
164✔
15
            </Text>{" "}
164✔
16
            <Text span fz="sm">
164✔
17
                {input.name}
164✔
18
            </Text>
164✔
19
        </Box>
164✔
20
    );
21
};
164✔
22

23
interface InputLabelProps {
24
    input: AbiParameter | AbiInputParam;
25
}
26

27
export const InputLabel: FC<InputLabelProps> = ({ input }) => {
1✔
28
    return (
60✔
29
        <>
60✔
30
            {input.name && input.type ? (
60✔
31
                <FunctionParamLabel input={input} />
60!
32
            ) : (
NEW
33
                input.name || input.type
×
34
            )}
35
        </>
60✔
36
    );
37
};
60✔
38

39
interface FunctionSignatureProps {
40
    abiFunction: AbiFunction;
41
}
42

43
export const FunctionSignature: FC<FunctionSignatureProps> = ({
1✔
44
    abiFunction,
52✔
45
}) => {
52✔
46
    return (
52✔
47
        <>
52✔
48
            <Text span fw="bold" fz="sm">
52✔
49
                {abiFunction.name}
52✔
50
            </Text>
52✔
51
            (
52
            {abiFunction.inputs.map((input, index) => (
52✔
53
                <Fragment key={`${input.type}-${input.name}`}>
104✔
54
                    <FunctionParamLabel input={input} />
104✔
55
                    {index < abiFunction.inputs.length - 1 ? ", " : ""}
104✔
56
                </Fragment>
104✔
57
            ))}
52✔
58
            )
59
        </>
52✔
60
    );
61
};
52✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc