Fetching Archive Contracts while Unit Testing

Is there a way to fetch archived contracts in unit tests?

I wanted to assert that certain values had changed over the course of the test case, as well as assert the number of contracts created (including archived)

Hi @gtpaulose1, unfortunately that’s not possible at the moment. You can only query for active contracts in Daml Script.

Okay thank you, i guess i will have to design my test case to add assertions in the middle as opposed at the end.

Out of curiosity, is this a feature on the roadmap?

There is Expose transaction streams in Daml Script · Issue #12098 · digital-asset/daml · GitHub which by exposing transaction streams would also expose archived contracts but we don’t have a timeline for that atm.

1 Like