Skip to content

Commit

Permalink
Merge pull request #231 from holaplex/abdul/queued-mint-event
Browse files Browse the repository at this point in the history
Emit DropMinted event with Queued status
  • Loading branch information
imabdulbasit authored Sep 19, 2023
2 parents e961d39 + 0c28335 commit 2a8f050
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
4 changes: 2 additions & 2 deletions api/proto.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ sha512 = "d75800df0d4744c6b0f4d9a9952d3bfd0bb6b24a8babd19104cc11b54a525f85551b3c

[[schemas]]
subject = "nfts"
version = 29
sha512 = "b3b2136bd6c7a136d317da84395661de5fc056e8270510575a3281d78884d99a0d89f444754ed02cb18ad26dcc7cd65300c1df73b9d74d2edc6bcc8d552465d0"
version = 30
sha512 = "bee70bd6f0f18a8049f93bceb9c4b500b49352f9d19d55d5a411da92cbd786c88bec47f73e1ef6946ceefc7de8e558f704bf8187be9d9f4e49bd102baec29327"

[[schemas]]
subject = "organization"
Expand Down
2 changes: 1 addition & 1 deletion api/proto.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ endpoint = "https://schemas.holaplex.tools"

[schemas]
organization = 5
nfts = 29
nfts = 30
customer = 2
treasury = 23
solana_nfts = 11
Expand Down
17 changes: 17 additions & 0 deletions api/src/mutations/mint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,7 @@ impl Mutation {

let conn = db.get();
let nft_storage = ctx.data::<NftStorageClient>()?;
let nfts_producer = ctx.data::<Producer<NftEvents>>()?;

let UserID(id) = user_id;
let user_id = id.ok_or(Error::new("X-USER-ID header not found"))?;
Expand Down Expand Up @@ -918,6 +919,22 @@ impl Mutation {
.exec(conn)
.await?;

nfts_producer
.send(
Some(&NftEvents {
event: Some(NftEvent::DropMinted(MintCreation {
drop_id: drop.id.to_string(),
status: NftCreationStatus::Queued as i32,
})),
}),
Some(&NftEventKey {
id: mint_model.id.to_string(),
project_id: drop.project_id.to_string(),
user_id: user_id.to_string(),
}),
)
.await?;

Ok(QueueMintToDropPayload {
collection_mint: mint_model.into(),
})
Expand Down

0 comments on commit 2a8f050

Please sign in to comment.