private NImmutableEnvironment getEnvironment(HashId hid) { NImmutableEnvironment result = envCache.get(hid); if(result == null) { result = ledger.getEnvironment(hid); if(result != null) { envCache.put(result); } } return result; }
private NImmutableEnvironment getEnvironment(Long environmentId) { NImmutableEnvironment result = envCache.get(environmentId); if(result == null) { result = ledger.getEnvironment(environmentId); if(result != null) { envCache.put(result); } } return result; }
private NImmutableEnvironment getEnvironment(NSmartContract item) { NImmutableEnvironment result = envCache.get(item.getId()); if(result == null && item.getParent() != null) { result = envCache.get(item.getParent()); } if(result == null) { result = ledger.getEnvironment(item); envCache.put(result); } return result; }
private Binder queryNameContract(Binder params, Session session) throws IOException { checkNode(session, true); Binder b = new Binder(); String nameContract = params.getStringOrThrow("name"); NNameRecord nr = node.getLedger().getNameRecord(nameContract); if (nr != null) { NImmutableEnvironment env = node.getLedger().getEnvironment(nr.getEnvironmentId()); if (env != null) { byte[] packedContract = env.getContract().getPackedTransaction(); b.put("packedContract", packedContract); } } return b; }
assertNull(ledger.getEnvironment(rev1.getId())); NImmutableEnvironment environment = new NImmutableEnvironment(rev1,new Binder(),Do.listOf(),Do.listOf(),Do.listOf(),null,null); ledger.saveEnvironment(environment); assertNotNull(ledger.getEnvironment(rev1.getId())); assertNull(ledger.getEnvironment(rev1.getId()));
NImmutableEnvironment nie = node.getLedger().getEnvironment(id);
if (envs.size() > 0) { for (Long envId : envs) { NImmutableEnvironment environment = node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected expiresAt: " + calculateExpires); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); if (envs.size() > 0) { for (Long envId : envs) { NImmutableEnvironment environment = networkNode.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = networkNode.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires);
if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires2); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = networkNode.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = networkNode.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires2);
if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = testSpace.node.node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = networkNode.node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); NImmutableEnvironment environment = testSpace.node.node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires.minusSeconds(seconds * 2)); NImmutableEnvironment environment = networkNode.node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires.minusSeconds(seconds * 2)); NImmutableEnvironment environment = networkNode.node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { if (absentNodeNumber == networkNode.node.getNumber()) { NImmutableEnvironment environment = networkNode.node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires.minusSeconds(seconds * 2));
if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = testSpace.node.node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = networkNode.node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); NImmutableEnvironment environment = testSpace.node.node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); NImmutableEnvironment environment = networkNode.node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); NImmutableEnvironment environment = networkNode.node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { if (absentNodeNumber == networkNode.node.getNumber()) { NImmutableEnvironment environment = networkNode.node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires);
if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = networkNode.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = networkNode.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires);
if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = networkNode.getLedger().getEnvironment(envId); double days = (double) 100 * config.getServiceRate(NSmartContract.SmartContractType.SLOT1.name()).doubleValue() * 1024 / simpleContract.getPackedTransaction().length; double hours = days * 24; assertNotNull(networkNode.getLedger().getEnvironment(slotContract.getId())); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = node.getLedger().getEnvironment(envId); double days = (double) 100 * config.getServiceRate(NSmartContract.SmartContractType.SLOT1.name()).doubleValue() * 1024 / simpleContract.getPackedTransaction().length; double hours = days * 24; assertNotNull(node.getLedger().getEnvironment(slotContract.getId())); if (envs.size() > 0) { for (Long envId : envs) { NImmutableEnvironment environment = networkNode.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected " + calculateExpires); if(envs.size() > 0) { for (Long envId : envs) { NImmutableEnvironment environment = node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected " + calculateExpires);
NImmutableEnvironment env = n.getLedger().getEnvironment(slotContract.getId());
if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); assertNotNull(node.getLedger().getEnvironment(followerContract.getId())); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = networkNode.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); assertNotNull(networkNode.getLedger().getEnvironment(followerContract.getId())); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); assertNull(node.getLedger().getEnvironment(followerContract.getId())); assertNotNull(node.getLedger().getEnvironment(refilledFollowerContract.getId())); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = networkNode.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) {
if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); assertNotNull(node.getLedger().getEnvironment(followerContract.getId())); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = networkNode.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); assertNotNull(networkNode.getLedger().getEnvironment(followerContract.getId())); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires2); assertNotNull(node.getLedger().getEnvironment(followerContract2.getId())); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = networkNode.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires2);
if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); assertNotNull(node.getLedger().getEnvironment(followerContract.getId())); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = networkNode.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); assertNotNull(networkNode.getLedger().getEnvironment(followerContract.getId())); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); assertNull(node.getLedger().getEnvironment(followerContract.getId()));
if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); assertNotNull(node.getLedger().getEnvironment(followerContract.getId())); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = networkNode.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); assertNotNull(networkNode.getLedger().getEnvironment(followerContract.getId())); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected: " + calculateExpires); assertNull(node.getLedger().getEnvironment(followerContract.getId())); assertNotNull(node.getLedger().getEnvironment(refilledFollowerContract.getId())); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = networkNode.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) {
if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = networkNode.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println(foundCss.expiresAt()); assertNotNull(networkNode.getLedger().getEnvironment(slotContract.getId())); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println(foundCss.expiresAt()); assertNotNull(node.getLedger().getEnvironment(slotContract.getId())); if (envs.size() > 0) { for (Long envId : envs) { NImmutableEnvironment environment = networkNode.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println(foundCss.expiresAt()); assertNull(networkNode.getLedger().getEnvironment(slotContract.getId())); assertNotNull(networkNode.getLedger().getEnvironment(refilledSlotContract.getId())); if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = node.getLedger().getEnvironment(envId);
if(envs.size() > 0) { for(Long envId : envs) { NImmutableEnvironment environment = node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected " + calculateExpires); assertNotNull(node.getLedger().getEnvironment(slotContract.getId())); for(Long envId : envs2) if (!envs.contains(envId)) { NImmutableEnvironment environment = node.getLedger().getEnvironment(envId); for (ContractSubscription foundCss : environment.subscriptions()) { System.out.println("expected " + calculateExpires); assertNotNull(node.getLedger().getEnvironment(slotContract2.getId()));
assertNull(networkNode.getLedger().getEnvironment(simpleContract.getId())); assertNull(networkNode.getLedger().getEnvironment(simpleContract2.getId())); assertNull(networkNode.getLedger().getEnvironment(slotContract.getId())); assertNull(networkNode.getLedger().getEnvironment(refilledSlotContract.getId())); assertNull(node.getLedger().getEnvironment(simpleContract.getId())); assertNull(node.getLedger().getEnvironment(simpleContract2.getId())); assertNull(node.getLedger().getEnvironment(slotContract.getId())); assertNull(node.getLedger().getEnvironment(refilledSlotContract.getId()));