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

cartesi / rollups-explorer-api / 7216545272

15 Dec 2023 12:25AM UTC coverage: 99.377%. Remained the same
7216545272

push

github

web-flow
Feature: Env var derivation + running application (#20)

27 of 28 branches covered (0.0%)

Branch coverage included in aggregate %.

292 of 293 relevant lines covered (99.66%)

2.97 hits per line

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

100.0
/src/processor.ts
1
import {
1✔
2
    BlockHeader,
1✔
3
    DataHandlerContext,
1✔
4
    EvmBatchProcessor,
1✔
5
    EvmBatchProcessorFields,
1✔
6
    Log as _Log,
1✔
7
    Transaction as _Transaction,
1✔
8
} from '@subsquid/evm-processor';
1✔
9
import { events as CartesiDApp } from './abi/CartesiDApp';
1✔
10
import { events as CartesiDAppFactory } from './abi/CartesiDAppFactory';
1✔
11
import { events as InputBox } from './abi/InputBox';
1✔
12
import {
1✔
13
    CartesiDAppFactoryAddress,
1✔
14
    InputBoxAddress,
1✔
15
    getConfig,
1✔
16
} from './config';
1✔
17

1✔
18
export type NetworkConfig = {
1✔
19
    archive: string;
1✔
20
    rpcUrl: string;
1✔
21
};
1✔
22

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

1✔
55
export type Fields = EvmBatchProcessorFields<typeof EvmBatchProcessor>;
1✔
56
export type Block = BlockHeader<Fields>;
1✔
57
export type Log = _Log<Fields>;
1✔
58
export type Transaction = _Transaction<Fields>;
1✔
59
export type ProcessorContext<Store> = DataHandlerContext<Store, Fields>;
1✔
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

© 2026 Coveralls, Inc