corda / token-sdk

Corda Tokens SDK
Other
79 stars 76 forks source link

MoveToken works with C4 but fails with Corda 5.0-SNAPSHOT #32

Closed manosbatsis closed 5 years ago

manosbatsis commented 5 years ago

MoveToken works for me on C4 but throws the following error when using Corda 5.0-SNAPSHOT:

 java.lang.IllegalStateException: The LinearState with ID 03fbddaa-205f-42a0-b7c9-2f8c1c6b17c8 is unknown to this node or it has been exited from the ledger.
        at net.corda.core.contracts.LinearPointer.resolve(StatePointer.kt:113) ~[corda-core-5.0-SNAPSHOT.jar:?]
        at net.corda.core.transactions.TransactionBuilder.resolveStatePointers(TransactionBuilder.kt:530) ~[corda-core-5.0-SNAPSHOT.jar:?]
        at net.corda.core.transactions.TransactionBuilder.addInputState(TransactionBuilder.kt:584) ~[corda-core-5.0-SNAPSHOT.jar:?]
        at com.r3.corda.sdk.token.workflow.selection.TokenSelection.generateMove(TokenSelection.kt:231) ~[workflow-1.0-SNAPSHOT.jar:?]
        at com.r3.corda.sdk.token.workflow.selection.TokenSelection.generateMove(TokenSelection.kt:143) ~[workflow-1.0-SNAPSHOT.jar:?]
        at com.r3.corda.sdk.token.workflow.selection.TokenSelection.generateMove$default(TokenSelection.kt:141) ~[workflow-1.0-SNAPSHOT.jar:?]
        at com.r3.corda.sdk.token.workflow.flows.MoveToken$Initiator.call(MoveToken.kt:52) ~[workflow-1.0-SNAPSHOT.jar:?]
        at com.r3.corda.sdk.token.workflow.flows.MoveToken$Initiator.call(MoveToken.kt:30) ~[workflow-1.0-SNAPSHOT.jar:?]
        at net.corda.node.services.statemachine.FlowStateMachineImpl.subFlow(FlowStateMachineImpl.kt:290) ~[corda-node-5.0-SNAPSHOT.jar:?]
        at net.corda.core.flows.FlowLogic.subFlow(FlowLogic.kt:311) ~[corda-core-5.0-SNAPSHOT.jar:?]
        at foobar.MoveFungibleTokenFlow.call(MoveFungibleTokenFlow.kt:44) ~[cordapp-workflow-0.19-SNAPSHOT.jar:?]
        at foobar.MoveFungibleTokenFlow.call(MoveFungibleTokenFlow.kt:22) ~[cordapp-workflow-0.19-SNAPSHOT.jar:?]
        at net.corda.node.services.statemachine.FlowStateMachineImpl.subFlow(FlowStateMachineImpl.kt:290) ~[corda-node-5.0-SNAPSHOT.jar:?]
        at net.corda.core.flows.FlowLogic.subFlow(FlowLogic.kt:311) ~[corda-core-5.0-SNAPSHOT.jar:?]
        at foobar.TransferAllowOrDenyFlow.makeTransfer(TranferWorkflow.kt:136) ~[cordapp-workflow-0.19-SNAPSHOT.jar:?]
        at foobar.TransferAllowOrDenyFlow.processInput(TranferWorkflow.kt:108) ~[cordapp-workflow-0.19-SNAPSHOT.jar:?]
        at com.github.manosbatsis.partiture.flow.PartitureFlow.call(PartitureFlow.kt:102) ~[cordapp-workflow-0.19-SNAPSHOT.jar:?]
        at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:228) ~[corda-node-5.0-SNAPSHOT.jar:?]
        at net.corda.node.services.statemachine.FlowStateMachineImpl.run(FlowStateMachineImpl.kt:45) ~[corda-node-5.0-SNAPSHOT.jar:?]
        at co.paralleluniverse.fibers.Fiber.run1(Fiber.java:1092) ~[quasar-core-0.7.10-jdk8.jar:0.7.10]
        at co.paralleluniverse.fibers.Fiber.exec(Fiber.java:788) ~[quasar-core-0.7.10-jdk8.jar:0.7.10]
        at co.paralleluniverse.fibers.RunnableFiberTask.doExec(RunnableFiberTask.java:100) ~[quasar-core-0.7.10-jdk8.jar:0.7.10]
        at co.paralleluniverse.fibers.RunnableFiberTask.run(RunnableFiberTask.java:91) ~[quasar-core-0.7.10-jdk8.jar:0.7.10]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_181]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_181]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[?:1.8.0_181]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[?:1.8.0_181]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_181]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_181]
        at net.corda.node.utilities.AffinityExecutor$ServiceAffinityExecutor$1$thread$1.run(AffinityExecutor.kt:63) ~[corda-node-5.0-SNAPSHOT.jar:?
roger-that-dev commented 5 years ago

Thanks for posting this. Probably some non-backwards compatible change has been introduced into master. I'll look into it... This is happening all too often...! Grumble grumble

roger-that-dev commented 5 years ago

Manos and I have a chat about this on slack. I tried to reproduce the error but unsuccessful so far. Have a try of my branch and see if you can reproduce through that. Cheers

https://github.com/corda/cordapp-template-kotlin/compare/token-template...rog-manos-test?expand=1