Decentralised Art Server
High-performance C++ backend that exposes HTML interface and a secure REST API for managing Performative Transactions entities
 
Loading...
Searching...
No Matches
execute.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <expected>
5#include <format>
6#include <optional>
7#include <string>
8#include <vector>
9
10#ifdef interface
11 #undef interface
12#endif
13#include <evmc/evmc.hpp>
14#ifndef interface
15 #define interface __STRUCT__
16#endif
17
18namespace dcn::chain
19{
21 {
22 enum class Kind : std::uint8_t
23 {
24 UNKNOWN = 0,
33
34 std::string message;
35 std::vector<std::uint8_t> result_bytes;
36 };
37
39 {
40
41 };
42}
43
44template <>
45struct std::formatter<dcn::chain::ExecuteError::Kind> : std::formatter<std::string>
46{
47 auto format(const dcn::chain::ExecuteError::Kind & err, format_context & ctx) const
48 {
49 switch(err)
50 {
52 return formatter<string>::format("Invalid config", ctx);
54 return formatter<string>::format("Invalid input", ctx);
56 return formatter<string>::format("RPC error", ctx);
58 return formatter<string>::format("Malformed RPC response", ctx);
60 return formatter<string>::format("Signing error", ctx);
62 return formatter<string>::format("Transaction reverted", ctx);
64 return formatter<string>::format("Timeout", ctx);
65 default:
66 return formatter<string>::format("Unknown", ctx);
67 }
68 }
69};
Definition address.hpp:17
Definition decentralised_art.hpp:33
Definition execute.hpp:21
std::vector< std::uint8_t > result_bytes
Definition execute.hpp:35
Kind
Definition execute.hpp:23
enum dcn::chain::ExecuteError::Kind kind
std::string message
Definition execute.hpp:34
Definition execute.hpp:39
auto format(const dcn::chain::ExecuteError::Kind &err, format_context &ctx) const
Definition execute.hpp:47