semiotic-ai / timeline-aggregation-protocol

A fast, efficient and trust-minimized unidirectional micro-payments system.
Apache License 2.0
14 stars 3 forks source link

Add tests with consecutively timestamped receipts #110

Closed aasseman closed 1 year ago

aasseman commented 1 year ago
          > LGTM, just a few comments.

Also, wouldn't it be good to be able to mess around with the receipts timestamps in tests? Shouldn't that be achievable using mocking? (future task perhaps) I'm particularly interested in testing in the case there is a RAV in the middle of a train of receipts with consecutive/repeating timestamps, and making sure that there is no gap/double inclusion in the final RAV.

We can try a mock crate like this https://github.com/museun/mock_instant . Alternatively since the receipt struct is public we can just change the timestamp before signing.

Originally posted by @ColePBryan in https://github.com/semiotic-ai/timeline-aggregation-protocol/issues/109#issuecomment-1593406554