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

cartesi / rollups-explorer-api / 29954279174

22 Jul 2026 08:14PM UTC coverage: 99.208% (-0.1%) from 99.35%
29954279174

Pull #64

github

web-flow
Merge d49dabd08 into 9dff51544
Pull Request #64: refactor: deploy script changes

130 of 138 branches covered (94.2%)

Branch coverage included in aggregate %.

1122 of 1124 relevant lines covered (99.82%)

16.2 hits per line

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

96.81
/src/processor.ts
1
import {
2✔
2
    BlockData as BlockDataEvm,
3
    BlockHeader,
4
    DataHandlerContext,
5
    EvmBatchProcessor,
6
    EvmBatchProcessorFields,
7
    Log as _Log,
8
    Transaction as _Transaction,
9
} from '@subsquid/evm-processor';
2✔
10
import { events as CartesiApplicationFactory } from './abi/CartesiApplicationFactory';
2✔
11
import { events as CartesiDApp } from './abi/CartesiDApp';
2✔
12
import { events as CartesiDAppFactory } from './abi/CartesiDAppFactory';
2✔
13
import { events as InputBox } from './abi/InputBox';
2✔
14
import { events as InputBoxV2 } from './abi/InputBoxV2';
2✔
15
import {
16
    CartesiDAppFactoryAddress,
17
    InputBoxAddress,
18
    RollupsAddressBook,
19
    getConfig,
20
} from './config';
2✔
21
import { loadApplications } from './utils';
2✔
22

23
export type NetworkConfig = {
24
    archive: string;
25
    rpcUrl: string;
26
};
27

28
export const createProcessor = (chainId: number) => {
2✔
29
    const applicationMetadata = loadApplications(chainId);
62✔
30
    const config = getConfig(chainId);
62✔
31
    let processor = new EvmBatchProcessor()
62✔
32
        .setPrometheusPort(config.prometheusPort)
62✔
33
        .setFinalityConfirmation(config.finalityConfirmation ?? 10)
62!
34
        .setFields({
62✔
35
            transaction: {
62✔
36
                chainId: true,
62✔
37
                from: true,
62✔
38
                value: true,
62✔
39
                hash: true,
62✔
40
            },
62✔
41
        })
62✔
42
        .setBlockRange({
62✔
43
            from: config.from,
62✔
44
        })
62✔
45
        .addLog({
62✔
46
            address: [CartesiDAppFactoryAddress],
62✔
47
            topic0: [CartesiDAppFactory.ApplicationCreated.topic],
62✔
48
        })
62✔
49
        .addLog({
62✔
50
            address: [InputBoxAddress],
62✔
51
            topic0: [InputBox.InputAdded.topic],
62✔
52
            transaction: true,
62✔
53
        });
62✔
54

55
    if (config.v2) {
62✔
56
        processor = processor
60✔
57
            .addLog({
60✔
58
                address: [RollupsAddressBook.v2.ApplicationFactory],
60✔
59
                range: { from: config.v2.from },
60✔
60
                topic0: [CartesiApplicationFactory.ApplicationCreated.topic],
60✔
61
            })
60✔
62
            .addLog({
60✔
63
                address: [RollupsAddressBook.v2.InputBox],
60✔
64
                range: { from: config.v2.from },
60✔
65
                topic0: [InputBoxV2.InputAdded.topic],
60✔
66
                transaction: true,
60✔
67
            });
60✔
68
    }
60✔
69

70
    processor = config.dataSource.archive
60✔
71
        ? processor.setGateway(config.dataSource.archive)
48✔
72
        : processor;
12✔
73

74
    processor = config.dataSource.rpcEndpoint
62✔
75
        ? processor.setRpcEndpoint(config.dataSource.rpcEndpoint)
60!
76
        : processor;
×
77

78
    if (applicationMetadata !== null) {
62✔
79
        const dappFactoryAddresses =
12✔
80
            applicationMetadata.addresses[CartesiDAppFactoryAddress];
12✔
81
        const appFactoryAddresses =
12✔
82
            (config.v2 &&
12✔
83
                applicationMetadata.addresses[
12✔
84
                    RollupsAddressBook.v2.ApplicationFactory
12✔
85
                ]) ??
12✔
86
            [];
12✔
87

88
        processor = processor
12✔
89
            .addLog({
12✔
90
                address: [...dappFactoryAddresses, ...appFactoryAddresses],
12✔
91
                topic0: [CartesiDApp.OwnershipTransferred.topic],
12✔
92
                range: { from: config.from, to: applicationMetadata.height },
12✔
93
                transaction: true,
12✔
94
            })
12✔
95
            .addLog({
12✔
96
                topic0: [CartesiDApp.OwnershipTransferred.topic],
12✔
97
                range: { from: applicationMetadata.height + 1 },
12✔
98
                transaction: true,
12✔
99
            });
12✔
100
    } else {
62✔
101
        processor = processor.addLog({
48✔
102
            topic0: [CartesiDApp.OwnershipTransferred.topic],
48✔
103
            transaction: true,
48✔
104
        });
48✔
105
    }
48✔
106

107
    return processor;
60✔
108
};
60✔
109

110
export type Fields = EvmBatchProcessorFields<typeof createProcessor>;
111
export type Block = BlockHeader<Fields>;
112
export type BlockData = BlockDataEvm<Fields>;
113
export type Log = _Log<Fields>;
114
export type Transaction = _Transaction<Fields>;
115
export type ProcessorContext<Store> = DataHandlerContext<Store, Fields>;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc