17 using valtype = std::vector<unsigned char>;
43 for (
auto const& i: _cache) {
44 if(i.second.alive == 0) {
48 s << i.second.hash << i.second.nVout << i.second.value << i.second.alive;
71 stateUTXO.setRoot(_r);
75 cacheUTXO.insert(std::make_pair(address, vin));
79 return stateUTXO.root();
82 std::unordered_map<dev::Address, Vin> vins()
const;
112 void deleteAccounts(std::set<dev::Address>& addrs);
114 void updateUTXO(
const std::unordered_map<dev::Address, Vin>& vins);
136 globalStateRef(_globalStateRef),
137 oldHashStateRoot(globalStateRef->rootHash()),
138 oldHashUTXORoot(globalStateRef->rootHashUTXO()) {}
142 globalStateRef->setRoot(newHashStateRoot);
143 globalStateRef->setRootUTXO(newHashUTXORoot);
147 globalStateRef->setRoot(oldHashStateRoot);
148 globalStateRef->setRootUTXO(oldHashUTXORoot);
163 CondensingTX(
FascState* _state,
const std::vector<TransferInfo>& _transfers,
const FascTransaction& _transaction, std::set<dev::Address> _deleteAddresses = std::set<dev::Address>()) : transfers(_transfers), deleteAddresses(_deleteAddresses), transaction(_transaction), state(_state) {}
167 std::unordered_map<dev::Address, Vin> createVin(
const CTransaction& tx);
177 void calculatePlusAndMinus();
179 bool createNewBalances();
181 std::vector<CTxIn> createVins();
183 std::vector<CTxOut> createVout();
193 std::map<dev::Address, Vin>
vins;
205 bool voutOverflow =
false;
const std::vector< TransferInfo > & transfers
dev::eth::ExecutionResult execRes
std::function< void(uint64_t, uint64_t, dev::eth::Instruction, dev::bigint, dev::bigint, dev::bigint, dev::eth::VM *, dev::eth::ExtVMFace const *)> OnOpFunc
#define function(a, b, c, d, k, s)
dev::OverlayDB const & dbUtxo() const
std::map< dev::Address, dev::u256 > balances
boost::multiprecision::number< boost::multiprecision::cpp_int_backend<>> bigint
bytes const & out() const
Read the byte stream.
const std::set< dev::Address > deleteAddresses
CondensingTX(FascState *_state, const std::vector< TransferInfo > &_transfers, const FascTransaction &_transaction, std::set< dev::Address > _deleteAddresses=std::set< dev::Address >())
void setRootUTXO(dev::h256 const &_r)
Different view on a GenericTrieDB that can use different key types.
Description of the result of executing a transaction.
Model of an Ethereum state, essentially a facade for the trie.
std::vector< TransferInfo > transfers
std::map< dev::Address, uint32_t > nVouts
dev::h256 oldHashStateRoot
std::unique_ptr< FascState > & globalStateRef
void insert(KeyType _k, bytesConstRef _value)
dev::OverlayDB & dbUtxo()
std::unordered_map< dev::Address, Vin > cacheUTXO
Fixed-size raw-byte array container type, with an API optimised for storing hashes.
std::function< void(uint64_t, uint64_t, Instruction, bigint, bigint, bigint, VM *, ExtVMFace const *)> OnOpFunc
TemporaryState(std::unique_ptr< FascState > &_globalStateRef)
dev::h256 oldHashUTXORoot
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< 256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void >> u256
void setCacheUTXO(dev::Address const &address, Vin const &vin)
dev::h256 rootHashUTXO() const
Instruction
Virtual machine bytecode instruction.
void SetRoot(dev::h256 newHashStateRoot, dev::h256 newHashUTXORoot)
Interface and null implementation of the class for specifying VM externalities.
std::map< dev::Address, plusAndMinus > plusMinusInfo
std::pair< dev::u256, dev::u256 > plusAndMinus
dev::eth::SecureTrieDB< dev::Address, dev::OverlayDB > stateUTXO
const FascTransaction & transaction
std::vector< unsigned char > valtype
std::map< dev::Address, Vin > vins
struct evm_uint160be address(struct evm_env *env)
The basic transaction that is broadcasted on the network and contained in blocks. ...
Class for writing to an RLP bytestream.
dev::AddressHash commit(std::unordered_map< dev::Address, Vin > const &_cache, dev::eth::SecureTrieDB< dev::Address, DB > &_state, std::unordered_map< dev::Address, dev::eth::Account > const &_cacheAcc)
dev::eth::TransactionReceipt txRec
std::unordered_set< h160 > AddressHash
A hash set of Ethereum addresses.