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

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

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

origin: UniversaBlockchain/universa

public JSApiRole getCreator() {
  return JSApiRole.createJSApiRole(this.currentContract.getCreator());
}
origin: UniversaBlockchain/universa

assertFalse(contract1.getCreator().getKeys().contains(key.getPublicKey()));
assertFalse(anonPublishedContract1.getCreator().getKeys().contains(key.getPublicKey()));
assertFalse(anonPublishedContract1.getSealedByKeys().contains(key.getPublicKey()));
assertFalse(anonPublishedContract1.getSealedByKeys().contains(ownerKey.getPublicKey()));
assertFalse(contract2.getCreator().getKeys().contains(key.getPublicKey()));
assertFalse(anonPublishedContract2.getCreator().getKeys().contains(key.getPublicKey()));
assertFalse(anonPublishedContract2.getSealedByKeys().contains(key.getPublicKey()));
assertFalse(anonPublishedContract2.getSealedByKeys().contains(ownerKey.getPublicKey()));
origin: UniversaBlockchain/universa

@Test
public void anonymizeAllRoles() throws Exception {
  callMain2("-create", rootPath + "TokenDSLTemplate.yml", "--output", basePath + "forRoleAnonymizing.unicon",
      "-k", rootPath + "_xer0yfe2nn1xthc.private.unikey");
  assertTrue (new File(basePath + "forRoleAnonymizing.unicon").exists());
  callMain("-anonymize", basePath + "forRoleAnonymizing.unicon");
  assertTrue (new File(basePath + "forRoleAnonymizing_anonymized.unicon").exists());
  System.out.println(output);
  PrivateKey key = new PrivateKey(Do.read(rootPath + "_xer0yfe2nn1xthc.private.unikey"));
  PrivateKey ownerKey = new PrivateKey(Do.read(rootPath + "keys/stepan_mamontov.private.unikey"));
  Contract contract = CLIMain.loadContract(basePath + "forRoleAnonymizing_anonymized.unicon", true);
  assertFalse(contract.getOwner().getKeys().contains(ownerKey.getPublicKey()));
  assertFalse(contract.getIssuer().getKeys().contains(key.getPublicKey()));
  assertFalse(contract.getCreator().getKeys().contains(key.getPublicKey()));
  Contract anonPublishedContract = new Contract(contract.getLastSealedBinary());
  assertFalse(anonPublishedContract.getOwner().getKeys().contains(ownerKey.getPublicKey()));
  assertFalse(anonPublishedContract.getIssuer().getKeys().contains(key.getPublicKey()));
  assertFalse(anonPublishedContract.getCreator().getKeys().contains(key.getPublicKey()));
  assertFalse(anonPublishedContract.getSealedByKeys().contains(key.getPublicKey()));
  assertFalse(anonPublishedContract.getSealedByKeys().contains(ownerKey.getPublicKey()));
}
origin: UniversaBlockchain/universa

assertTrue(notaryContract.getCreator().isAllowedForKeys(issuerPrivateKeys));
assertFalse(notaryContract.getCreator().isAllowedForKeys(ownerPublicKeys));
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

assertTrue(tokenContract.getCreator().isAllowedForKeys(issuerPrivateKeys));
assertFalse(tokenContract.getCreator().isAllowedForKeys(ownerPublicKeys));
origin: UniversaBlockchain/universa

assertTrue(shareContract.getCreator().isAllowedForKeys(issuerPrivateKeys));
assertFalse(shareContract.getCreator().isAllowedForKeys(ownerPublicKeys));
origin: UniversaBlockchain/universa

assertTrue(notaryContract.getCreator().isAllowedForKeys(martyPrivateKeys));
assertFalse(notaryContract.getCreator().isAllowedForKeys(stepaPublicKeys));
origin: UniversaBlockchain/universa

assertTrue(tokenContract.getCreator().isAllowedForKeys(martyPrivateKeys));
assertFalse(tokenContract.getCreator().isAllowedForKeys(stepaPublicKeys));
origin: UniversaBlockchain/universa

assertTrue(shareContract.getCreator().isAllowedForKeys(martyPrivateKeys));
assertFalse(shareContract.getCreator().isAllowedForKeys(stepaPublicKeys));
origin: UniversaBlockchain/universa

assertTrue(notaryContract.getCreator().isAllowedForKeys(issuerPrivateKeys));
assertFalse(notaryContract.getCreator().isAllowedForKeys(notariusPublicKeys));
origin: UniversaBlockchain/universa

assertTrue(notaryContract.getCreator().isAllowedForKeys(martyPrivateKeys));
assertFalse(notaryContract.getCreator().isAllowedForKeys(stepaPublicKeys));
origin: UniversaBlockchain/universa

KeyRecord originCreator = originContract.getCreator().getKeyRecords().iterator().next();
KeyRecord checkingCreator = checkingContract.getCreator().getKeyRecords().iterator().next();
assertNotNull(checkingCreator);
assertThat(checkingCreator.getPublicKey(), is(instanceOf(PublicKey.class)));
origin: UniversaBlockchain/universa

assertFalse(c.getCreator().isValid());
assertNull(c.getCreator());
assertTrue(c.getCreator().isValid());
assertTrue(c.getCreator().isValid());
assertFalse(c.getCreator().isValid());
assertFalse(c.getErrors().isEmpty());
assertFalse(c.getCreator().isValid());
com.icodici.universa.contractContractgetCreator

Javadoc

Get creator role

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
  • getExpiresAt
    Get contract expiration time
  • 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
  • createRevision,
  • fromDslFile,
  • fromPackedTransaction,
  • getCreatedAt,
  • getDefinition,
  • getErrors,
  • getKeysToSignWith,
  • getLastSealedBinary,
  • getNew,
  • getNewItems

Popular in Java

  • Creating JSON documents from java classes using gson
  • requestLocationUpdates (LocationManager)
  • getResourceAsStream (ClassLoader)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JComboBox (javax.swing)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Github Copilot alternatives
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