Tabnine Logo
Contract.getExpiresAt
Code IndexAdd Tabnine to your IDE (free)

How to use
getExpiresAt
method
in
com.icodici.universa.contract.Contract

Best Java code snippets using com.icodici.universa.contract.Contract.getExpiresAt (Showing top 20 results out of 315)

origin: UniversaBlockchain/universa

static Contract createComplexConctract(PrivateKey key, int subcontracts, int n) {
  Contract root = createSimpleContract(key);
  for(int i = 0; i < subcontracts; i++) {
    Contract c = createSimpleContract(key);
    c.setExpiresAt(c.getExpiresAt().plusSeconds(i+1+(subcontracts+1)*n));
    c.seal();
    root.addNewItems(c);
  }
  root.setExpiresAt(root.getExpiresAt().plusSeconds((subcontracts+1)*n));
  root.addSignerKey(key);
  root.seal();
  return root;
}
origin: UniversaBlockchain/universa

report("contract expires at " + DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").format(contract.getExpiresAt()));
origin: UniversaBlockchain/universa

@Test
public void checkPaymentContract() throws Exception {
  // to register manually, execute from deploy project:
  // bin/sql_all pro "insert into ledger(hash,state,created_at, expires_at, locked_by_id) values(decode('9186C0A9E9471E4559E74B5DAC3DBBB8445807DF80CAE4CE06FDB6588FAEBA1CE004AD378BEF3C445DECF3375E3CA5FD16227DBE5831A21207BB1BD21C85F30D0CED014E152F77E62082E0442FBD9FD2458C20778F7501B5D425AF9984062E54','hex'),'4','1520977039','1552513039','0');"
  // to erase all ledgers, execute:
  // bin/sql_all pro "truncate table ledger"
  // (after erasing ledgers, items still stay in cache -> need to restart (or redeploy) nodes)
  Contract contract = paymentContract;
  contract.check();
  System.out.println("uno bin: " + Base64.encodeString(contract.getPackedTransaction()));
  System.out.println("uno hashId: " + Bytes.toHex(contract.getId().getDigest()).replace(" ", ""));
  System.out.println("approved ord: " + ItemState.APPROVED.ordinal());
  System.out.println("getCreatedAt: " + StateRecord.unixTime(contract.getCreatedAt()));
  System.out.println("getExpiresAt: " + StateRecord.unixTime(contract.getExpiresAt()));
  ItemResult itemResult = normalClient.getState(contract.getId());
  System.out.println("getState... done! itemResult: " + itemResult.state);
}
origin: UniversaBlockchain/universa

report("revision:    " + contract.getRevision());
report("created:     " + contract.getCreatedAt());
report("expires:     " + contract.getExpiresAt());
origin: UniversaBlockchain/universa

originRecord.setExpiresAt(origin.getExpiresAt());
originRecord.setCreatedAt(origin.getCreatedAt());
newRevisionRecord.setExpiresAt(newRevision.getExpiresAt());
newRevisionRecord.setCreatedAt(newRevision.getCreatedAt());
newContractRecord.setExpiresAt(newContract.getExpiresAt());
newContractRecord.setCreatedAt(newContract.getCreatedAt());
origin: UniversaBlockchain/universa

originRecord.setExpiresAt(origin.getExpiresAt());
originRecord.setCreatedAt(origin.getCreatedAt());
newRevisionRecord.setExpiresAt(newRevision.getExpiresAt());
newRevisionRecord.setCreatedAt(newRevision.getCreatedAt());
newContractRecord.setExpiresAt(newContract.getExpiresAt());
newContractRecord.setCreatedAt(newContract.getCreatedAt());
origin: UniversaBlockchain/universa

assertFalse(notaryContract.getCreator().isAllowedForKeys(ownerPublicKeys));
assertTrue(notaryContract.getExpiresAt().isAfter(ZonedDateTime.now().plusMonths(3)));
assertTrue(notaryContract.getCreatedAt().isBefore(ZonedDateTime.now()));
origin: UniversaBlockchain/universa

@Test
public void goodNotary() throws Exception {
  Set<PrivateKey> martyPrivateKeys = new HashSet<>();
  Set<PrivateKey> stepaPrivateKeys = new HashSet<>();
  Set<PublicKey> martyPublicKeys = new HashSet<>();
  Set<PublicKey> stepaPublicKeys = new HashSet<>();
  martyPrivateKeys.add(new PrivateKey(Do.read(rootPath + "keys/marty_mcfly.private.unikey")));
  stepaPrivateKeys.add(new PrivateKey(Do.read(rootPath + "keys/stepan_mamontov.private.unikey")));
  for (PrivateKey pk : stepaPrivateKeys)
    stepaPublicKeys.add(pk.getPublicKey());
  for (PrivateKey pk : martyPrivateKeys)
    martyPublicKeys.add(pk.getPublicKey());
  Contract notaryContract = ContractsService.createNotaryContract(martyPrivateKeys, stepaPublicKeys);
  notaryContract.check();
  notaryContract.traceErrors();
  assertTrue(notaryContract.isOk());
  assertTrue(notaryContract.getOwner().isAllowedForKeys(stepaPublicKeys));
  assertTrue(notaryContract.getIssuer().isAllowedForKeys(martyPrivateKeys));
  assertTrue(notaryContract.getCreator().isAllowedForKeys(martyPrivateKeys));
  assertFalse(notaryContract.getOwner().isAllowedForKeys(martyPrivateKeys));
  assertFalse(notaryContract.getIssuer().isAllowedForKeys(stepaPublicKeys));
  assertFalse(notaryContract.getCreator().isAllowedForKeys(stepaPublicKeys));
  assertTrue(notaryContract.getExpiresAt().isAfter(ZonedDateTime.now().plusMonths(3)));
  assertTrue(notaryContract.getCreatedAt().isBefore(ZonedDateTime.now()));
  assertTrue(notaryContract.isPermitted("revoke", stepaPublicKeys));
  assertTrue(notaryContract.isPermitted("revoke", martyPublicKeys));
  assertTrue(notaryContract.isPermitted("change_owner", stepaPublicKeys));
  assertFalse(notaryContract.isPermitted("change_owner", martyPublicKeys));
}
origin: UniversaBlockchain/universa

if (getExpiresAt().isAfter(expirationLimit)) {
  isSuitableForTestnet = false;
  if (isLimitedForTestnet()) {
origin: UniversaBlockchain/universa

assertFalse(shareContract.getCreator().isAllowedForKeys(ownerPublicKeys));
assertTrue(shareContract.getExpiresAt().isAfter(ZonedDateTime.now().plusMonths(3)));
assertTrue(shareContract.getCreatedAt().isBefore(ZonedDateTime.now()));
origin: UniversaBlockchain/universa

assertFalse(tokenContract.getCreator().isAllowedForKeys(ownerPublicKeys));
assertTrue(tokenContract.getExpiresAt().isAfter(ZonedDateTime.now().plusMonths(3)));
assertTrue(tokenContract.getCreatedAt().isBefore(ZonedDateTime.now()));
origin: UniversaBlockchain/universa

assertFalse(notaryContract.getCreator().isAllowedForKeys(stepaPublicKeys));
assertTrue(notaryContract.getExpiresAt().isAfter(ZonedDateTime.now().plusMonths(3)));
assertTrue(notaryContract.getCreatedAt().isBefore(ZonedDateTime.now()));
origin: UniversaBlockchain/universa

assertFalse(tokenContract.getCreator().isAllowedForKeys(stepaPublicKeys));
assertTrue(tokenContract.getExpiresAt().isAfter(ZonedDateTime.now().plusMonths(3)));
assertTrue(tokenContract.getCreatedAt().isBefore(ZonedDateTime.now()));
origin: UniversaBlockchain/universa

assertFalse(shareContract.getCreator().isAllowedForKeys(stepaPublicKeys));
assertTrue(shareContract.getExpiresAt().isAfter(ZonedDateTime.now().plusMonths(3)));
assertTrue(shareContract.getCreatedAt().isBefore(ZonedDateTime.now()));
origin: UniversaBlockchain/universa

assertFalse(notaryContract.getCreator().isAllowedForKeys(notariusPublicKeys));
assertTrue(notaryContract.getExpiresAt().isAfter(ZonedDateTime.now().plusMonths(3)));
assertTrue(notaryContract.getCreatedAt().isBefore(ZonedDateTime.now()));
origin: UniversaBlockchain/universa

assertEquals("2022-08-05T17:25:37Z", c.getExpiresAt().withZoneSameInstant(ZoneOffset.UTC).toString());
origin: UniversaBlockchain/universa

public void parcelAssertions(Parcel equal1, Parcel equal2 ) throws Exception {
  //few assertions
  assertEquals(equal1.getPayload().getContract().getId(), equal2.getPayload().getContract().getId());
  assertEquals(equal1.getPayment().getContract().getId(), equal2.getPayment().getContract().getId());
  assertEquals(equal1.getPayload().getContract().getState().getBranchId(), equal2.getPayload().getContract().getState().getBranchId());
  assertEquals(equal1.getPayment().getContract().getState().getBranchId(), equal2.getPayment().getContract().getState().getBranchId());
  assertEquals(equal1.getPayload().getContract().getState().getCreatedAt().getSecond(), equal2.getPayload().getContract().getState().getCreatedAt().getSecond());
  assertEquals(equal1.getPayment().getContract().getState().getCreatedAt().getSecond(), equal2.getPayment().getContract().getState().getCreatedAt().getSecond());
  assertEquals(equal1.getPayload().getContract().getExpiresAt().getDayOfYear(), equal2.getPayload().getContract().getExpiresAt().getDayOfYear());
  assertEquals(equal1.getPayment().getContract().getExpiresAt().getDayOfYear(), equal2.getPayment().getContract().getExpiresAt().getDayOfYear());
  assertEquals(equal1.getPayload().getSubItems().size(), equal2.getPayload().getSubItems().size());
  assertEquals(equal1.getPayment().getSubItems(), equal2.getPayment().getSubItems());
}
origin: UniversaBlockchain/universa

assertFalse(notaryContract.getCreator().isAllowedForKeys(stepaPublicKeys));
assertTrue(notaryContract.getExpiresAt().isAfter(ZonedDateTime.now().plusMonths(3)));
assertTrue(notaryContract.getCreatedAt().isBefore(ZonedDateTime.now()));
origin: UniversaBlockchain/universa

assertEquals(originContract.getExpiresAt(), checkingContract.getExpiresAt());
origin: UniversaBlockchain/universa

stepaCoins.traceErrors();
assertTrue(stepaCoins.getExpiresAt().isAfter(ZonedDateTime.now().plusYears(1)));
com.icodici.universa.contractContractgetExpiresAt

Javadoc

Get contract expiration time

Popular methods of Contract

  • <init>
    Extract old, deprecated v2 self-contained binary partially unpacked by the TransactionPack, and fill
  • addNewItems
    Add one or more siblings to the contract. Note that those must be sealed before calling #seal() or #
  • addSignerKey
    Add private key to keys contract binary to be signed with when sealed next time. It is called before
  • getId
    Get the id sealing self if need
  • getPackedTransaction
    Pack the contract to the most modern .unicon format, same as TransactionPack#pack(). Uses bounded Tr
  • registerRole
    Register new role. Name must be unique otherwise existing role will be overwritten
  • seal
    Seal contract to binary. This call adds signatures from #getKeysToSignWith()
  • addSignatureToSeal
    Add signature to sealed (before) contract. Do not deserializing or changing contract bytes, but will
  • check
  • createRevision
    Create new revision to be changed, signed sealed and then ready to approve. Created "revision" contr
  • fromDslFile
    Create contract importing its parameters with passed .yaml file. No signatures are added automatical
  • fromPackedTransaction
    Main .unicon read routine. Load any .unicon version and construct a linked Contract with counterpart
  • fromDslFile,
  • fromPackedTransaction,
  • getCreatedAt,
  • getDefinition,
  • getErrors,
  • getKeysToSignWith,
  • getLastSealedBinary,
  • getNew,
  • getNewItems

Popular in Java

  • Reactive rest calls using spring rest template
  • setRequestProperty (URLConnection)
  • onCreateOptionsMenu (Activity)
  • getResourceAsStream (ClassLoader)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • JOptionPane (javax.swing)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now