• 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

70.37
/packages/ui/src/GenericInputForm/AbiFunctionParams.tsx
1
import { useFormContext } from "./context";
1✔
2
import { Alert, Stack, Text, TextInput } from "@mantine/core";
1✔
3
import { TbAlertCircle } from "react-icons/tb";
1✔
4
import { InputLabel } from "./FunctionSignature";
1✔
5
import { Fragment } from "react";
1✔
6
import { TupleComponents } from "./TupleComponents";
1✔
7
import { AbiInputParam } from "./types";
8

9
export const AbiFunctionParams = () => {
1✔
10
    const form = useFormContext();
59✔
11
    const { abiFunction } = form.getTransformedValues();
59✔
12

13
    return (
59✔
14
        <>
59✔
15
            {abiFunction ? (
59✔
16
                <Stack>
30✔
17
                    {abiFunction.inputs.length > 0 ? (
30✔
18
                        <>
30✔
19
                            {abiFunction.inputs.map((input, index) => (
30✔
20
                                <Fragment key={`${input.name}-${input.type}`}>
60✔
21
                                    {input.type === "tuple" ? (
60!
NEW
22
                                        <TupleComponents
×
NEW
23
                                            input={input as AbiInputParam}
×
NEW
24
                                        />
×
25
                                    ) : (
26
                                        <TextInput
60✔
27
                                            key={`${input.name}-${input.type}`}
60✔
28
                                            label={<InputLabel input={input} />}
60✔
29
                                            placeholder={`Enter ${input.type} value`}
60✔
30
                                            withAsterisk
60✔
31
                                            {...form.getInputProps(
60✔
32
                                                `abiFunctionParams.${index}.value`,
60✔
33
                                            )}
60✔
34
                                        />
60✔
35
                                    )}
36
                                </Fragment>
60✔
37
                            ))}
30✔
38
                        </>
30!
39
                    ) : (
NEW
40
                        <Alert
×
NEW
41
                            variant="light"
×
NEW
42
                            color="blue"
×
NEW
43
                            icon={<TbAlertCircle />}
×
NEW
44
                            data-testid="empty-inputs-argments-alert"
×
NEW
45
                        >
×
NEW
46
                            No input arguments defined for{" "}
×
NEW
47
                            <Text span fz="sm" fw="bold">
×
NEW
48
                                {abiFunction.name}()
×
NEW
49
                            </Text>
×
50
                            .
NEW
51
                        </Alert>
×
52
                    )}
53
                </Stack>
30✔
54
            ) : null}
29✔
55
        </>
59✔
56
    );
57
};
59✔
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