Skip to content

Commit

Permalink
Fix tx validation state (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
Warchant authored Jan 27, 2020
1 parent 84b3ed3 commit e4b6386
Show file tree
Hide file tree
Showing 5 changed files with 193 additions and 137 deletions.
10 changes: 6 additions & 4 deletions src/vbk/pop_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ using BlockBytes = std::vector<uint8_t>;
struct PopService {
virtual ~PopService() = default;

virtual void clearTemporaryPayloads() = 0;

virtual void savePopTxToDatabase(const CBlock& block, const int& nHeight) = 0;

virtual std::vector<BlockBytes> getLastKnownVBKBlocks(size_t blocks) = 0;
Expand All @@ -45,12 +47,12 @@ struct PopService {

virtual void updateContext(const std::vector<std::vector<uint8_t>>& veriBlockBlocks, const std::vector<std::vector<uint8_t>>& bitcoinBlocks) = 0;

virtual bool parsePopTx(const CTransactionRef& tx, Publications* publications, Context* ctx, PopTxType* type) = 0;
virtual bool parsePopTx(const CTransactionRef& tx, ScriptError* serror, Publications* publications, Context* ctx, PopTxType* type) = 0;

virtual bool determineATVPlausibilityWithBTCRules(AltchainId altChainIdentifier, const CBlockHeader& popEndorsementHeader, const Consensus::Params& params) = 0;
virtual bool determineATVPlausibilityWithBTCRules(AltchainId altChainIdentifier, const CBlockHeader& popEndorsementHeader, const Consensus::Params& params, TxValidationState& state) = 0;

virtual void addPayloads(const CBlock& block, const int& nHeight, const Publications& publications) = 0;
virtual void removePayloads(const CBlock&, const int&) = 0;
virtual void addPayloads(std::string blockHash, const int& nHeight, const Publications& publications) = 0;
virtual void removePayloads(std::string blockHash, const int& blockHeight) = 0;
virtual void setConfig() = 0;
};
} // namespace VeriBlock
Expand Down
Loading

0 comments on commit e4b6386

Please sign in to comment.