Skip to content

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

@JoshOrndorff

Description

@JoshOrndorff

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?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions