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

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

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

payment.getContract().setLimitedForTestnet(isTestPayment);
payload.getContract().setLimitedForTestnet(isTestPayment);
payload.getContract().getNew().forEach(c -> c.setLimitedForTestnet(isTestPayment));
origin: UniversaBlockchain/universa

@Test
public void checkFitTestnetCriteria() throws Exception {
  PrivateKey key = new PrivateKey(Do.read(rootPath + "keys/stepan_mamontov.private.unikey"));
  Contract contract = Contract.fromDslFile(rootPath + "LamborghiniTestDrive.yml");
  contract.setExpiresAt(ZonedDateTime.now().plusMonths(1));
  contract.addSignerKey(key);
  sealCheckTrace(contract, true);
  System.out.println("Processing cost is " + contract.getProcessedCostU());
  assertTrue(contract.isSuitableForTestnet());
  // now set contract limited for testnet
  contract.setLimitedForTestnet(true);
  sealCheckTrace(contract, true);
  assertTrue(contract.isSuitableForTestnet());
}
origin: UniversaBlockchain/universa

@Test
public void checkTestnetExpirationDateCriteria() throws Exception {
  PrivateKey key = new PrivateKey(Do.read(rootPath + "keys/stepan_mamontov.private.unikey"));
  Contract contract = Contract.fromDslFile(rootPath + "LamborghiniTestDrive.yml");
  contract.addSignerKey(key);
  sealCheckTrace(contract, true);
  contract.setExpiresAt(ZonedDateTime.now().plusMonths(13));
  assertFalse(contract.isSuitableForTestnet());
  // now set contract limited for testnet
  contract.setLimitedForTestnet(true);
  sealCheckTrace(contract, false);
  assertFalse(contract.isSuitableForTestnet());
}
origin: UniversaBlockchain/universa

@Test
public void checkTestnetKeyStrengthCriteria() throws Exception {
  PrivateKey key = new PrivateKey(Do.read(PRIVATE_KEY_PATH));
  Contract contract = createCoin100apiv3();
  contract.setExpiresAt(ZonedDateTime.now().plusMonths(1));
  contract.addSignerKey(key);
  sealCheckTrace(contract, true);
  assertFalse(contract.isSuitableForTestnet());
  // now set contract limited for testnet
  contract.setLimitedForTestnet(true);
  sealCheckTrace(contract, false);
  assertFalse(contract.isSuitableForTestnet());
}
origin: UniversaBlockchain/universa

@Test
public void checkTestnetNewItemExpirationDateCriteria() throws Exception {
  PrivateKey key = new PrivateKey(Do.read(rootPath + "keys/stepan_mamontov.private.unikey"));
  Contract newItem = Contract.fromDslFile(rootPath + "LamborghiniTestDrive.yml");
  newItem.addSignerKey(key);
  sealCheckTrace(newItem, true);
  newItem.setExpiresAt(ZonedDateTime.now().plusMonths(13));
  Contract contract = Contract.fromDslFile(rootPath + "LamborghiniTestDrive.yml");
  contract.addSignerKey(key);
  contract.setExpiresAt(ZonedDateTime.now().plusMonths(1));
  contract.addNewItems(newItem);
  sealCheckTrace(contract, true);
  assertFalse(contract.isSuitableForTestnet());
  // now set contract limited for testnet
  contract.setLimitedForTestnet(true);
  sealCheckTrace(contract, false);
  assertFalse(contract.isSuitableForTestnet());
}
origin: UniversaBlockchain/universa

@Test
public void checkTestnetCostUCriteria() throws Exception {
  PrivateKey key = new PrivateKey(Do.read(rootPath + "keys/stepan_mamontov.private.unikey"));
  Contract contract = Contract.fromDslFile(rootPath + "LamborghiniTestDrive.yml");
  contract.setExpiresAt(ZonedDateTime.now().plusMonths(1));
  contract.addSignerKey(key);
  for (int i = 0; i < 100; i++) {
    Contract newItem = Contract.fromDslFile(rootPath + "LamborghiniTestDrive.yml");
    newItem.setExpiresAt(ZonedDateTime.now().plusMonths(1));
    newItem.addSignerKey(key);
    sealCheckTrace(newItem, true);
    contract.addNewItems(newItem);
  }
  sealCheckTrace(contract, true);
  System.out.println("Processing cost is " + contract.getProcessedCostU());
  assertTrue(contract.getProcessedCostU() > Config.maxCostUInTestMode);
  assertFalse(contract.isSuitableForTestnet());
  // now set contract limited for testnet
  contract.setLimitedForTestnet(true);
  sealCheckTrace(contract, false);
  assertFalse(contract.isSuitableForTestnet());
}
com.icodici.universa.contractContractsetLimitedForTestnet

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