cleanup: Remove security from StoredFillEvent
It created an unnecessary dependency
This commit is contained in:
1 parent
cc55fe1acf
commit
85bd2da414
2 files changed
+6
-8
No files matched your search
@@ -191,7 +191,7 @@ void FillStore::init() {
|
||||
for (auto &f : aggregated_fills) {
|
||||
auto sec = me->oracle.get_security(SecurityKey(f.security_key()));
|
||||
if (sec) {
|
||||
stored_batch.emplace_back(f, *sec);
|
||||
stored_batch.emplace_back(f);
|
||||
} else {
|
||||
LOG(persist, Error,
|
||||
"Stored fill {} contains unresolved security {}. ",
|
||||
@@ -223,7 +223,7 @@ void FillStore::init() {
|
||||
if (!config::get<config::toggles::FilterExpiredFills>()
|
||||
.enabled() ||
|
||||
!securities::is_expired(*sec)) {
|
||||
stored_batch.emplace_back(fill, *sec);
|
||||
stored_batch.emplace_back(fill);
|
||||
}
|
||||
} else
|
||||
LOG(persist, Error,
|
||||
@@ -342,7 +342,7 @@ void FillStore::on_execution_report(
|
||||
auto fv = utils::pb::to_string(fill);
|
||||
me->store->insert(fills_ns, fk, fv);
|
||||
LOG(OrderMan, Info, "Publishing fill. {}", fv);
|
||||
publish(me->fill_stream, fill, *er.security);
|
||||
publish(me->fill_stream, fill);
|
||||
} else
|
||||
LOG(OrderMan, Info,
|
||||
"Discarding known execution report for fill {}", fk);
|
||||
@@ -366,7 +366,7 @@ void FillStore::on_order_definition_update(
|
||||
f.set_internal_account_id(ev.def->account_id());
|
||||
auto fv = utils::pb::to_string(f);
|
||||
me->store->update(fills_ns, f.fill_key(), fv);
|
||||
publish(me->fill_stream, f, *unresolved_fills.security);
|
||||
publish(me->fill_stream, f);
|
||||
}
|
||||
unresolved_fills.fills.clear();
|
||||
// end fill resolution
|
||||
@@ -400,7 +400,7 @@ void FillStore::on_manual_bust(
|
||||
bts::api::orderman::Fill::FILL_STATUS_BUSTED);
|
||||
auto fv = utils::pb::to_string(fill);
|
||||
me->store->update(fills_ns, fill.fill_key(), fv);
|
||||
publish(me->fill_stream, fill, *sec);
|
||||
publish(me->fill_stream, fill);
|
||||
LOG(OrderMan, Info, "Busting fill: {}", fv);
|
||||
} else {
|
||||
LOG(persist, Error,
|
||||
|
||||
@@ -12,12 +12,10 @@ class StoredFillEvent : public mercury::Event<StoredFillEvent> {
|
||||
public:
|
||||
using SynopsisPolicy = mercury::MergeByKey<StoredFillEvent>;
|
||||
|
||||
StoredFillEvent(api::orderman::Fill &fill, api::Security const &security)
|
||||
: fill(fill), security(&security) {}
|
||||
StoredFillEvent(api::orderman::Fill &fill) : fill(fill) {}
|
||||
|
||||
std::string const &key() const { return fill.fill_key(); }
|
||||
api::orderman::Fill fill;
|
||||
api::Security const *security;
|
||||
};
|
||||
|
||||
} // namespace orderman
|
||||
|
||||
Reference in new issue
Block a user