bunch of fixes over isolate_auditable_and_proof test

This commit is contained in:
cryptozoidberg 2021-06-26 02:40:41 +02:00
parent d83f8c3e9e
commit 33b26a68c9
No known key found for this signature in database
GPG key ID: 22DEB97A54C6FDEC
4 changed files with 17 additions and 18 deletions

View file

@ -383,6 +383,14 @@ namespace currency
FIELD(security)
FIELD(flags)
END_SERIALIZE()
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(service_id)
KV_SERIALIZE(instruction)
KV_SERIALIZE(body)
KV_SERIALIZE_CONTAINER_POD_AS_BLOB(security)
KV_SERIALIZE(flags)
END_KV_SERIALIZE_MAP()
};
// applicable flags for tx_service_attachment::flags, can be combined using bitwise OR

View file

@ -720,7 +720,7 @@ void wallet2::prepare_wti_decrypted_attachments(wallet_public::wallet_transfer_i
{
if (item.type() == typeid(currency::tx_service_attachment))
{
wti.service_entries.push_back(tools::wallet_public::tx_service_attachment_kv(boost::get<currency::tx_service_attachment>(item)));
wti.service_entries.push_back(boost::get<currency::tx_service_attachment>(item));
}
}
}

View file

@ -87,17 +87,6 @@ namespace wallet_public
#define WALLET_TRANSFER_INFO_FLAGS_HTLC_DEPOSIT static_cast<uint16_t>(1 << 0)
struct tx_service_attachment_kv: public currency::tx_service_attachment
{
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(service_id)
KV_SERIALIZE(instruction)
KV_SERIALIZE(body)
KV_SERIALIZE_CONTAINER_POD_AS_BLOB(security)
KV_SERIALIZE(flags)
END_KV_SERIALIZE_MAP()
};
struct wallet_transfer_info
{
uint64_t amount;
@ -116,7 +105,7 @@ namespace wallet_public
bool is_mining;
uint64_t tx_type;
wallet_transfer_info_details td;
std::vector<tx_service_attachment_kv> service_entries;
std::vector<currency::tx_service_attachment> service_entries;
//not included in streaming serialization
uint64_t fee;
bool show_sender;

View file

@ -6,7 +6,9 @@
#include "escrow_wallet_tests.h"
#include "random_helper.h"
#include "chaingen_helpers.h"
#include "atomic_tests.h"
#include "isolate_auditable_and_proof.h"
#include "wallet/wrap_service.h"
#include "wallet/wallet_rpc_server.h"
using namespace epee;
using namespace crypto;
@ -77,7 +79,7 @@ bool isolate_auditable_and_proof::c1(currency::core& c, size_t ev_index, const s
{
std::vector<extra_v> extra;
std::vector<currency::attachment_v> attachments;
vector<currency::tx_destination_entry> dsts;
std::vector<currency::tx_destination_entry> dsts;
currency::tx_destination_entry de;
de.addr.resize(1);
@ -104,11 +106,11 @@ bool isolate_auditable_and_proof::c1(currency::core& c, size_t ev_index, const s
epee::json_rpc::error je;
tools::wallet_rpc_server::connection_context ctx;
tools::wallet_rpc_server miner_wlt_rpc(*auditable_test_instance);
wallet_public::COMMAND_RPC_GET_RECENT_TXS_AND_INFO::request req = AUTO_VAL_INIT();
wallet_public::COMMAND_RPC_GET_RECENT_TXS_AND_INFO::request res = AUTO_VAL_INIT();
tools::wallet_public::COMMAND_RPC_GET_RECENT_TXS_AND_INFO::request req = AUTO_VAL_INIT(req);
tools::wallet_public::COMMAND_RPC_GET_RECENT_TXS_AND_INFO::response res = AUTO_VAL_INIT(res);
req.count = 100;
req.offset = 0;
miner_wlt_rpc->on_get_recent_txs_and_info(req, res, je, ctx);
miner_wlt_rpc.on_get_recent_txs_and_info(req, res, je, ctx);
std::string ps = epee::serialization::store_t_to_json(res);
return r;