Testing a Receive Function That Invokes a Contract

Hey all! I’m working on an administrative proxy contract which has a mapping of other “worker” contract addresses that can be invoked. Seems simple enough; however, I’m having trouble testing these contracts with the concordium-std library. Is it possible to initialize these worker contracts so that I might test the receive functions end to end?

Any insight would be highly appreciated. Thanks!

Hi @robbie_wasabi,

You can define mocks for the entrypoints, as described here: Unit test a contract in Rust — Concordium documentation which works well if the contracts you are mocking are simple.

But it is not possible to perform a full integration test yet.

However, we are working on an integration testing library which will be released within a few weeks, in which you can deploy multiple contracts and test the interaction between them.

So if you can afford to wait a bit, then you can get full integration testing instead of mocks :blush:

Best regards,