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

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

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

origin: UniversaBlockchain/universa

/**
 * @deprecated use {@link #getProcessedCostU()} instead.
 */
@Deprecated
public int getProcessedCostTU() {
  return getProcessedCostU();
}
origin: UniversaBlockchain/universa

/**
 * Print processing cost (that was spent while checking) of a contract to console.
 *
 * @param contract
 */
private static void printProcessingCost(Contract contract) {
  report("Contract processing cost is " + contract.getProcessedCostU() + " U");
}
origin: UniversaBlockchain/universa

TransactionPack tp = TransactionPack.unpack(Do.read("/Users/romanu/Downloads/ru/token106.unicon"));
tp.getContract().check();
System.out.println("Processing cost " + tp.getContract().getProcessedCostU());
origin: UniversaBlockchain/universa

assertTrue(unlimitContract1.isOk());
System.out.println("Processing cost " + unlimitContract.getProcessedCostU());
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 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());
}
origin: UniversaBlockchain/universa

System.out.println("Calculated processing cost (forJoin): " + processingContract.getProcessedCostU() + " (U)");
return processingContract;
origin: UniversaBlockchain/universa

if (getProcessedCostU() > Config.maxCostUInTestMode) {
  isSuitableForTestnet = false;
  if (isLimitedForTestnet()) {
origin: UniversaBlockchain/universa

assertEquals(ItemState.APPROVED, itemResult.state);
int processedCost = stepaCoins.getProcessedCostU();
System.out.println("stepaCoins processed cost in U: " + processedCost);
assertTrue(processedCost > Config.maxCostUInTestMode);
com.icodici.universa.contractContractgetProcessedCostU

Javadoc

Get the cost used for contract processing. You must first call #check() method to check contract and calculate cost.

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

  • Finding current android device location
  • requestLocationUpdates (LocationManager)
  • setRequestProperty (URLConnection)
  • getSystemService (Context)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Kernel (java.awt.image)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • BoxLayout (javax.swing)
  • Top PhpStorm plugins
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