congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
Contract.getValidRoleReferences
Code IndexAdd Tabnine to your IDE (free)

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew ArrayList()
  • Codota Iconnew LinkedList()
  • Smart code suggestions by Tabnine
}
origin: UniversaBlockchain/universa

/**
 * Check role is allowed to keys
 *
 * @param keys is set of keys
 * @return true if role is allowed to keys
 */
public  boolean isAllowedForKeys(Set<? extends AbstractKey> keys) {
  return isAllowedForReferences(contract == null ? new HashSet<>() : contract.getValidRoleReferences());
}
origin: UniversaBlockchain/universa

  @Test
  public void  isAllowed()  throws Exception {

    PublicKey key = keys.get(0).getPublicKey();
    Set<PublicKey> keySet = new HashSet<>();
    keySet.add(key);
    Contract contract = new Contract();

    SimpleRole sr = new SimpleRole("tr1");
    sr.addKeyRecord(new KeyRecord(key));
    contract.registerRole(sr);

    assertTrue(!sr.isAllowedForKeys(new HashSet<>()));
    assertTrue(sr.isAllowedForKeys(keySet));
    sr.addRequiredReference("ref1", Role.RequiredMode.ALL_OF);
    sr.addRequiredReference("ref2", Role.RequiredMode.ALL_OF);

    contract.getValidRoleReferences().add("ref1");
    assertFalse(sr.isAllowedForKeys(keySet));
    contract.getValidRoleReferences().add("ref2");
    assertTrue(sr.isAllowedForKeys(keySet));
    sr.addRequiredReference("ref3", Role.RequiredMode.ANY_OF);
    assertFalse(sr.isAllowedForKeys(keySet));
    sr.addRequiredReference("ref4", Role.RequiredMode.ANY_OF);
    sr.addRequiredReference("ref5", Role.RequiredMode.ANY_OF);
    contract.getValidRoleReferences().add("ref4");
    assertTrue(sr.isAllowedForKeys(keySet));
  }
}
origin: UniversaBlockchain/universa

assertThat(r, is(instanceOf(ListRole.class)));
assertFalse(r.isAllowedForKeys(stepaPublicKeys));
c.getValidRoleReferences().addAll(references);
assertTrue(r.isAllowedForKeys(stepaPublicKeys));
origin: UniversaBlockchain/universa

assertThat(r, is(instanceOf(ListRole.class)));
assertFalse(r.isAllowedForKeys(stepaPublicKeys));
c.getValidRoleReferences().addAll(references);
assertTrue(r.isAllowedForKeys(stepaPublicKeys));
origin: UniversaBlockchain/universa

assertThat(r, is(instanceOf(ListRole.class)));
assertFalse(r.isAllowedForKeys(stepaPublicKeys));
c.getValidRoleReferences().addAll(references);
assertTrue(r.isAllowedForKeys(stepaPublicKeys));
origin: UniversaBlockchain/universa

assertThat(r, is(instanceOf(ListRole.class)));
assertFalse(r.isAllowedForKeys(stepaPublicKeys));
c.getValidRoleReferences().addAll(references);
assertTrue(r.isAllowedForKeys(stepaPublicKeys));
com.icodici.universa.contractContractgetValidRoleReferences

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

  • Updating database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • onCreateOptionsMenu (Activity)
  • startActivity (Activity)
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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