cordapp-template-java icon indicating copy to clipboard operation
cordapp-template-java copied to clipboard

Error: net.corda.core.contracts.AttachmentResolutionException

Open adelrustum opened this issue 6 years ago • 0 comments

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);
    }
}

adelrustum avatar Aug 23 '19 15:08 adelrustum