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

ircd:Ⓜ️:event: Minor move utils to event.h index header.

This commit is contained in:
Jason Volk 2019-02-20 10:32:36 -08:00
parent d05f58d352
commit 99058105b3
2 changed files with 34 additions and 35 deletions

View file

@ -13,6 +13,7 @@
namespace ircd::m
{
// event/event.h
struct event;
// General util
@ -29,6 +30,39 @@ namespace ircd::m
bool cached(const id::event &);
bool good(const id::event &);
bool bad(const id::event &);
// Equality tests the event_id only! know this.
bool operator==(const event &a, const event &b);
// Depth comparison; expect unstable sorting.
bool operator<(const event &, const event &);
bool operator>(const event &, const event &);
bool operator<=(const event &, const event &);
bool operator>=(const event &, const event &);
// Topological comparison
bool before(const event &a, const event &b);
id::event make_id(const event &, id::event::buf &buf, const const_buffer &hash);
id::event make_id(const event &, id::event::buf &buf);
json::object hashes(const mutable_buffer &, const event &);
event signatures(const mutable_buffer &, const m::event &);
event essential(event, const mutable_buffer &content);
bool verify_sha256b64(const event &, const string_view &);
bool verify_hash(const event &, const sha256::buf &);
bool verify_hash(const event &);
bool verify(const event &, const ed25519::pk &, const ed25519::sig &sig);
bool verify(const event &, const ed25519::pk &, const string_view &origin, const string_view &pkid);
bool verify(const event &, const string_view &origin, const string_view &pkid); // io/yield
bool verify(const event &, const string_view &origin); // io/yield
bool verify(const event &); // io/yield
sha256::buf hash(const event &);
ed25519::sig sign(const event &, const ed25519::sk &);
ed25519::sig sign(const event &);
}
#include "event/event.h"

View file

@ -11,41 +11,6 @@
#pragma once
#define HAVE_IRCD_M_EVENT_EVENT_H
namespace ircd::m
{
// Equality tests the event_id only! know this.
bool operator==(const event &a, const event &b);
// Depth comparison; expect unstable sorting.
bool operator<(const event &, const event &);
bool operator>(const event &, const event &);
bool operator<=(const event &, const event &);
bool operator>=(const event &, const event &);
bool before(const event &a, const event &b); // A directly referenced by B
id::event make_id(const event &, id::event::buf &buf, const const_buffer &hash);
id::event make_id(const event &, id::event::buf &buf);
json::object hashes(const mutable_buffer &, const event &);
event signatures(const mutable_buffer &, const m::event &);
event essential(event, const mutable_buffer &content);
bool verify_sha256b64(const event &, const string_view &);
bool verify_hash(const event &, const sha256::buf &);
bool verify_hash(const event &);
bool verify(const event &, const ed25519::pk &, const ed25519::sig &sig);
bool verify(const event &, const ed25519::pk &, const string_view &origin, const string_view &pkid);
bool verify(const event &, const string_view &origin, const string_view &pkid); // io/yield
bool verify(const event &, const string_view &origin); // io/yield
bool verify(const event &); // io/yield
sha256::buf hash(const event &);
ed25519::sig sign(const event &, const ed25519::sk &);
ed25519::sig sign(const event &);
}
/// The Main Event
///
/// This json::tuple provides at least all of the legal members of the matrix