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

cartesi / rollups-explorer-api / 30018869366

23 Jul 2026 03:05PM UTC coverage: 99.208% (-0.1%) from 99.35%
30018869366

Pull #64

github

web-flow
Merge 844f574b5 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%)

8.1 hits per line

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

96.81
/src/processor.ts
1
import {
1✔
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';
1✔
10
import { events as CartesiApplicationFactory } from './abi/CartesiApplicationFactory';
1✔
11
import { events as CartesiDApp } from './abi/CartesiDApp';
1✔
12
import { events as CartesiDAppFactory } from './abi/CartesiDAppFactory';
1✔
13
import { events as InputBox } from './abi/InputBox';
1✔
14
import { events as InputBoxV2 } from './abi/InputBoxV2';
1✔
15
import {
16
    CartesiDAppFactoryAddress,
17
    InputBoxAddress,
18
    RollupsAddressBook,
19
    getConfig,
20
} from './config';
1✔
21
import { loadApplications } from './utils';
1✔
22

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

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

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

70
    processor = config.dataSource.archive
30✔
71
        ? processor.setGateway(config.dataSource.archive)
24✔
72
        : processor;
6✔
73

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

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

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

107
    return processor;
30✔
108
};
30✔
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