|
|
|
@ -898,6 +898,39 @@ BOOST_AUTO_TEST_CASE(bridged__estimated_tx_network_fee)
|
|
|
|
|
BOOST_REQUIRE(fee == 330047330);
|
|
|
|
|
cout << "bridged__estimated_tx_network_fee: " << fee << endl;
|
|
|
|
|
}
|
|
|
|
|
BOOST_AUTO_TEST_CASE(bridged__estimate_fee)
|
|
|
|
|
{
|
|
|
|
|
using namespace serial_bridge;
|
|
|
|
|
//
|
|
|
|
|
boost::property_tree::ptree root;
|
|
|
|
|
root.put("use_per_byte_fee", "true");
|
|
|
|
|
root.put("use_rct", "true");
|
|
|
|
|
root.put("n_inputs", "2");
|
|
|
|
|
root.put("mixin", "10");
|
|
|
|
|
root.put("n_outputs", "2");
|
|
|
|
|
root.put("extra_size", "0");
|
|
|
|
|
root.put("bulletproof", "true");
|
|
|
|
|
root.put("base_fee", "24658");
|
|
|
|
|
root.put("fee_quantization_mask", "10000");
|
|
|
|
|
root.put("priority", "2");
|
|
|
|
|
root.put("fork_version", "10");
|
|
|
|
|
//
|
|
|
|
|
auto ret_string = serial_bridge::estimate_fee(args_string_from_root(root));
|
|
|
|
|
stringstream ret_stream;
|
|
|
|
|
ret_stream << ret_string;
|
|
|
|
|
boost::property_tree::ptree ret_tree;
|
|
|
|
|
boost::property_tree::read_json(ret_stream, ret_tree);
|
|
|
|
|
optional<string> err_string = ret_tree.get_optional<string>(ret_json_key__any__err_msg());
|
|
|
|
|
if (err_string != none) {
|
|
|
|
|
BOOST_REQUIRE_MESSAGE(false, *err_string);
|
|
|
|
|
}
|
|
|
|
|
optional<string> fee_string = ret_tree.get_optional<string>(ret_json_key__generic_retVal());
|
|
|
|
|
BOOST_REQUIRE(fee_string != none);
|
|
|
|
|
BOOST_REQUIRE((*fee_string).size() > 0);
|
|
|
|
|
uint64_t fee = stoull(*fee_string);
|
|
|
|
|
BOOST_REQUIRE(fee == 330050000);
|
|
|
|
|
cout << "bridged__estimate_fee: " << fee << endl;
|
|
|
|
|
}
|
|
|
|
|
BOOST_AUTO_TEST_CASE(bridged__estimate_rct_tx_size)
|
|
|
|
|
{
|
|
|
|
|
using namespace serial_bridge;
|
|
|
|
|