TARAXA
taraxa::Transaction Struct Reference

#include <transaction.hpp>

Collaboration diagram for taraxa::Transaction:

Classes

struct  InvalidFormat
 
struct  InvalidSignature
 
struct  InvalidTransaction
 

Public Member Functions

 Transaction ()
 
 Transaction (const trx_nonce_t &nonce, const val_t &value, const val_t &gas_price, gas_t gas, bytes data, const secret_t &sk, const std::optional< addr_t > &receiver=std::nullopt, uint64_t chain_id=0)
 
 Transaction (const dev::RLP &_rlp, bool verify_strict=false, const h256 &hash={})
 
 Transaction (const bytes &_rlp, bool verify_strict=false, const h256 &hash={})
 
auto isZero () const
 
const trx_hash_tgetHash () const
 
auto getNonce () const
 
const auto & getValue () const
 
const auto & getGasPrice () const
 
auto getGas () const
 
const auto & getData () const
 
const auto & getReceiver () const
 
auto getChainID () const
 
const auto & getVRS () const
 
auto getCost () const
 
virtual const addr_tgetSender () const
 
bool operator== (Transaction const &other) const
 
const bytesrlp () const
 
Json::Value toJSON () const
 

Protected Member Functions

trx_hash_t hash_for_signature () const
 
addr_t const & get_sender_ () const
 
virtual void streamRLP (dev::RLPStream &s, bool for_signature) const
 
virtual void fromRLP (const dev::RLP &_rlp, bool verify_strict, const h256 &hash)
 

Protected Attributes

trx_nonce_t nonce_ = 0
 
val_t value_ = 0
 
val_t gas_price_
 
gas_t gas_ = 0
 
bytes data_
 
std::optional< addr_treceiver_
 
uint64_t chain_id_ = 0
 
dev::SignatureStruct vrs_
 
trx_hash_t hash_
 
std::atomic_bool hash_initialized_ = false
 
bool is_zero_ = false
 
std::mutex hash_mu_
 
std::atomic_bool sender_initialized_ = false
 
bool sender_valid_ = false
 
addr_t sender_
 
std::mutex sender_mu_
 
std::atomic_bool cached_rlp_set_ = false
 
bytes cached_rlp_
 
std::mutex cached_rlp_mu_
 

Constructor & Destructor Documentation

◆ Transaction() [1/4]

taraxa::Transaction::Transaction ( )
inline

◆ Transaction() [2/4]

taraxa::Transaction::Transaction ( const trx_nonce_t nonce,
const val_t value,
const val_t gas_price,
gas_t  gas,
bytes  data,
const secret_t sk,
const std::optional< addr_t > &  receiver = std::nullopt,
uint64_t  chain_id = 0 
)

◆ Transaction() [3/4]

taraxa::Transaction::Transaction ( const dev::RLP _rlp,
bool  verify_strict = false,
const h256 hash = {} 
)
explicit

◆ Transaction() [4/4]

taraxa::Transaction::Transaction ( const bytes _rlp,
bool  verify_strict = false,
const h256 hash = {} 
)
explicit

Member Function Documentation

◆ fromRLP()

void taraxa::Transaction::fromRLP ( const dev::RLP _rlp,
bool  verify_strict,
const h256 hash 
)
protectedvirtual

Reimplemented in taraxa::SystemTransaction.

◆ get_sender_()

const addr_t & taraxa::Transaction::get_sender_ ( ) const
protected

◆ getChainID()

auto taraxa::Transaction::getChainID ( ) const
inline

◆ getCost()

auto taraxa::Transaction::getCost ( ) const
inline

◆ getData()

const auto& taraxa::Transaction::getData ( ) const
inline

◆ getGas()

auto taraxa::Transaction::getGas ( ) const
inline

◆ getGasPrice()

const auto& taraxa::Transaction::getGasPrice ( ) const
inline

◆ getHash()

const trx_hash_t & taraxa::Transaction::getHash ( ) const

◆ getNonce()

auto taraxa::Transaction::getNonce ( ) const
inline

◆ getReceiver()

const auto& taraxa::Transaction::getReceiver ( ) const
inline

◆ getSender()

const addr_t & taraxa::Transaction::getSender ( ) const
virtual

Reimplemented in taraxa::SystemTransaction.

◆ getValue()

const auto& taraxa::Transaction::getValue ( ) const
inline

◆ getVRS()

const auto& taraxa::Transaction::getVRS ( ) const
inline

◆ hash_for_signature()

trx_hash_t taraxa::Transaction::hash_for_signature ( ) const
protected

◆ isZero()

auto taraxa::Transaction::isZero ( ) const
inline

◆ operator==()

bool taraxa::Transaction::operator== ( Transaction const &  other) const
inline

◆ rlp()

const bytes & taraxa::Transaction::rlp ( ) const

◆ streamRLP()

void taraxa::Transaction::streamRLP ( dev::RLPStream s,
bool  for_signature 
) const
protectedvirtual

Reimplemented in taraxa::SystemTransaction.

◆ toJSON()

Json::Value taraxa::Transaction::toJSON ( ) const

Member Data Documentation

◆ cached_rlp_

bytes taraxa::Transaction::cached_rlp_
mutableprotected

◆ cached_rlp_mu_

std::mutex taraxa::Transaction::cached_rlp_mu_
mutableprotected

◆ cached_rlp_set_

std::atomic_bool taraxa::Transaction::cached_rlp_set_ = false
mutableprotected

◆ chain_id_

uint64_t taraxa::Transaction::chain_id_ = 0
protected

◆ data_

bytes taraxa::Transaction::data_
protected

◆ gas_

gas_t taraxa::Transaction::gas_ = 0
protected

◆ gas_price_

val_t taraxa::Transaction::gas_price_
protected

◆ hash_

trx_hash_t taraxa::Transaction::hash_
mutableprotected

◆ hash_initialized_

std::atomic_bool taraxa::Transaction::hash_initialized_ = false
mutableprotected

◆ hash_mu_

std::mutex taraxa::Transaction::hash_mu_
mutableprotected

◆ is_zero_

bool taraxa::Transaction::is_zero_ = false
protected

◆ nonce_

trx_nonce_t taraxa::Transaction::nonce_ = 0
protected

◆ receiver_

std::optional<addr_t> taraxa::Transaction::receiver_
protected

◆ sender_

addr_t taraxa::Transaction::sender_
mutableprotected

◆ sender_initialized_

std::atomic_bool taraxa::Transaction::sender_initialized_ = false
mutableprotected

◆ sender_mu_

std::mutex taraxa::Transaction::sender_mu_
mutableprotected

◆ sender_valid_

bool taraxa::Transaction::sender_valid_ = false
mutableprotected

◆ value_

val_t taraxa::Transaction::value_ = 0
protected

◆ vrs_

dev::SignatureStruct taraxa::Transaction::vrs_
protected

The documentation for this struct was generated from the following files: