Preserve channel identity in member adapter fixtures
This commit is contained in:
1 parent
2bcba58131
commit
5c772aeecf
3 files changed
+7
No files matched your search
@@ -427,6 +427,8 @@ int group_avatar_init(struct UTUN_INSTANCE* inst) {
|
||||
DEBUG_INFO(DEBUG_CATEGORY_CHAT, "group avatar: initialized max_bytes=%d block_bytes=%d", GROUP_AVATAR_MAX, GROUP_AVATAR_BLOCK); return 0;
|
||||
}
|
||||
|
||||
int group_avatar_schema_init(sqlite3* db) { return ga_schema(db); }
|
||||
|
||||
void group_avatar_cancel_group(struct UTUN_INSTANCE* inst, uint64_t group) {
|
||||
struct group_avatar* ctx = ga_context(inst); if (!ctx) return;
|
||||
struct ga_peer** link = &ctx->peers;
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
struct UTUN_INSTANCE;
|
||||
struct sqlite3;
|
||||
int group_avatar_schema_init(struct sqlite3* db);
|
||||
#define GROUP_AVATAR_MAX 16384
|
||||
#define GROUP_AVATAR_BLOCK 4096
|
||||
struct group_avatar_record {
|
||||
|
||||
@@ -29,6 +29,9 @@ static void test_owner_sizes(struct UASYNC* ua) {
|
||||
struct UTUN_INSTANCE source, target; setup(&source, ua); setup(&target, ua);
|
||||
uint8_t x[32] = {9}, priv[32] = {7}, pub[32], owner_priv[32] = {8}, owner_pub[32], zero[64] = {0};
|
||||
public_key(priv, pub); public_key(owner_priv, owner_pub);
|
||||
/* setup создаёт пустой канал с тестовым ключом; новую идентичность создаём как новый канал. */
|
||||
assert(topo_node_sqlite_channel_delete(source.topo_sqlite_db, "1001") == 0);
|
||||
assert(topo_node_sqlite_channel_delete(target.topo_sqlite_db, "1001") == 0);
|
||||
assert(topo_node_sqlite_channel_put(source.topo_sqlite_db, "1001", "test", 1, x, NULL, owner_pub, owner_priv, zero) == 0);
|
||||
assert(topo_node_sqlite_channel_put(target.topo_sqlite_db, "1001", "test", 1, x, NULL, owner_pub, NULL, zero) == 0);
|
||||
uint64_t nid = sc_derive_node_id_from_pubkey(x);
|
||||
|
||||
Reference in new issue
Block a user