{"action":"created","issue":{"url":"https://api.github.com/repos/corda/corda/issues/2788","repository_url":"https://api.github.com/repos/corda/corda","labels_url":"https://api.github.com/repos/corda/corda/issues/2788/labels{/name}","comments_url":"https://api.github.com/repos/corda/corda/issues/2788/comments","events_url":"https://api.github.com/repos/corda/corda/issues/2788/events","html_url":"https://github.com/corda/corda/issues/2788","id":304234161,"number":2788,"title":"Add A Method That Runs A Flow And Returns","user":{"login":"opticyclic","id":1222693,"avatar_url":"https://avatars3.githubusercontent.com/u/1222693?v=4","gravatar_id":"","url":"https://api.github.com/users/opticyclic","html_url":"https://github.com/opticyclic","followers_url":"https://api.github.com/users/opticyclic/followers","following_url":"https://api.github.com/users/opticyclic/following{/other_user}","gists_url":"https://api.github.com/users/opticyclic/gists{/gist_id}","starred_url":"https://api.github.com/users/opticyclic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opticyclic/subscriptions","organizations_url":"https://api.github.com/users/opticyclic/orgs","repos_url":"https://api.github.com/users/opticyclic/repos","events_url":"https://api.github.com/users/opticyclic/events{/privacy}","received_events_url":"https://api.github.com/users/opticyclic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-12T03:57:52Z","updated_at":"2018-03-14T14:53:42Z","closed_at":null,"author_association":"NONE","body":"I wasted an hour trying to work out why nothing was in the vault here:\r\n\r\n        val myFlow = MyFlows.MyFlow(Amount(50000, USD), mainBank.info.chooseIdentity())\r\n        testBank.services.startFlow(myFlow)\r\n\r\n        val testStates = mainBank.database.transaction { mainBank.services.vaultService.queryBy<TestState>().states }\r\n\r\nIt turns out that if I add `.resultFuture.getOrThrow()` to the `startFlow` function the vault will have the state.\r\n\r\nThe API would be a lot more user friendly if there were convenience methods that wrapped things like this.\r\nRight now writing a client application feels like you are developing the core because so much of the internals are exposed.\r\n\r\nSee also https://github.com/corda/corda/issues/2787"},"comment":{"url":"https://api.github.com/repos/corda/corda/issues/comments/373049855","html_url":"https://github.com/corda/corda/issues/2788#issuecomment-373049855","issue_url":"https://api.github.com/repos/corda/corda/issues/2788","id":373049855,"user":{"login":"anthonykr3","id":34482776,"avatar_url":"https://avatars3.githubusercontent.com/u/34482776?v=4","gravatar_id":"","url":"https://api.github.com/users/anthonykr3","html_url":"https://github.com/anthonykr3","followers_url":"https://api.github.com/users/anthonykr3/followers","following_url":"https://api.github.com/users/anthonykr3/following{/other_user}","gists_url":"https://api.github.com/users/anthonykr3/gists{/gist_id}","starred_url":"https://api.github.com/users/anthonykr3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anthonykr3/subscriptions","organizations_url":"https://api.github.com/users/anthonykr3/orgs","repos_url":"https://api.github.com/users/anthonykr3/repos","events_url":"https://api.github.com/users/anthonykr3/events{/privacy}","received_events_url":"https://api.github.com/users/anthonykr3/received_events","type":"User","site_admin":false},"created_at":"2018-03-14T14:53:42Z","updated_at":"2018-03-14T14:53:42Z","author_association":"CONTRIBUTOR","body":"Thanks for the report. We've made a lot of changes to the test api as part of our v3 release, and it now doesn't expose any internals. If you migrate to version 3, the StartedMockNode class (which replaces the StartedNode<MockNode> in the MockNetwork) in the test api has a startFlow function which calls startFlow and then calls .resultFuture.getOrThrow() - hopefully that should help."}}
{"actor":{"display_login":"anthonykr3"}}