Repository navigation
feat(rust-client, cli): ensure non-fungible assets are fully supported - #2688
Conversation
…ible_asset helper
106d3ef to
1549c8e
Compare
…ible_asset helper
…t fail with prologue error
… the holding account
| let consumption_status = match consumption_checker | ||
| .can_consume( | ||
| account_id, | ||
| block_ref, | ||
| InputNote::unauthenticated(note.clone()), | ||
| account_tx_args.clone(), | ||
| ) | ||
| .await?; | ||
| .await | ||
| { | ||
| Ok(status) => status, | ||
| // If the note consumption tx fails with prologue error, treat the note as not | ||
| // consumable | ||
| Err(NoteCheckerError::PrologueExecution(_)) => continue, | ||
| Err(err) => return Err(err.into()), | ||
| }; |
There was a problem hiding this comment.
This change was required to fix the note screener bug discussed offline (without this, the mint_and_burn_non_fungible_transaction test fails when screening the burn transaction output notes, failing CI run here).
This probably isn't the right solution for this bug. Perhaps we can undo this fix and remove the failing test for now, create an issue to track the bug, and fix it once we come up with a proper solution.
There was a problem hiding this comment.
We should track this with an issue / TODO doc comment.
There was a problem hiding this comment.
Yes, let's open an issue for this. For now, I think it's fine to skip notes that error on the prologue. Ideally what we do for checking notes is actually checking against the new state of the account, not the original one. I think this would both be more correct and also would avoid the error.
| let consumption_status = match consumption_checker | ||
| .can_consume( | ||
| account_id, | ||
| block_ref, | ||
| InputNote::unauthenticated(note.clone()), | ||
| account_tx_args.clone(), | ||
| ) | ||
| .await?; | ||
| .await | ||
| { | ||
| Ok(status) => status, | ||
| // If the note consumption tx fails with prologue error, treat the note as not | ||
| // consumable | ||
| Err(NoteCheckerError::PrologueExecution(_)) => continue, | ||
| Err(err) => return Err(err.into()), | ||
| }; |
There was a problem hiding this comment.
We should track this with an issue / TODO doc comment.
igamigo
left a comment
There was a problem hiding this comment.
Left a few minor comments but overall LGTM!
| /// Consumes the builder and returns a [`TransactionRequest`] for a transaction to mint a | ||
| /// non-fungible asset. This request must be executed against a non-fungible faucet account. |
There was a problem hiding this comment.
nit: non-fungible faucet account is fine here, but maybe we could link the actual account components that this transaction relies on.
| NonFungible { | ||
| /// The faucet prefix. | ||
| faucet: String, |
There was a problem hiding this comment.
I think as of recently we moved away from prefix being the identifier of the faucets (after having removed AccountType::Faucet), so we should be able to rename this from faucet to faucet_id and use that nomenclature instead of "prefix". Could you check that this is consistent in the rest of the CLI's codebase?
| }, | ||
| NonFungible { | ||
| /// The faucet prefix. | ||
| faucet: String, |
There was a problem hiding this comment.
Additionally (maybe alternatively), I think we could also show the address and/or the symbol slot information here (miden::standards::faucets::non_fungible::symbol). But this is based on the account actually being a standard faucet which may not always be the case
There was a problem hiding this comment.
Changed FormatedAsset::NonFungible to include the address and symbol, along with a new method client to fetch the non-fungible faucet symbol here b1f88fe
…_mint_non_fungible_asset docs
…on-fungible asset error instead of all prologue execution errors
…or network faucet
igamigo
left a comment
There was a problem hiding this comment.
LGTM! If we resolve conflicts I think we can merge this
Introduces the following changes:
TransactionRequestBuilderhelpers to build requests that mint and burn NFAs (build_mint_non_fungible_assetandbuild_burn_non_fungible_asset).BurnNotefrommiden_client::note. The NFA faucet types and factories are available undermiden_client::account::standards::faucets.Closes #2673