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
deploy.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 std::string tx_hash;
41 evmc::address signer_address{};
42 evmc::address contract_address{};
43 std::string block_number_hex;
44 std::string gas_used_hex;
45 };
46}
47
48template <>
49struct std::formatter<dcn::chain::DeployError::Kind> : std::formatter<std::string>
50{
51 auto format(const dcn::chain::DeployError::Kind & err, format_context & ctx) const
52 {
53 switch(err)
54 {
56 return formatter<string>::format("Invalid config", ctx);
58 return formatter<string>::format("Invalid input", ctx);
60 return formatter<string>::format("RPC error", ctx);
62 return formatter<string>::format("Malformed RPC response", ctx);
64 return formatter<string>::format("Signing error", ctx);
66 return formatter<string>::format("Transaction reverted", ctx);
68 return formatter<string>::format("Timeout", ctx);
69 default:
70 return formatter<string>::format("Unknown", ctx);
71 }
72 }
73};
Definition address.hpp:17
Definition decentralised_art.hpp:33
Definition deploy.hpp:21
enum dcn::chain::DeployError::Kind kind
std::string message
Definition deploy.hpp:34
std::vector< std::uint8_t > result_bytes
Definition deploy.hpp:35
Kind
Definition deploy.hpp:23
Definition deploy.hpp:39
evmc::address contract_address
Definition deploy.hpp:42
std::string tx_hash
Definition deploy.hpp:40
std::string gas_used_hex
Definition deploy.hpp:44
std::string block_number_hex
Definition deploy.hpp:43
evmc::address signer_address
Definition deploy.hpp:41
auto format(const dcn::chain::DeployError::Kind &err, format_context &ctx) const
Definition deploy.hpp:51