Browse Source

Work on exceptions.

Build fix.
cl-refactor
Gav Wood 11 years ago
parent
commit
6bf526edf8
  1. 51
      libethereum/Exceptions.h
  2. 2
      test/CMakeLists.txt

51
libethereum/Exceptions.h

@ -6,27 +6,34 @@
namespace eth namespace eth
{ {
class BadHexCharacter: public std::exception {}; class Exception: public std::exception
class NotEnoughCash: public std::exception {}; {
class BadInstruction: public std::exception {}; public:
class StackTooSmall: public std::exception { public: StackTooSmall(u256 _req, u256 _got): req(_req), got(_got) {} u256 req; u256 got; }; virtual std::string description() const { return "Exception"; }
class OperandOutOfRange: public std::exception { public: OperandOutOfRange(u256 _min, u256 _max, u256 _got): mn(_min), mx(_max), got(_got) {} u256 mn; u256 mx; u256 got; }; virtual char const* what() const noexcept { return description().c_str(); }
class ExecutionException: public std::exception {}; };
class NoSuchContract: public std::exception {};
class ContractAddressCollision: public std::exception {}; class BadHexCharacter: public Exception {};
class FeeTooSmall: public std::exception {}; class NotEnoughCash: public Exception {};
class InvalidSignature: public std::exception {}; class BadInstruction: public Exception {};
class InvalidTransactionFormat: public std::exception {}; class StackTooSmall: public Exception { public: StackTooSmall(u256 _req, u256 _got): req(_req), got(_got) {} u256 req; u256 got; };
class InvalidBlockFormat: public std::exception {}; class OperandOutOfRange: public Exception { public: OperandOutOfRange(u256 _min, u256 _max, u256 _got): mn(_min), mx(_max), got(_got) {} u256 mn; u256 mx; u256 got; };
class InvalidUnclesHash: public std::exception {}; class ExecutionException: public Exception {};
class InvalidUncle: public std::exception {}; class NoSuchContract: public Exception {};
class InvalidStateRoot: public std::exception {}; class ContractAddressCollision: public Exception {};
class InvalidTransactionsHash: public std::exception {}; class FeeTooSmall: public Exception {};
class InvalidTransaction: public std::exception {}; class InvalidSignature: public Exception {};
class InvalidDifficulty: public std::exception {}; class InvalidTransactionFormat: public Exception {};
class InvalidTimestamp: public std::exception {}; class InvalidBlockFormat: public Exception { public: virtual std::string description() const { return "Invalid block format"; } };
class InvalidNonce: public std::exception { public: InvalidNonce(u256 _required = 0, u256 _candidate = 0): required(_required), candidate(_candidate) {} u256 required; u256 candidate; }; class InvalidUnclesHash: public Exception {};
class InvalidParentHash: public std::exception {}; class InvalidUncle: public Exception {};
class InvalidContractAddress: public std::exception {}; class InvalidStateRoot: public Exception {};
class InvalidTransactionsHash: public Exception {};
class InvalidTransaction: public Exception {};
class InvalidDifficulty: public Exception {};
class InvalidTimestamp: public Exception {};
class InvalidNonce: public Exception { public: InvalidNonce(u256 _required = 0, u256 _candidate = 0): required(_required), candidate(_candidate) {} u256 required; u256 candidate; };
class InvalidParentHash: public Exception {};
class InvalidContractAddress: public Exception {};
} }

2
test/CMakeLists.txt

@ -2,6 +2,7 @@ cmake_policy(SET CMP0015 NEW)
aux_source_directory(. SRC_LIST) aux_source_directory(. SRC_LIST)
include_directories(../secp256k1)
include_directories(../libethereum) include_directories(../libethereum)
link_directories(../libethereum) link_directories(../libethereum)
@ -10,6 +11,7 @@ add_executable(testeth ${SRC_LIST})
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
target_link_libraries(testeth ethereum) target_link_libraries(testeth ethereum)
target_link_libraries(testeth secp256k1)
target_link_libraries(testeth miniupnpc) target_link_libraries(testeth miniupnpc)
target_link_libraries(testeth ${CRYPTOPP_LIBRARIES}) target_link_libraries(testeth ${CRYPTOPP_LIBRARIES})
target_link_libraries(testeth gmp) target_link_libraries(testeth gmp)

Loading…
Cancel
Save