0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-10-02 21:59:02 +02:00

ircd:Ⓜ️:vm: Fix return values for commit() suite.

This commit is contained in:
Jason Volk 2018-03-16 13:22:00 -07:00
parent 7180eae4af
commit 969bc127e8
2 changed files with 8 additions and 6 deletions

View file

@ -30,7 +30,7 @@ namespace ircd::m::vm
extern ctx::shared_view<accepted> accept; extern ctx::shared_view<accepted> accept;
extern const opts default_opts; extern const opts default_opts;
event::id::buf commit(const m::event &, const opts & = default_opts); fault commit(const m::event &, const opts & = default_opts);
event::id::buf commit(json::iov &event, const json::iov &content, const opts & = default_opts); event::id::buf commit(json::iov &event, const json::iov &content, const opts & = default_opts);
} }

View file

@ -122,7 +122,8 @@ ircd::m::vm::commit(json::iov &event,
event, { "content", content }, event, { "content", content },
}; };
return commit(event, opts); commit(event, opts);
return eid_buf;
} }
namespace ircd::m::vm namespace ircd::m::vm
@ -154,7 +155,7 @@ ircd::m::vm::commit_hook
/// _/|/|/|/|\|\|\|\_ /// _/|/|/|/|\|\|\|\_
/// out /// out
/// ///
ircd::m::event::id::buf ircd::m::vm::fault
ircd::m::vm::commit(const event &event, ircd::m::vm::commit(const event &event,
const opts &opts) const opts &opts)
{ {
@ -176,9 +177,10 @@ ircd::m::vm::commit(const event &event,
//TODO: X //TODO: X
opts_.non_conform |= event::conforms::MISSING_PREV_STATE; opts_.non_conform |= event::conforms::MISSING_PREV_STATE;
eval vm::eval eval{opts_};
const fault ret
{ {
event, opts_ eval(event)
}; };
if(opts.infolog_postcommit) if(opts.infolog_postcommit)
@ -186,7 +188,7 @@ ircd::m::vm::commit(const event &event,
vm::current_sequence, vm::current_sequence,
pretty_oneline(event, false)); pretty_oneline(event, false));
return unquote(at<"event_id"_>(event)); return ret;
} }
// //