Skip to content

Commit

Permalink
feat: remove IntoIterator requirement on SpendBook trait
Browse files Browse the repository at this point in the history
It may be too expensive for some trait implementers to support iterating
eg over the network so we decided not to require it, at least for now.

However the default SimpleSpendBook implementation does support iterating.
  • Loading branch information
dan-da committed Jul 7, 2021
1 parent 327486a commit c0ac6c2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/mint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ pub type MintSignatures = BTreeMap<DbcContentHash, (PublicKeySet, NodeSignature)

pub const GENESIS_DBC_INPUT: Hash = Hash([0u8; 32]);

pub trait SpendBook:
std::fmt::Debug + Clone + IntoIterator<Item = (DbcContentHash, DbcTransaction)>
{
pub trait SpendBook: std::fmt::Debug + Clone {
type Error: std::error::Error;

fn lookup(&self, dbc_hash: &DbcContentHash) -> Result<Option<&DbcTransaction>, Self::Error>;
Expand Down

0 comments on commit c0ac6c2

Please sign in to comment.