Я очень новичок в Корде.транзакция не работает во время выполнения теста
---- код ---
@Override
public void verify(LedgerTransaction tx) throws IllegalArgumentException {
Command command = tx.getCommand(0);
private final TestIdentity alice = new TestIdentity(new CordaX500Name("Alice", "", "GB"));
private final TestIdentity bob = new TestIdentity(new CordaX500Name("Bob", "", "GB"));
private MockServices ledgerServices = new MockServices(new TestIdentity(new CordaX500Name("TestId", "", "GB")));
private TokenState tokenState = new TokenState(alice.getParty(), bob.getParty(), 1);
if (tx.getInputStates().size() != 0) {
System.out.println(" -- Checking Input Size -- ");
throw new IllegalArgumentException(" Transaction Must have No Inputs ");
}
}
--- в тестовом примере -
@Test
public void tokenContractRequiresZeroInputsInTheTransaction() {
transaction(ledgerServices, tx -> {
//Has an input, will fail.
tx.input(TokenContract.ID, tokenState);
tx.output(TokenContract.ID, tokenState);
tx.command(alice.getPublicKey(), new TokenContract.Commands.Issue());
tx.fails();
return null;
});