Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does the mint helper function respect nested constraint checkers? #177

Open
JoshOrndorff opened this issue Feb 14, 2024 · 0 comments
Open
Assignees

Comments

@JoshOrndorff
Copy link
Contributor

Consider this helper function in the money piece:

pub fn mint<V, OV, OC>(amt: u128, v: V) -> Transaction<OV, OC>
where
V: Verifier,
OV: Verifier + From<V>,
OC: tuxedo_core::ConstraintChecker<OV> + From<MoneyConstraintChecker<ID>>,
{
Transaction {
inputs: vec![],
peeks: vec![],
outputs: vec![(Self::new(amt), v).into()],
checker: MoneyConstraintChecker::Mint.into(),
}
}

I believe it's purpose is to allow easily creating mint transactions from the runtime level, for example in the genesis config.

It's trait bounds require the ability to convert between the inner and outer constraint checkers. But these bounds only work if the money piece is a direct descendant of the top-level runtime constraint checker. If it is buried deeper in the tree, does this work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants