This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.annotation.tailrec | |
import cats.Eval | |
final class ParMetaData(connectiveUsedFn: Eval[Boolean]) { | |
lazy val connectiveUsed: Eval[Boolean] = connectiveUsedFn | |
} | |
sealed trait Par { | |
protected def meta: ParMetaData | |
lazy val connectiveUsed: Boolean = meta.connectiveUsed.value | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new AMap, state, branches in { | |
contract AMap(return, @"decl") = { | |
new PFACH_colon_3_0, BMNG2_0, HLEVEL_colon_11_0, PSGNUM_colon_28_0, MANDT_colon_74_0, ANRED_colon_5_0, DATUM_colon_2_1, DATUM_colon_2_0, PSGNUM_colon_9_0, NAME1_0, HWAER_0, CURCY_1, CURCY_0, ABGRU_0, WAERQ_colon_2_0, AUGRU_BEZ_0, BELNR_colon_2_0, RETURN_SUPP_0, SEGNUM_colon_16_0, IDDAT_colon_4_0, UZEIT_colon_2_1, UZEIT_colon_2_0, ANTLF_0, QUALF_colon_8_0, MANDT_colon_25_0, WKURS_0, SNDPOR_colon_2_0, EVERS_0, TELX1_colon_3_0, EDATU_OLD_0, MESTYP_0, MANDT_colon_33_0, MANDT_colon_33_1, ISONU_colon_3_0, PSGNUM_colon_30_0, MENGE_0, PSGNUM_colon_23_0, MANDT_colon_30_0, NAME2_colon_4_0, NETWR_0, SEGNUM_colon_13_0, VPREI_0, HLEVEL_colon_55_0, REGIO_colon_3_0, ABLAD_colon_4_0, PARVW_0, TELF1_0, DOCNUM_colon_18_0, SEGNUM_colon_37_0, MANDT_colon_26_0, STOCK_colon_3_0, DOCUM_colon_9_0, ORT02_colon_3_0, ZTERM_TXT_0, AUGRU_0, RECIPNT_NO_0, PSGNUM_colon_20_0, MANDT_colon_73_0, IDTNR_0, FIXMG_0, EDATU_0, EINKZ_0, INITIAL_SUPP_0, SUMID_colon_2_0, PSGNUM_c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- The program consists of two sections: 1) Declarations section 2) Statements section | |
Program. ProgramType ::= DeclarationList StmList ; | |
----------------------------------------------------------------------------------------- | |
-- Declarations section (sequence of declarations) | |
Declarations. DeclarationList ::= [Declaration] ; | |
terminator Declaration ";" ; | |
DeclIntegerArr. Declaration ::= IntId "[" IntegerLiteral "]" IdentLiteral; | |
DeclInteger. Declaration ::= IntId IdentLiteral; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import base64 | |
from rchain.crypto import PrivateKey | |
from rchain.util import create_deploy_data | |
import time | |
import random | |
import array | |
import time | |
def create_deploy(contract: str, private, phlo_price=1, valid_after_block_no=0): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import base64 | |
from rchain.crypto import PrivateKey | |
from rchain.util import create_deploy_data | |
import time | |
import random | |
import array | |
import time | |
def create_deploy(contract: str, private, phlo_price=1, valid_after_block_no=0): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val arr = new Array[Byte](size) | |
@tailrec | |
def loopFill(numChild: Int, idx0: Int): Array[Byte] = | |
if (idx0 == size) arr | |
else { | |
node(numChild) match { | |
case EmptyChild => loopFill(numChild + 1, idx0) | |
case Leaf(prefix, value, varLength) => | |
arr(idx0) = numChild.toByte |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val size = loop(0, 0) | |
//put in the buffer | |
val buf = ByteBuffer.allocate(size) | |
node.zipWithIndex foreach { | |
case (EmptyChild, _) => Unit | |
case (Leaf(leafPrefix, value, varLength), idx) => | |
buf.put(idx.toByte) //first byte - number of children | |
if (varLength) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package coop.rchain.models_no_proto | |
import coop.rchain.models.BitSetBytesMapper.bitSetBytesMapper | |
/** * | |
* Rholang process | |
* | |
* For example, `@0!(1) | @2!(3) | for(x <- @0) { Nil }` has two sends | |
* and one receive. | |
* |