nyxd_scraper_shared/modules/msg_module.rs
1// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
2// SPDX-License-Identifier: Apache-2.0
3
4use crate::block_processor::types::ParsedTransactionResponse;
5use crate::error::ScraperError;
6use crate::storage::NyxdScraperTransaction;
7use async_trait::async_trait;
8use cosmrs::Any;
9
10#[async_trait]
11pub trait MsgModule {
12 fn type_url(&self) -> String;
13
14 async fn handle_msg(
15 &mut self,
16 index: usize,
17 msg: &Any,
18 tx: &ParsedTransactionResponse,
19 storage_tx: &mut dyn NyxdScraperTransaction,
20 ) -> Result<(), ScraperError>;
21}