This commit is contained in:
0xtsukino
2022-10-11 15:36:15 -05:00
parent 412f6107b8
commit 3049e46cd1
5 changed files with 8 additions and 6 deletions

View File

@@ -260,6 +260,8 @@ export default class DBService extends GenericService {
// await this.app?.updateLastArbitrumBlock(9317700);
}
await this.app?.updateLastGroup42BlockScanned(7660170);
// await this.app?.updateLastArbitrumBlock(2193241);
// await this.app?.updateLastInterrepBlock(27202837);
}

View File

@@ -544,9 +544,9 @@ export default class HttpService extends GenericService {
handleGetProofs = async (req: Request, res: Response) => {
const { idCommitment } = req.params;
const { group = '' } = req.query;
const { group = '', proofType = '' } = req.query;
const proof = await this.call('merkle', 'findProof', idCommitment, group);
const proof = await this.call('merkle', 'findProof', idCommitment, group, proofType);
res.send(
makeResponse({

View File

@@ -73,7 +73,7 @@ export default class MerkleService extends GenericService {
return null;
};
findProof = async (idCommitment: string, group?: string) => {
findProof = async (idCommitment: string, group?: string, proofType?: string) => {
if (!group) {
const row = await this.semaphore.findOneByCommitment(idCommitment);
if (!row) throw new Error(`${idCommitment} is not in any groups`);
@@ -87,7 +87,7 @@ export default class MerkleService extends GenericService {
await this.call('interrep', 'syncOne', group).catch(() => null);
}
const tree = await this.makeTree(group, service === 'taz' ? 'semaphore' : 'rln');
const tree = await this.makeTree(group, proofType || service === 'taz' ? 'semaphore' : 'rln');
const proof = await tree.createProof(tree.indexOf(BigInt('0x' + idCommitment)));
if (!proof) {

View File

@@ -46,7 +46,7 @@ export default class Group42 extends GenericService {
const idCommitmentHex = BigInt(identityCommitment).toString(16);
const exist = await this.semaphore?.findOne(idCommitmentHex, 'semaphore_taz_members');
if (!exist && groupId === '42') {
if (!exist && (groupId === '10806' || groupId === '42' || groupId === '10807')) {
await this.semaphore?.addID(
idCommitmentHex,
'semaphore_taz_members',

View File

@@ -19,7 +19,7 @@ const logger = winston.createLogger({
if (process.env.NODE_ENV !== 'production') {
logger.add(
new winston.transports.Console({
level: 'info',
level: 'error',
format: winston.format.simple(),
})
);