aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

[Indexer] Create ledger_info table and add test

Open bowenyang007 opened this issue 3 years ago • 0 comments
trafficstars

Description

Saves chain_id when the indexer starts. If we somehow try to index a different chain, exit program.

I also had to create a trait for TransactionFetcher in order to mock the data for the test.

Test Plan

Cargo test

running 1 test
test indexer::tailer::test::test_chain_id_check ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out; finished in 0.00s

Also tested by running cargo run -- --pg-uri "postgresql://localhost/postgres" --node-url "http://0.0.0.0:8080" --emit-every 25 --batch-size 100 and making sure that if we tail a different full node (e.g. devnode) the process crashes.


This change is Reviewable

bowenyang007 avatar Jul 29 '22 00:07 bowenyang007