-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
122 additions
and
98 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,30 @@ | ||
use crate::types::{StorageError, TokenMetadata}; | ||
use anyhow::Result; | ||
use ark_starknet::CairoU256; | ||
use async_trait::async_trait; | ||
#[cfg(any(test, feature = "mock"))] | ||
use mockall::automock; | ||
use starknet::core::types::FieldElement; | ||
|
||
#[cfg_attr(any(test, feature = "mock"), automock)] | ||
#[async_trait] | ||
pub trait Storage { | ||
async fn register_token_metadata( | ||
&self, | ||
contract_address: &FieldElement, | ||
token_id: CairoU256, | ||
contract_address: &str, | ||
token_id: &str, | ||
chain_id: &str, | ||
token_metadata: TokenMetadata, | ||
) -> Result<(), StorageError>; | ||
|
||
async fn has_token_metadata( | ||
&self, | ||
contract_address: FieldElement, | ||
token_id: CairoU256, | ||
) -> Result<bool, StorageError>; | ||
|
||
async fn find_token_ids_without_metadata( | ||
&self, | ||
contract_address_filter: Option<FieldElement>, | ||
) -> Result<Vec<(FieldElement, CairoU256)>, StorageError>; | ||
filter: Option<(String, String)>, | ||
) -> Result<Vec<(String, String, String)>, StorageError>; | ||
|
||
async fn update_token_metadata_status( | ||
&self, | ||
contract_address: FieldElement, | ||
token_id: CairoU256, | ||
contract_address: &str, | ||
token_id: &str, | ||
chain_id: &str, | ||
metadata_status: &str, | ||
) -> Result<(), StorageError>; | ||
} |
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
Oops, something went wrong.