near / near-indexer-for-explorer

Watch NEAR network and store all the data from NEAR blockchain to PostgreSQL database
https://near-indexers.io/docs/projects/near-indexer-for-explorer
GNU General Public License v3.0
123 stars 56 forks source link

refactor: rearrange methods in tx_actions, receipt_actions #358

Closed telezhnaya closed 1 year ago

telezhnaya commented 1 year ago

I've made some refactoring before I'll introduce meta tx support logic

  1. get rid of std::sync::Arc::clone because it looks scary to me, we can just use .clone() instead, the same method is used
  2. split the methods. I'll add more logic to some of them further
  3. parallelize receipts tables inserts, it should work a little faster with this change
  4. fix a small bug in transaction_actions: tx_hash for duplicated transaction will point out to its parent instead of the first original tx