Represents BlockTransactions (bip152): `blocktxn` packet.
@see https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki
@constructor
@param {Object} options
@property {Hash} hash
@property {TX[]} txs
542258
function TXResponse(options) {
  if (!(this instanceof TXResponse))
    return new TXResponse(options);

  this.hash = encoding.NULL_HASH;
  this.txs = [];

  if (options)
    this.fromOptions(options);
}
504222
def block_verify( cls, verified_block_header, block_txids ):
        

        block_data = {
            'merkleroot': verified_block_header['merkleroot'],
            'tx': block_txids
        }

        return bits.block_verify( block_data )
697500
function AuthProposePacket(hash) {
  if (!(this instanceof AuthProposePacket))
    return new AuthProposePacket(hash);

  Packet.call(this);

  this.hash = hash || encoding.ZERO_HASH;
}
1174761
function Beanstream (options) {
  this.endpoint = 'https://www.beanstream.com/api/';
  this.version = 'v1';
  this.token_endpoint = 'https://www.beanstream.com/scripts/tokenization/tokens';
  var merchant_id = options.MERCHANT_ID;
  var api_passcode = options.API_PASSCODE;

  var passcode = new Buffer([merchant_id, api_passcode].join(":")).toString('base64');
  this.authHeader = "Passcode " + passcode;
  BaseGateway.call(this, options);
}
1096203
function (params) {
  const oThis = this
  ;

  params = params || {};
  oThis.transactionHash = params.transaction_hash;
  oThis.chain = 'value';
}
534516
protected function doTransact(Transaction $transaction, array $options = array())
    {
        $this->validateTransaction($transaction);
        $params = $this->buildParams($transaction, $options);

        $result = $transaction->getResult();
        $result->setTransactor($this);

        $postUrl = $options['post_url'];
        $client = $this->getClient();

        $request = $client->post($postUrl)
            ->addPostFields($params);

        try {
            $response = $request->send();

            $data = Transaction\TransactionType::QUERY !== $transaction->getType()->getValue()
                ? json_decode($response->getBody(true))
                : $this->normalizeQueryResponse($response->getBody(true));
        } catch (BadResponseException $e) {
            $data = new \stdClass();
            $data->CommandStatus = 'Error';
            $data->Description = 'Client Error';
            $data->ErrorInformation = 'An error occurred while contacting the PaymentsXpress system';
            $data->Exception = $e->getMessage();
        }

        if ('Approved' !== $data->CommandStatus) {
            $result->setStatus(new Result\ResultStatus('Declined' !== $data->CommandStatus ? Result\ResultStatus::ERROR : Result\ResultStatus::DECLINED));
            $result->setMessage(!empty($data->ErrorInformation) ? $data->Description . ': ' . $data->ErrorInformation : $data->Description);

            if (!empty($data->TransAct_ReferenceID)) {
                $result->setExternalId($data->TransAct_ReferenceID);
            }
        } else {
            if (Transaction\TransactionType::QUERY === $transaction->getType()->getValue()) {
                $this->handleQueryResponse($transaction, $data);
            } else {
                $result->setStatus(new Result\ResultStatus(Result\ResultStatus::PENDING));
            }

            $result->setExternalId($data->TransAct_ReferenceID);
        }

        $result->setData('request', $params);
        $result->setData('response', $data);

        return $result;
    }
776843
def Block(contract_hash)
      pc = Handshake::ProcContract.new
      pc.signature = contract_hash
      pc
    end
1032758
function BlockPacket(block, witness) {
  if (!(this instanceof BlockPacket))
    return new BlockPacket(block, witness);

  Packet.call(this);

  this.block = block || new MemBlock();
  this.witness = witness || false;
}
425238
function MinerOptions(options) {
  if (!(this instanceof MinerOptions))
    return new MinerOptions(options);

  this.network = Network.primary;
  this.logger = null;
  this.workers = null;
  this.chain = null;
  this.mempool = null;

  this.version = -1;
  this.addresses = [];
  this.coinbaseFlags = Buffer.from('mined by wmcc_user', 'ascii');
  this.preverify = false;

  this.minWeight = policy.MIN_BLOCK_WEIGHT;
  this.maxWeight = policy.MAX_BLOCK_WEIGHT;
  this.priorityWeight = policy.BLOCK_PRIORITY_WEIGHT;
  this.priorityThreshold = policy.BLOCK_PRIORITY_THRESHOLD;
  this.maxSigops = consensus.MAX_BLOCK_SIGOPS_COST;
  this.reservedWeight = 4000;
  this.reservedSigops = 400;

  this.fromOptions(options);
}
1345217
function CmpctBlockPacket(block, witness) {
  if (!(this instanceof CmpctBlockPacket))
    return new CmpctBlockPacket(block, witness);

  Packet.call(this);

  this.block = block || new bip152.CompactBlock();
  this.witness = witness || false;
}
791591
function signTransaction(priKeyBytes, transaction) {

  if (typeof priKeyBytes === 'string') {
    priKeyBytes = hexStr2byteArray(priKeyBytes);
  }

  let raw = transaction.getRawData();
  let rawBytes = raw.serializeBinary();
  let hashBytes = SHA256(rawBytes);
  let signBytes = ECKeySign(hashBytes, priKeyBytes);
  let uint8Array = new Uint8Array(signBytes);
  let count = raw.getContractList().length;
  for (let i = 0; i < count; i++) {
    transaction.addSignature(uint8Array);
  }

  return transaction;
}
360862
function blockHeaderFromRpc (blockParams) {
  const blockHeader = new BlockHeader({
    parentHash: blockParams.parentHash,
    uncleHash: blockParams.sha3Uncles,
    coinbase: blockParams.miner,
    stateRoot: blockParams.stateRoot,
    transactionsTrie: blockParams.transactionsRoot,
    receiptTrie: blockParams.receiptRoot || blockParams.receiptsRoot || ethUtil.SHA3_NULL,
    bloom: blockParams.logsBloom,
    difficulty: blockParams.difficulty,
    number: blockParams.number,
    gasLimit: blockParams.gasLimit,
    gasUsed: blockParams.gasUsed,
    timestamp: blockParams.timestamp,
    extraData: blockParams.extraData,
    mixHash: blockParams.mixHash,
    nonce: blockParams.nonce
  })

  // override hash incase something was missing
  blockHeader.hash = function () {
    return ethUtil.toBuffer(blockParams.hash)
  }

  return blockHeader
}
1310862
function MerkleBlockPacket(block) {
  if (!(this instanceof MerkleBlockPacket))
    return new MerkleBlockPacket(block);

  Packet.call(this);

  this.block = block || new MerkleBlock();
}
1162413
function generateHashForOptions (options) {
  var hash = crypto.createHash('md5');
  hash.update(JSON.stringify(options));
  return hash.digest('hex');
}
1096257
function BlockTemplate(options) {
  if (!(this instanceof BlockTemplate))
    return new BlockTemplate(options);

  this.prevBlock = encoding.NULL_HASH;
  this.version = 1;
  this.height = 0;
  this.time = 0;
  this.bits = 0;
  this.target = encoding.ZERO_HASH;
  this.locktime = 0;
  this.mtp = 0;
  this.flags = 0;
  this.coinbaseFlags = DUMMY;
  this.witness = false;
  this.address = new Address();
  this.reserve = new Address();
  this.sigops = 400;
  this.weight = 4000;
  this.interval = 210000;
  this.fees = 0;
  this.tree = new MerkleTree();
  this.commitment = encoding.ZERO_HASH;
  this.left = DUMMY;
  this.right = DUMMY;
  this.items = [];

  if (options)
    this.fromOptions(options);
}
1037764
async function sendTransaction (tx, options = {}) {
  const { waitMined, verify } = R.merge(this.Chain.defaults, options)
  // Verify transaction before broadcast
  if (this.verifyTxBeforeSend || verify) {
    const { validation, tx: txObject, txType } = await this.unpackAndVerify(tx)
    if (validation.length) {
      throw Object.assign(Error('Transaction verification error'), {
        code: 'TX_VERIFICATION_ERROR',
        errorData: { validation, tx: txObject, txType },
        txHash: tx
      })
    }
  }

  try {
    const { txHash } = await this.api.postTransaction({ tx })
    return waitMined ? { ...(await this.poll(txHash, options)), rawTx: tx } : { hash: txHash, rawTx: tx }
  } catch (e) {
    throw Object.assign(
      (new Error(e.message)),
      {
        rawTx: tx,
        verifyTx: () => this.unpackAndVerify(tx)
      }
    )
  }
}
158747
def get_transaction(txhash)
      blockhash, tx_num_enc = RLP.decode @db.get(txhash)
      blk = RLP.decode(@db.get(blockhash), sedes: Block, env: @env)

      num = Utils.decode_int tx_num_enc
      tx_data = blk.get_transaction num

      [tx_data, blk, num]
    end