ink icon indicating copy to clipboard operation
ink copied to clipboard

Add documentation for testing cross-contract calls

Open drewstone opened this issue 3 years ago • 3 comments

I'm trying to test a cross-contract system implementation. A few things are unclear:

  • How should the contracts be created in tests if ContractRef's are created in constructors.
  • How to get the contract code hash from Contract::new() result.
  • Whether these contracts need initial balance and how to send balance on Contract::new()

Any help here is appreciated. Even links to the internals to help me investigate are appreciated as it's heavily nested within macros. Is there documentation on exposed contract methods?

drewstone avatar Feb 08 '22 20:02 drewstone

I don't think this is possible at the moment. See https://github.com/paritytech/ink/issues/788 for some more info.

Someone in the comments mentions Redspot. You'll have to write the tests in JS and they will be more integration type tests than unit tests, so keep that in mind.

HCastano avatar Feb 10 '22 02:02 HCastano

Any progress on this issue?

RafaelAPB avatar Oct 19 '22 18:10 RafaelAPB

Try this: https://github.com/paritytech/ink/issues/1234#issuecomment-1283754747

h4x3rotab avatar Oct 21 '22 03:10 h4x3rotab