@Test public void modifyExpiresAtWhiteList() throws Exception { ZonedDateTime now = ZonedDateTime.ofInstant(Instant.ofEpochSecond(ZonedDateTime.now().toEpochSecond()), ZoneId.systemDefault()); Contract contract = new Contract(TestKeys.privateKey(0)); ModifyDataPermission modifyDataPermission = new ModifyDataPermission(contract.getRole("owner"), new Binder()); modifyDataPermission.addField("/expires_at", Do.listOf(now.plusDays(1), now.plusDays(2))); contract.addPermission(modifyDataPermission); contract.seal(); Contract changed = contract.createRevision(); changed.addSignerKey(TestKeys.privateKey(0)); changed.setExpiresAt(now.plusDays(1)); changed.seal(); changed.check(); changed.traceErrors(); assertTrue(changed.isOk()); changed = contract.createRevision(); changed.addSignerKey(TestKeys.privateKey(0)); changed.setExpiresAt(now.plusDays(2)); changed.seal(); changed.check(); assertTrue(changed.isOk()); changed = contract.createRevision(); changed.addSignerKey(TestKeys.privateKey(0)); changed.setExpiresAt(now.plusDays(3)); changed.seal(); changed.check(); assertTrue(!changed.isOk()); }
public ModifyDataPermission addField(String fieldName, List<String> values) { this.fields.put(fieldName, values); return this; }
ModifyDataPermission extends Permission { public ModifyDataPermission addField(String fieldName, List<String> values) { this.fields.put(fieldName, values); return this; } }
ModifyDataPermission extends Permission { public ModifyDataPermission addField(String fieldName, List<String> values) { this.fields.put(fieldName, values); return this; } ModifyDataPermission();  ModifyDataPermission(Role role, Binder params); }
ModifyDataPermission extends Permission { public ModifyDataPermission addField(String fieldName, List<String> values) { this.fields.put(fieldName, values); return this; } ModifyDataPermission();  ModifyDataPermission(Role role, Binder params); ModifyDataPermission addField(String fieldName, List<String> values); void addAllFields(Map<String, List<String>> fields); @Override void checkChangesQuantized(Contract contract, Contract changedContract, Map<String, Delta> stateChanges, Set<Contract> revokingItems, Collection<PublicKey> keys); Map<String, List<String>> getFields(); @Override Binder serialize(BiSerializer serializer); @Override void deserialize(Binder data, BiDeserializer deserializer); }
ModifyDataPermission extends Permission { public ModifyDataPermission addField(String fieldName, List<String> values) { this.fields.put(fieldName, values); return this; } ModifyDataPermission();  ModifyDataPermission(Role role, Binder params); ModifyDataPermission addField(String fieldName, List<String> values); void addAllFields(Map<String, List<String>> fields); @Override void checkChangesQuantized(Contract contract, Contract changedContract, Map<String, Delta> stateChanges, Set<Contract> revokingItems, Collection<PublicKey> keys); Map<String, List<String>> getFields(); @Override Binder serialize(BiSerializer serializer); @Override void deserialize(Binder data, BiDeserializer deserializer); static final String FIELD_NAME; }