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

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

Best Java code snippets using com.icodici.universa.contract.Contract.anonymizeRole (Showing top 2 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

private static void doAnonymize() throws IOException {
  List<String> sources = new ArrayList<String>((List) options.valuesOf("anonymize"));
  List<String> roles = new ArrayList<String>((List) options.valuesOf("role"));
  List<String> names = (List) options.valuesOf("output");
  List<String> nonOptions = new ArrayList<String>((List) options.nonOptionArguments());
  for (String opt : nonOptions) {
    sources.addAll(asList(opt.split(",")));
  }
  cleanNonOptionalArguments(sources);
  for (int s = 0; s < sources.size(); s++) {
    String source = sources.get(s);
    Contract contract = loadContract(source);
    if (contract != null) {
      if(roles.size() <= 0) {
        roles = new ArrayList<>(contract.getRoles().keySet());
      }
      for (String roleName : roles) {
        report("Anonymizing role " + roleName + " in " + source + "...");
        contract.anonymizeRole(roleName);
        contract.seal();
      }
      if (names.size() > s) {
        saveContract(contract, names.get(s), true, false);
      } else {
        saveContract(contract, new FilenameTool(source).addSuffixToBase("_anonymized").toString(), true, false);
      }
    }
  }
  finish();
}
origin: UniversaBlockchain/universa

  @Test
  public void checkAnonymizingRole() throws Exception {

    PrivateKey key = new PrivateKey(Do.read(PRIVATE_KEY_PATH));
    Contract contract = createCoin100apiv3();
    contract.addSignerKey(key);
    sealCheckTrace(contract, true);

    assertTrue(contract.getIssuer().getKeys().contains(key.getPublicKey()));

    contract.anonymizeRole("issuer");
    contract.anonymizeRole("owner");
    contract.seal();

    assertFalse(contract.getIssuer().getKeys().contains(key.getPublicKey()));

    Contract anonPublishedContract = new Contract(contract.getLastSealedBinary());

    assertFalse(anonPublishedContract.getIssuer().getKeys().contains(key.getPublicKey()));
//        assertFalse(anonPublishedContract.getSealedByKeys().contains(key.getPublicKey()));
  }

com.icodici.universa.contractContractanonymizeRole

Javadoc

Anonymize existing role. If role contains PublicKey it will be replaced with AnonymousId

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

  • Start an intent from android
  • compareTo (BigDecimal)
  • onRequestPermissionsResult (Fragment)
  • startActivity (Activity)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Table (org.hibernate.mapping)
    A relational table
  • 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