corda / cordapp-template-java

A Java CorDapp Template. Extend it via the Hello, World tutorial: https://docs.corda.net/hello-world-introduction.html
83 stars 127 forks source link

Error: net.corda.core.contracts.AttachmentResolutionException #47

Open adelrustum opened 5 years ago

adelrustum commented 5 years ago

To reproduce the error:

  1. Clone this repository.
  2. Checkout the token-template branch
  3. Run the below test using ./gradlew test

    public class FlowTests {
    private final MockNetwork network = new MockNetwork(ImmutableList.of(
            "com.template.contracts", "com.template.flows",
            "com.r3.corda.lib.tokens.money",
            "com.r3.corda.lib.tokens.contracts",
            "com.r3.corda.lib.tokens.workflows",
            "com.r3.corda.lib.tokens.testing"));
    private final StartedMockNode exchangeNode = network.createNode();
    private final Party exchange = exchangeNode.getInfo().getLegalIdentities().get(0);
    
    @Before
    public void setup() {
        network.runNetwork();
    }
    
    @After
    public void tearDown() {
        network.stopNodes();
    }
    
    @Test
    public void dummyTest() throws ExecutionException, InterruptedException {
        ExampleFlowWithFixedToken issueFlow = new ExampleFlowWithFixedToken("USD", 1000L, exchange);
        Future<SignedTransaction> future = exchangeNode.startFlow(issueFlow);
        network.runNetwork();
        SignedTransaction tx = future.get();
        System.out.print(tx);
    }
    }