-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor torii indexer system calls to transactions (#1068)
* Refactor torii indexer system calls to transactions * fix fmt
- Loading branch information
Showing
15 changed files
with
170 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use anyhow::{Error, Ok, Result}; | ||
use async_trait::async_trait; | ||
use starknet::core::types::{BlockWithTxs, InvokeTransactionReceipt, InvokeTransactionV1}; | ||
use starknet::providers::Provider; | ||
|
||
use super::TransactionProcessor; | ||
use crate::sql::Sql; | ||
|
||
#[derive(Default)] | ||
pub struct StoreTransactionProcessor; | ||
|
||
#[async_trait] | ||
impl<P: Provider + Sync> TransactionProcessor<P> for StoreTransactionProcessor { | ||
async fn process( | ||
&self, | ||
db: &mut Sql, | ||
_provider: &P, | ||
_block: &BlockWithTxs, | ||
_receipt: &InvokeTransactionReceipt, | ||
transaction: &InvokeTransactionV1, | ||
transaction_id: &str, | ||
) -> Result<(), Error> { | ||
db.store_transaction(transaction, transaction_id); | ||
|
||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.