From a18344f4a1c4b99bf84a75cb9c17d1024a0400f8 Mon Sep 17 00:00:00 2001 From: chaojun Date: Wed, 4 Sep 2024 18:01:43 +0800 Subject: [PATCH] Mock test account as society member, #1034 --- .../src/services/node.service/getSocietyMember.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/backend/packages/backend/src/services/node.service/getSocietyMember.js b/backend/packages/backend/src/services/node.service/getSocietyMember.js index 5eb3a00d..1c629101 100644 --- a/backend/packages/backend/src/services/node.service/getSocietyMember.js +++ b/backend/packages/backend/src/services/node.service/getSocietyMember.js @@ -1,7 +1,18 @@ const { NODE_API_ENDPOINT } = require("../../env"); +const { isTestAccount } = require("../../utils"); const { fetchApi } = require("../../utils/fech.api"); async function getSocietyMember(network, address, height) { + if (isTestAccount(address)) { + return { + data: { + rank: 0, + strikes: 10, + vouching: null, + index: 0, + }, + }; + } let url = `${NODE_API_ENDPOINT}/${network}/society/members/${address}`; if (height) { url = `${NODE_API_ENDPOINT}/${network}/society/members/${address}/height/${height}`;