mirror of
https://codeberg.org/wownero/wownero-lws
synced 2026-01-08 22:55:15 -08:00
Add support for dynamic fees over ZMQ (#166)
* Add support for dynamic fees over ZMQ * Fix build after upstream change * Fix unit tests
This commit is contained in:
committed by
Lee *!* Clagett
parent
b63000d21a
commit
e593fd5fb2
@@ -128,7 +128,7 @@ if (MONERO_BUILD_DIR)
|
||||
PROTOLIB_LIBRARY
|
||||
)
|
||||
|
||||
if (NOT (monero_monero_SOURCE_DIR MATCHES "${MONERO_SOURCE_DIR}(/src/cryptonote_protocol)"))
|
||||
if (NOT (monero_monero_SOURCE_DIR MATCHES "${MONERO_SOURCE_DIR}"))
|
||||
message(FATAL_ERROR "Invalid Monero source dir - does not appear to match source used for build directory")
|
||||
endif()
|
||||
|
||||
|
||||
2
external/monero
vendored
2
external/monero
vendored
Submodule external/monero updated: c572e1ad00...fbd7348d82
@@ -1110,6 +1110,7 @@ namespace lws
|
||||
rpc->fee_mask,
|
||||
rpc::safe_uint64(received),
|
||||
std::move(unspent),
|
||||
rpc->fees,
|
||||
std::move(req.creds.key)
|
||||
}
|
||||
);
|
||||
|
||||
@@ -350,7 +350,8 @@ namespace lws
|
||||
WIRE_FIELD_COPY(per_byte_fee),
|
||||
WIRE_FIELD_COPY(fee_mask),
|
||||
WIRE_FIELD_COPY(amount),
|
||||
wire::optional_field("outputs", wire::array(boost::adaptors::transform(self.outputs, expand)))
|
||||
wire::optional_field("outputs", wire::array(boost::adaptors::transform(self.outputs, expand))),
|
||||
WIRE_FIELD(fees)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -210,6 +210,7 @@ namespace rpc
|
||||
std::uint64_t fee_mask;
|
||||
safe_uint64 amount;
|
||||
std::vector<std::pair<db::output, std::vector<crypto::key_image>>> outputs;
|
||||
std::vector<std::uint64_t> fees;
|
||||
crypto::secret_key user_key;
|
||||
};
|
||||
void write_bytes(wire::json_writer&, const get_unspent_outs_response&);
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace
|
||||
return epee::byte_slice{
|
||||
std::string{
|
||||
"{\"jsonrpc\":2.0,\"id\":0,\"result\":{"
|
||||
"\"estimated_base_fee\":10000,\"fee_mask\":1000,\"size_scale\":256,\"hard_fork_version\":16"
|
||||
"\"estimated_base_fee\":10000,\"fee_mask\":1000,\"size_scale\":256,\"hard_fork_version\":16,\"fees\":[40,41]"
|
||||
"}}"
|
||||
}
|
||||
};
|
||||
@@ -184,7 +184,7 @@ LWS_CASE("rest_server")
|
||||
|
||||
message = "{\"address\":\"" + address + "\",\"view_key\":\"" + viewkey + "\",\"amount\":\"0\"}";
|
||||
response = invoke(client, "/get_unspent_outs", message);
|
||||
EXPECT(response == "{\"per_byte_fee\":39,\"fee_mask\":1000,\"amount\":\"0\"}");
|
||||
EXPECT(response == "{\"per_byte_fee\":39,\"fee_mask\":1000,\"amount\":\"0\",\"fees\":[40,41]}");
|
||||
}
|
||||
|
||||
SECTION("One Receive, Zero Spends")
|
||||
@@ -309,7 +309,7 @@ LWS_CASE("rest_server")
|
||||
"\"height\":4000,"
|
||||
"\"rct\":\"" + epee::to_hex::string(epee::as_byte_span(ringct_expanded)) + "\","
|
||||
"\"recipient\":{\"maj_i\":2,\"min_i\":66}}"
|
||||
"]}"
|
||||
"],\"fees\":[40,41]}"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -467,7 +467,7 @@ LWS_CASE("rest_server")
|
||||
"\"spend_key_images\":[\"" + epee::to_hex::string(epee::as_byte_span(image)) + "\"],"
|
||||
"\"rct\":\"" + epee::to_hex::string(epee::as_byte_span(ringct_expanded)) + "\","
|
||||
"\"recipient\":{\"maj_i\":2,\"min_i\":66}}"
|
||||
"]}"
|
||||
"],\"fees\":[40,41]}"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user