use of com.icodici.universa.Approvable in project universa by UniversaBlockchain.
the class MainTest method registerContract500approved_seal.
@Test
public void registerContract500approved_seal() throws Exception {
TestSpace ts = prepareTestSpace();
Contract contract = createContract500(ts.myKey);
int i = 0;
for (Approvable sub : contract.getNewItems()) {
Contract subContract = (Contract) sub;
ItemResult subItemResult = ts.client.register(subContract.getLastSealedBinary(), 1000);
assertEquals(ItemState.APPROVED, subItemResult.state);
++i;
if (i % 10 == 0)
System.out.println("register subContract: " + i);
}
ItemResult itemResult = ts.client.register(contract.getLastSealedBinary(), 10000);
assertEquals(ItemState.DECLINED, itemResult.state);
i = 0;
for (Approvable sub : contract.getNewItems()) {
ItemResult subItemResult = ts.client.getState(sub);
System.out.println("" + (i++) + " - " + subItemResult.state);
assertEquals(ItemState.APPROVED, subItemResult.state);
}
ts.nodes.forEach(n -> n.shutdown());
}
Aggregations