maidsafe / sn_dbc

Safe Network DBCs
BSD 3-Clause "New" or "Revised" License
15 stars 16 forks source link

feat: function to get commitments from transaction #206

Closed jacderida closed 2 years ago

jacderida commented 2 years ago

This is some code that currently exists in the node implementation when we are processing a spend request. It needs to be shared between a couple of crates in the safe_network workspace, so I'm opting to move it into this crate, which makes more sense than putting it in sn_interface, since it's very specific to DBCs.

No test coverage has been added because it's difficult to setup the conditions for testing the function. This could be done at a later point.

It could have potentially went into the transaction verifier, but I'm reluctant to change the behaviour of that without having any tests. At the moment it would cost me too much time to work out all the conditions necessary for covering the code in TransactionVerifier.