From 76668d76b35811d71531d24458a3857b88e11906 Mon Sep 17 00:00:00 2001 From: Wan Qi Chen <495709+wa0x6e@users.noreply.github.com> Date: Tue, 7 May 2024 00:36:46 +0400 Subject: [PATCH 1/2] fix: enable alias voting and propose globally --- src/ingestor.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/ingestor.ts b/src/ingestor.ts index 2f6a0b8f..beca5876 100644 --- a/src/ingestor.ts +++ b/src/ingestor.ts @@ -58,32 +58,30 @@ export default async function ingestor(req) { if (!Object.keys(hashTypes).includes(hash)) return Promise.reject('wrong types'); type = hashTypes[hash]; - network = '1'; - let aliased = false; if (!['settings', 'alias', 'profile'].includes(type)) { if (!message.space) return Promise.reject('unknown space'); const space = await getSpace(message.space); if (!space) return Promise.reject('unknown space'); network = space.network; - if (space.voting?.aliased) aliased = true; } // Check if signing address is an alias - const aliasTypes = ['follow', 'unfollow', 'subscribe', 'unsubscribe', 'profile']; - const aliasOptionTypes = [ + const aliasTypes = [ + 'follow', + 'unfollow', + 'subscribe', + 'unsubscribe', + 'profile', 'vote', 'vote-array', 'vote-string', 'proposal', + 'update-proposal', 'delete-proposal', 'statement' ]; if (body.address !== message.from) { - if (!aliasTypes.includes(type) && !aliasOptionTypes.includes(type)) - return Promise.reject('wrong from'); - - if (aliasOptionTypes.includes(type) && !aliased) return Promise.reject('alias not enabled'); - + if (!aliasTypes.includes(type)) return Promise.reject('wrong from'); if (!(await isValidAlias(message.from, body.address))) return Promise.reject('wrong alias'); } From 4f152abe5337aa8edda9b7ae4f861f692e17e9a3 Mon Sep 17 00:00:00 2001 From: Wan Qi Chen <495709+wa0x6e@users.noreply.github.com> Date: Wed, 8 May 2024 18:31:55 +0400 Subject: [PATCH 2/2] fix: remove unused aliasable actions --- src/ingestor.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ingestor.ts b/src/ingestor.ts index beca5876..50c3e1bc 100644 --- a/src/ingestor.ts +++ b/src/ingestor.ts @@ -76,9 +76,7 @@ export default async function ingestor(req) { 'vote-array', 'vote-string', 'proposal', - 'update-proposal', - 'delete-proposal', - 'statement' + 'update-proposal' ]; if (body.address !== message.from) { if (!aliasTypes.includes(type)) return Promise.reject('wrong from');