How can I make sendTransaction on predicate to work?

Hi @elena , so I was finding a few different validation issues with code you provided. This may happen when using test cases as your exemplary usage. Unit test cases, especially the one you were using as reference will use mocks to ensure we are only testing the functionality of a specific service or class, the Predicate class in this instance. And not the functionality of other services. However this will be done in end to end or feature level tests.

This meant the resource itself was being mocked in the test to make it available to the predicate, however this isn’t the case in your example repository. I have forked your repository and added exemplar usage of sendTransaction using a resource available to the instantiated predicate: Github - predicate sendTransaction example.

Additionally and maybe of interest, your predicate implementation in your previous forum post which makes use of the transfer functionality, will still call sendTransaction however it also prepares the resources and request, like your example above.

1 Like