Skip to content

Commit

Permalink
update protobuf schemas version
Browse files Browse the repository at this point in the history
  • Loading branch information
imabdulbasit committed Sep 12, 2023
1 parent f98fd9d commit a132905
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 17 deletions.
14 changes: 7 additions & 7 deletions api/proto.lock
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
[[schemas]]
subject = "customer"
version = 1
version = 2
sha512 = "d75800df0d4744c6b0f4d9a9952d3bfd0bb6b24a8babd19104cc11b54a525f85551b3c7375d69aeabbcf629cd826aa0bc6b0c0467add20716c504f5e856ce1c5"

[[schemas]]
subject = "nfts"
version = 3
version = 29
sha512 = "b3b2136bd6c7a136d317da84395661de5fc056e8270510575a3281d78884d99a0d89f444754ed02cb18ad26dcc7cd65300c1df73b9d74d2edc6bcc8d552465d0"

[[schemas]]
subject = "organization"
version = 1
version = 5
sha512 = "9fb28ac73d9712292297394a5fa53a7dae9deba6847353582987ba749859301c23c05fd49d2ce84a1640f8864c5c04d59fa38907700b280000e5c4afc96654bf"

[[schemas]]
subject = "polygon_nfts"
version = 1
version = 6
sha512 = "c5ddf43d2958ec690ee2261d0ff9808b67ce810d2fc4b6077f96f561929a920f03509fc8bd7adbda219250eb019f5f7be8a3f51c554f665ea1881f7a973ef2a6"

[[schemas]]
subject = "solana_nfts"
version = 4
version = 11
sha512 = "967fefde938a0f6ce05194e4fca15673e681caac54d8aeec114c5d38418632b9696dbaf5362345a15114e5abb49de55d0af8b9edcc0f2c91f9ef1ccc4ff55d68"

[[schemas]]
Expand All @@ -30,5 +30,5 @@ sha512 = "d167e0a143c813073eef8597f0b237e5a8eaf32abbf709724e8071b2dd73ce0438b82f

[[schemas]]
subject = "treasury"
version = 1
sha512 = "03580129f0561b3d153f83b9f2729bd18e27c7d29815c9c3b7493e57e3cad3ea56f6e803e0ec5f19e8c17669de5ef8c0eb1bd59cfbae5f400741d0a73a464ba5"
version = 23
sha512 = "0e4d77999767d5971122e720c1cee7a57c3e47ce69f58a582f1762d8e65e031ea3bd9024cfc21bd7da5db6e38a71657151c58cdfa21d9ff643fb2fc657105cf5"
14 changes: 7 additions & 7 deletions api/proto.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[registry]
endpoint = "http://localhost:8081"
endpoint = "https://schemas.holaplex.tools"

[schemas]
organization = 1
nfts = 3
customer = 1
treasury = 1
solana_nfts = 4
polygon_nfts = 1
organization = 5
nfts = 29
customer = 2
treasury = 23
solana_nfts = 11
polygon_nfts = 6
timestamp = 1
6 changes: 3 additions & 3 deletions api/src/dataloaders/switch_collection_histories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ impl DataLoader<Uuid> for SwitchCollectionHistoryLoader {
Ok(switch_histories.into_iter().fold(
HashMap::new(),
|mut acc: HashMap<Uuid, Vec<switch_collection_histories::Model>>, switch_history| {
acc.entry(switch_history.collection_mint_id.clone())
acc.entry(switch_history.collection_mint_id)
.or_insert_with(Vec::new);

acc.entry(switch_history.collection_mint_id.clone())
.and_modify(|switch_histories| switch_histories.push(switch_history.into()));
acc.entry(switch_history.collection_mint_id)
.and_modify(|switch_histories| switch_histories.push(switch_history));

acc
},
Expand Down
7 changes: 7 additions & 0 deletions api/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@ impl Processor {
}
}

#[allow(clippy::too_many_lines)]

/// Processes incoming messages related to different services like Treasury and Solana.
/// Routes each message to the corresponding handler based on the type of service and the specific event.
/// # Errors
/// - Returns an error wrapped in `ProcessorError` if any of the operations inside the function fail.
pub async fn process(&self, msg: Services) -> Result<()> {
match msg {
Services::Treasury(TreasuryEventKey { id, .. }, e) => match e.event {
Expand Down
15 changes: 15 additions & 0 deletions api/src/mutations/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,11 @@ impl Mutation {
}
}

/// Fetches the owner's wallet address for a given project and blockchain.
/// # Returns
/// - Returns a `Result<String>` containing the wallet address of the owner if the operation is successful.
/// # Errors
/// - Returns an error if no project wallet is found for the specified blockchain.
pub async fn fetch_owner(
conn: &DatabaseConnection,
project: Uuid,
Expand Down Expand Up @@ -634,6 +639,10 @@ impl CreateCollectionInput {
}
}

/// Validates the Solana creator verification based on project treasury wallet address and the list of creators.
/// # Errors
/// - Returns an error if any of the creators are verified but their address does not match
/// the project treasury wallet address.
pub fn validate_solana_creator_verification(
project_treasury_wallet_address: &str,
creators: &Vec<Creator>,
Expand Down Expand Up @@ -695,6 +704,9 @@ pub fn validate_creators(blockchain: BlockchainEnum, creators: &Vec<Creator>) ->
Ok(())
}

/// Validates a Solana address
/// # Errors
/// - Returns an error if the provided address is not a valid Solana address.
pub fn validate_solana_address(address: &str) -> Result<()> {
if Pubkey::from_str(address).is_err() {
return Err(Error::new(format!(
Expand All @@ -705,6 +717,9 @@ pub fn validate_solana_address(address: &str) -> Result<()> {
Ok(())
}

/// Validates an EVM (Ethereum Virtual Machine) address format.
/// # Errors
/// - Returns an error if the provided address does not match the required EVM address format.
pub fn validate_evm_address(address: &str) -> Result<()> {
let err = Err(Error::new(format!("{address} is not a valid EVM address")));

Expand Down
5 changes: 5 additions & 0 deletions api/src/mutations/mint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1287,29 +1287,34 @@ pub struct RetryUpdateMintPayload {
status: CreationStatus,
}

/// Represents input data for `queue_mint_to_drop` mutation
#[derive(Debug, Clone, InputObject)]
pub struct QueueMintToDropInput {
drop: Uuid,
metadata_json: MetadataJsonInput,
}

/// Represents payload data for `queue_mint_to_drop` mutation
#[derive(Debug, Clone, SimpleObject)]
pub struct QueueMintToDropPayload {
collection_mint: CollectionMint,
}

/// Represents input data for `mint_queued` mutation
#[derive(Debug, Clone, InputObject)]
pub struct MintQueuedInput {
mint: Uuid,
recipient: String,
compressed: bool,
}

/// Represents payload data for `mint_queued` mutation
#[derive(Debug, Clone, SimpleObject)]
pub struct MintQueuedPayload {
collection_mint: CollectionMint,
}

/// Represents input data for `mint_random_queued` mutation
#[derive(Debug, Clone, InputObject)]
pub struct MintRandomQueuedInput {
drop: Uuid,
Expand Down

0 comments on commit a132905

Please sign in to comment.