Skip to content

Commit

Permalink
generated
Browse files Browse the repository at this point in the history
  • Loading branch information
madMAx43v3r committed Nov 12, 2023
1 parent 75e7a93 commit 081f419
Show file tree
Hide file tree
Showing 20 changed files with 1,065 additions and 301 deletions.
104 changes: 51 additions & 53 deletions generated/include/mmx/ChainParams.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ public:

uint32_t port = 0;
int32_t decimals = 6;
uint32_t min_ksize = 30;
uint32_t max_ksize = 60;
uint32_t plot_filter = 9;
uint32_t plot_filter_cycle = 4;
uint32_t min_ksize = 26;
uint32_t max_ksize = 32;
uint32_t plot_filter = 8;
uint32_t commit_delay = 18;
uint32_t infuse_delay = 6;
uint32_t challenge_delay = 9;
Expand Down Expand Up @@ -56,7 +55,7 @@ public:
uint64_t max_block_cost = 100000000;
uint64_t max_tx_cost = 1000000;
vnx::float64_t block_time = 10;
std::string vdf_seed;
std::string network;
::mmx::addr_t nft_binary;
::mmx::addr_t plot_binary;
::mmx::addr_t swap_binary;
Expand Down Expand Up @@ -112,59 +111,58 @@ protected:

template<typename T>
void ChainParams::accept_generic(T& _visitor) const {
_visitor.template type_begin<ChainParams>(51);
_visitor.template type_begin<ChainParams>(50);
_visitor.type_field("port", 0); _visitor.accept(port);
_visitor.type_field("decimals", 1); _visitor.accept(decimals);
_visitor.type_field("min_ksize", 2); _visitor.accept(min_ksize);
_visitor.type_field("max_ksize", 3); _visitor.accept(max_ksize);
_visitor.type_field("plot_filter", 4); _visitor.accept(plot_filter);
_visitor.type_field("plot_filter_cycle", 5); _visitor.accept(plot_filter_cycle);
_visitor.type_field("commit_delay", 6); _visitor.accept(commit_delay);
_visitor.type_field("infuse_delay", 7); _visitor.accept(infuse_delay);
_visitor.type_field("challenge_delay", 8); _visitor.accept(challenge_delay);
_visitor.type_field("challenge_interval", 9); _visitor.accept(challenge_interval);
_visitor.type_field("max_diff_adjust", 10); _visitor.accept(max_diff_adjust);
_visitor.type_field("avg_txfee_adjust", 11); _visitor.accept(avg_txfee_adjust);
_visitor.type_field("min_vdf_segments", 12); _visitor.accept(min_vdf_segments);
_visitor.type_field("num_vdf_segments", 13); _visitor.accept(num_vdf_segments);
_visitor.type_field("max_vdf_segments", 14); _visitor.accept(max_vdf_segments);
_visitor.type_field("score_bits", 15); _visitor.accept(score_bits);
_visitor.type_field("score_target", 16); _visitor.accept(score_target);
_visitor.type_field("score_threshold", 17); _visitor.accept(score_threshold);
_visitor.type_field("vdf_reward", 18); _visitor.accept(vdf_reward);
_visitor.type_field("min_reward", 19); _visitor.accept(min_reward);
_visitor.type_field("reward_factor", 20); _visitor.accept(reward_factor);
_visitor.type_field("time_diff_constant", 21); _visitor.accept(time_diff_constant);
_visitor.type_field("space_diff_constant", 22); _visitor.accept(space_diff_constant);
_visitor.type_field("virtual_space_constant", 23); _visitor.accept(virtual_space_constant);
_visitor.type_field("min_time_diff", 24); _visitor.accept(min_time_diff);
_visitor.type_field("initial_time_diff", 25); _visitor.accept(initial_time_diff);
_visitor.type_field("initial_space_diff", 26); _visitor.accept(initial_space_diff);
_visitor.type_field("min_txfee", 27); _visitor.accept(min_txfee);
_visitor.type_field("min_txfee_io", 28); _visitor.accept(min_txfee_io);
_visitor.type_field("min_txfee_sign", 29); _visitor.accept(min_txfee_sign);
_visitor.type_field("min_txfee_memo", 30); _visitor.accept(min_txfee_memo);
_visitor.type_field("min_txfee_exec", 31); _visitor.accept(min_txfee_exec);
_visitor.type_field("min_txfee_deploy", 32); _visitor.accept(min_txfee_deploy);
_visitor.type_field("min_txfee_byte", 33); _visitor.accept(min_txfee_byte);
_visitor.type_field("min_txfee_read", 34); _visitor.accept(min_txfee_read);
_visitor.type_field("min_txfee_read_kbyte", 35); _visitor.accept(min_txfee_read_kbyte);
_visitor.type_field("min_txfee_activate", 36); _visitor.accept(min_txfee_activate);
_visitor.type_field("max_block_size", 37); _visitor.accept(max_block_size);
_visitor.type_field("max_block_cost", 38); _visitor.accept(max_block_cost);
_visitor.type_field("max_tx_cost", 39); _visitor.accept(max_tx_cost);
_visitor.type_field("block_time", 40); _visitor.accept(block_time);
_visitor.type_field("vdf_seed", 41); _visitor.accept(vdf_seed);
_visitor.type_field("nft_binary", 42); _visitor.accept(nft_binary);
_visitor.type_field("plot_binary", 43); _visitor.accept(plot_binary);
_visitor.type_field("swap_binary", 44); _visitor.accept(swap_binary);
_visitor.type_field("offer_binary", 45); _visitor.accept(offer_binary);
_visitor.type_field("token_binary", 46); _visitor.accept(token_binary);
_visitor.type_field("plot_nft_binary", 47); _visitor.accept(plot_nft_binary);
_visitor.type_field("project_addr", 48); _visitor.accept(project_addr);
_visitor.type_field("fixed_project_reward", 49); _visitor.accept(fixed_project_reward);
_visitor.type_field("project_ratio", 50); _visitor.accept(project_ratio);
_visitor.template type_end<ChainParams>(51);
_visitor.type_field("commit_delay", 5); _visitor.accept(commit_delay);
_visitor.type_field("infuse_delay", 6); _visitor.accept(infuse_delay);
_visitor.type_field("challenge_delay", 7); _visitor.accept(challenge_delay);
_visitor.type_field("challenge_interval", 8); _visitor.accept(challenge_interval);
_visitor.type_field("max_diff_adjust", 9); _visitor.accept(max_diff_adjust);
_visitor.type_field("avg_txfee_adjust", 10); _visitor.accept(avg_txfee_adjust);
_visitor.type_field("min_vdf_segments", 11); _visitor.accept(min_vdf_segments);
_visitor.type_field("num_vdf_segments", 12); _visitor.accept(num_vdf_segments);
_visitor.type_field("max_vdf_segments", 13); _visitor.accept(max_vdf_segments);
_visitor.type_field("score_bits", 14); _visitor.accept(score_bits);
_visitor.type_field("score_target", 15); _visitor.accept(score_target);
_visitor.type_field("score_threshold", 16); _visitor.accept(score_threshold);
_visitor.type_field("vdf_reward", 17); _visitor.accept(vdf_reward);
_visitor.type_field("min_reward", 18); _visitor.accept(min_reward);
_visitor.type_field("reward_factor", 19); _visitor.accept(reward_factor);
_visitor.type_field("time_diff_constant", 20); _visitor.accept(time_diff_constant);
_visitor.type_field("space_diff_constant", 21); _visitor.accept(space_diff_constant);
_visitor.type_field("virtual_space_constant", 22); _visitor.accept(virtual_space_constant);
_visitor.type_field("min_time_diff", 23); _visitor.accept(min_time_diff);
_visitor.type_field("initial_time_diff", 24); _visitor.accept(initial_time_diff);
_visitor.type_field("initial_space_diff", 25); _visitor.accept(initial_space_diff);
_visitor.type_field("min_txfee", 26); _visitor.accept(min_txfee);
_visitor.type_field("min_txfee_io", 27); _visitor.accept(min_txfee_io);
_visitor.type_field("min_txfee_sign", 28); _visitor.accept(min_txfee_sign);
_visitor.type_field("min_txfee_memo", 29); _visitor.accept(min_txfee_memo);
_visitor.type_field("min_txfee_exec", 30); _visitor.accept(min_txfee_exec);
_visitor.type_field("min_txfee_deploy", 31); _visitor.accept(min_txfee_deploy);
_visitor.type_field("min_txfee_byte", 32); _visitor.accept(min_txfee_byte);
_visitor.type_field("min_txfee_read", 33); _visitor.accept(min_txfee_read);
_visitor.type_field("min_txfee_read_kbyte", 34); _visitor.accept(min_txfee_read_kbyte);
_visitor.type_field("min_txfee_activate", 35); _visitor.accept(min_txfee_activate);
_visitor.type_field("max_block_size", 36); _visitor.accept(max_block_size);
_visitor.type_field("max_block_cost", 37); _visitor.accept(max_block_cost);
_visitor.type_field("max_tx_cost", 38); _visitor.accept(max_tx_cost);
_visitor.type_field("block_time", 39); _visitor.accept(block_time);
_visitor.type_field("network", 40); _visitor.accept(network);
_visitor.type_field("nft_binary", 41); _visitor.accept(nft_binary);
_visitor.type_field("plot_binary", 42); _visitor.accept(plot_binary);
_visitor.type_field("swap_binary", 43); _visitor.accept(swap_binary);
_visitor.type_field("offer_binary", 44); _visitor.accept(offer_binary);
_visitor.type_field("token_binary", 45); _visitor.accept(token_binary);
_visitor.type_field("plot_nft_binary", 46); _visitor.accept(plot_nft_binary);
_visitor.type_field("project_addr", 47); _visitor.accept(project_addr);
_visitor.type_field("fixed_project_reward", 48); _visitor.accept(fixed_project_reward);
_visitor.type_field("project_ratio", 49); _visitor.accept(project_ratio);
_visitor.template type_end<ChainParams>(50);
}


Expand Down
4 changes: 2 additions & 2 deletions generated/include/mmx/Challenge.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MMX_EXPORT Challenge : public ::vnx::Value {
public:

uint32_t height = 0;
std::vector<::mmx::hash_t> challenges;
::mmx::hash_t challenge;
::mmx::hash_t diff_block_hash;
uint64_t space_diff = 0;
uint32_t max_delay = 0;
Expand Down Expand Up @@ -69,7 +69,7 @@ template<typename T>
void Challenge::accept_generic(T& _visitor) const {
_visitor.template type_begin<Challenge>(5);
_visitor.type_field("height", 0); _visitor.accept(height);
_visitor.type_field("challenges", 1); _visitor.accept(challenges);
_visitor.type_field("challenge", 1); _visitor.accept(challenge);
_visitor.type_field("diff_block_hash", 2); _visitor.accept(diff_block_hash);
_visitor.type_field("space_diff", 3); _visitor.accept(space_diff);
_visitor.type_field("max_delay", 4); _visitor.accept(max_delay);
Expand Down
2 changes: 1 addition & 1 deletion generated/include/mmx/NodeAsyncClient.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public:
const std::function<void(const ::mmx::uint128&)>& _callback = std::function<void(const ::mmx::uint128&)>(),
const std::function<void(const vnx::exception&)>& _error_callback = std::function<void(const vnx::exception&)>());

uint64_t get_farmed_blocks(const std::vector<::mmx::bls_pubkey_t>& farmer_keys = {}, const vnx::bool_t& full_blocks = 0, const uint32_t& since = 0,
uint64_t get_farmed_blocks(const std::vector<::mmx::bls_pubkey_t>& farmer_keys = {}, const vnx::bool_t& full_blocks = 0, const uint32_t& since = 0, const int32_t& limit = 100,
const std::function<void(const std::vector<std::shared_ptr<const ::mmx::BlockHeader>>&)>& _callback = std::function<void(const std::vector<std::shared_ptr<const ::mmx::BlockHeader>>&)>(),
const std::function<void(const vnx::exception&)>& _error_callback = std::function<void(const vnx::exception&)>());

Expand Down
2 changes: 1 addition & 1 deletion generated/include/mmx/NodeBase.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ protected:
virtual std::array<::mmx::uint128, 2> get_swap_equivalent_liquidity(const ::mmx::addr_t& address, const ::mmx::addr_t& user) const = 0;
virtual std::map<::mmx::addr_t, std::array<std::pair<::mmx::addr_t, ::mmx::uint128>, 2>> get_swap_liquidity_by(const std::vector<::mmx::addr_t>& addresses) const = 0;
virtual ::mmx::uint128 get_total_supply(const ::mmx::addr_t& currency) const = 0;
virtual std::vector<std::shared_ptr<const ::mmx::BlockHeader>> get_farmed_blocks(const std::vector<::mmx::bls_pubkey_t>& farmer_keys, const vnx::bool_t& full_blocks, const uint32_t& since) const = 0;
virtual std::vector<std::shared_ptr<const ::mmx::BlockHeader>> get_farmed_blocks(const std::vector<::mmx::bls_pubkey_t>& farmer_keys, const vnx::bool_t& full_blocks, const uint32_t& since, const int32_t& limit) const = 0;
virtual std::map<::mmx::bls_pubkey_t, uint32_t> get_farmed_block_count(const uint32_t& since) const = 0;
virtual uint32_t get_farmed_block_count_for(const std::vector<::mmx::bls_pubkey_t>& farmer_keys, const uint32_t& since) const = 0;
virtual void start_sync(const vnx::bool_t& force) = 0;
Expand Down
2 changes: 1 addition & 1 deletion generated/include/mmx/NodeClient.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public:

::mmx::uint128 get_total_supply(const ::mmx::addr_t& currency = ::mmx::addr_t());

std::vector<std::shared_ptr<const ::mmx::BlockHeader>> get_farmed_blocks(const std::vector<::mmx::bls_pubkey_t>& farmer_keys = {}, const vnx::bool_t& full_blocks = 0, const uint32_t& since = 0);
std::vector<std::shared_ptr<const ::mmx::BlockHeader>> get_farmed_blocks(const std::vector<::mmx::bls_pubkey_t>& farmer_keys = {}, const vnx::bool_t& full_blocks = 0, const uint32_t& since = 0, const int32_t& limit = 100);

std::map<::mmx::bls_pubkey_t, uint32_t> get_farmed_block_count(const uint32_t& since = 0);

Expand Down
6 changes: 4 additions & 2 deletions generated/include/mmx/Node_get_farmed_blocks.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public:
std::vector<::mmx::bls_pubkey_t> farmer_keys;
vnx::bool_t full_blocks = 0;
uint32_t since = 0;
int32_t limit = 100;

typedef ::vnx::Value Super;

Expand Down Expand Up @@ -60,11 +61,12 @@ public:

template<typename T>
void Node_get_farmed_blocks::accept_generic(T& _visitor) const {
_visitor.template type_begin<Node_get_farmed_blocks>(3);
_visitor.template type_begin<Node_get_farmed_blocks>(4);
_visitor.type_field("farmer_keys", 0); _visitor.accept(farmer_keys);
_visitor.type_field("full_blocks", 1); _visitor.accept(full_blocks);
_visitor.type_field("since", 2); _visitor.accept(since);
_visitor.template type_end<Node_get_farmed_blocks>(3);
_visitor.type_field("limit", 3); _visitor.accept(limit);
_visitor.template type_end<Node_get_farmed_blocks>(4);
}


Expand Down
2 changes: 1 addition & 1 deletion generated/include/mmx/RouterBase.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public:
uint32_t vdf_credits = 1024;
uint32_t block_credits = 256;
uint32_t proof_credits = 10;
uint32_t vdf_relay_cost = 768;
uint32_t vdf_relay_cost = 256;
uint32_t proof_relay_cost = 2;
uint32_t dummy_relay_cost = 2;
uint32_t block_relay_cost = 16;
Expand Down
81 changes: 81 additions & 0 deletions generated/include/mmx/farmed_block_info_t.hxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@

// AUTO GENERATED by vnxcppcodegen

#ifndef INCLUDE_mmx_farmed_block_info_t_HXX_
#define INCLUDE_mmx_farmed_block_info_t_HXX_

#include <vnx/Type.h>
#include <mmx/package.hxx>
#include <mmx/addr_t.hpp>


namespace mmx {

struct MMX_EXPORT farmed_block_info_t {


uint32_t height = 0;
uint32_t reward = 0;
::mmx::addr_t reward_addr;

static const vnx::Hash64 VNX_TYPE_HASH;
static const vnx::Hash64 VNX_CODE_HASH;

static constexpr uint64_t VNX_TYPE_ID = 0x2e10154a52617b19ull;

farmed_block_info_t() {}

vnx::Hash64 get_type_hash() const;
std::string get_type_name() const;
const vnx::TypeCode* get_type_code() const;

static std::shared_ptr<farmed_block_info_t> create();
std::shared_ptr<farmed_block_info_t> clone() const;

void read(vnx::TypeInput& _in, const vnx::TypeCode* _type_code, const uint16_t* _code);
void write(vnx::TypeOutput& _out, const vnx::TypeCode* _type_code, const uint16_t* _code) const;

void read(std::istream& _in);
void write(std::ostream& _out) const;

template<typename T>
void accept_generic(T& _visitor) const;
void accept(vnx::Visitor& _visitor) const;

vnx::Object to_object() const;
void from_object(const vnx::Object& object);

vnx::Variant get_field(const std::string& name) const;
void set_field(const std::string& name, const vnx::Variant& value);

friend std::ostream& operator<<(std::ostream& _out, const farmed_block_info_t& _value);
friend std::istream& operator>>(std::istream& _in, farmed_block_info_t& _value);

static const vnx::TypeCode* static_get_type_code();
static std::shared_ptr<vnx::TypeCode> static_create_type_code();

};

template<typename T>
void farmed_block_info_t::accept_generic(T& _visitor) const {
_visitor.template type_begin<farmed_block_info_t>(3);
_visitor.type_field("height", 0); _visitor.accept(height);
_visitor.type_field("reward", 1); _visitor.accept(reward);
_visitor.type_field("reward_addr", 2); _visitor.accept(reward_addr);
_visitor.template type_end<farmed_block_info_t>(3);
}


} // namespace mmx


namespace vnx {

template<>
struct is_equivalent<::mmx::farmed_block_info_t> {
bool operator()(const uint16_t* code, const TypeCode* type_code);
};

} // vnx

#endif // INCLUDE_mmx_farmed_block_info_t_HXX_
80 changes: 80 additions & 0 deletions generated/include/mmx/farmer_info_t.hxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@

// AUTO GENERATED by vnxcppcodegen

#ifndef INCLUDE_mmx_farmer_info_t_HXX_
#define INCLUDE_mmx_farmer_info_t_HXX_

#include <vnx/Type.h>
#include <mmx/package.hxx>


namespace mmx {

struct MMX_EXPORT farmer_info_t {


uint32_t last_height = 0;
uint32_t total_blocks = 0;
uint64_t total_rewards = 0;

static const vnx::Hash64 VNX_TYPE_HASH;
static const vnx::Hash64 VNX_CODE_HASH;

static constexpr uint64_t VNX_TYPE_ID = 0x372781b32f14f74ull;

farmer_info_t() {}

vnx::Hash64 get_type_hash() const;
std::string get_type_name() const;
const vnx::TypeCode* get_type_code() const;

static std::shared_ptr<farmer_info_t> create();
std::shared_ptr<farmer_info_t> clone() const;

void read(vnx::TypeInput& _in, const vnx::TypeCode* _type_code, const uint16_t* _code);
void write(vnx::TypeOutput& _out, const vnx::TypeCode* _type_code, const uint16_t* _code) const;

void read(std::istream& _in);
void write(std::ostream& _out) const;

template<typename T>
void accept_generic(T& _visitor) const;
void accept(vnx::Visitor& _visitor) const;

vnx::Object to_object() const;
void from_object(const vnx::Object& object);

vnx::Variant get_field(const std::string& name) const;
void set_field(const std::string& name, const vnx::Variant& value);

friend std::ostream& operator<<(std::ostream& _out, const farmer_info_t& _value);
friend std::istream& operator>>(std::istream& _in, farmer_info_t& _value);

static const vnx::TypeCode* static_get_type_code();
static std::shared_ptr<vnx::TypeCode> static_create_type_code();

};

template<typename T>
void farmer_info_t::accept_generic(T& _visitor) const {
_visitor.template type_begin<farmer_info_t>(3);
_visitor.type_field("last_height", 0); _visitor.accept(last_height);
_visitor.type_field("total_blocks", 1); _visitor.accept(total_blocks);
_visitor.type_field("total_rewards", 2); _visitor.accept(total_rewards);
_visitor.template type_end<farmer_info_t>(3);
}


} // namespace mmx


namespace vnx {

template<>
struct is_equivalent<::mmx::farmer_info_t> {
bool operator()(const uint16_t* code, const TypeCode* type_code);
};

} // vnx

#endif // INCLUDE_mmx_farmer_info_t_HXX_
Loading

0 comments on commit 081f419

Please sign in to comment.