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

Added unspent output data structure #165

Merged
merged 2 commits into from
Jun 11, 2021

Conversation

alessandrokonrad
Copy link
Contributor

The proposed Dapp connector https://github.com/cardano-foundation/CIPs/pull/88/files
requires an unspent output data structure in cbor.

@rooooooooob
Copy link
Contributor

@alessandrokonrad Ah yes, thanks for pointing this out. This was an oversight when I was drafting the first version of the spec. It was based on the ergo one which the regular output was enough to create an input out of. The CIP spec is not joined with this library directly so we're going to need to specify a way in that spec first that is implementation-independent. The spec so far directly refers to the shelley-ma.cddl binary spec so we should ideally specify a nice way for UTXOs that contains enough info for it to be useful in all use-cases. What you have in this PR seems like a solid choice but we should update the spec first as it currently references the following cddl:

transaction_output = [address, amount : value]

#[derive(Clone, Debug)]
pub struct TransactionUnspentOutput {
input: TransactionInput,
value: Value,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to specify value and address instead of just using output: TransactionOutput?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I oversaw that with TransactionOutput, your solution makes more sense right.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the CIP with this change using the cddl

transaction_unspent_output = [
        input: transaction_input,
        output: transaction_output,
]

@SebastienGllmt SebastienGllmt merged commit 6b180e0 into Emurgo:master Jun 11, 2021
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

Successfully merging this pull request may close these issues.

3 participants