forked from zeropoolnetwork/zeropool-relayer
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Leonid Tyurin
authored
Oct 29, 2022
1 parent
764d28f
commit 8ee76d0
Showing
27 changed files
with
495 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,4 @@ prover.js | |
# Log file | ||
zp.log | ||
yarn-error.log | ||
zp-relayer/state/ | ||
zp-relayer/POOL_STATE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
rm -rf ./state | ||
rm -rf ./POOL_STATE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,37 @@ | ||
import { Queue, QueueScheduler } from 'bullmq' | ||
import { redis } from '@/services/redisClient' | ||
import { SENT_TX_QUEUE_NAME } from '@/utils/constants' | ||
import { TxPayload } from './poolTxQueue' | ||
import type { TransactionConfig } from 'web3-core' | ||
import { GasPriceValue } from '@/services/gas-price' | ||
import { TxData, TxType } from 'zp-memo-parser' | ||
|
||
export interface SentTxPayload { | ||
payload: TxPayload | ||
txType: TxType | ||
root: string | ||
outCommit: string | ||
commitIndex: number | ||
txHash: string | ||
txData: string | ||
prefixedMemo: string | ||
txConfig: TransactionConfig | ||
nullifier: string | ||
gasPriceOptions: GasPriceValue | ||
txData: TxData | ||
} | ||
|
||
export enum SentTxState { | ||
MINED = 'MINED', | ||
REVERT = 'REVERT', | ||
RESEND = 'RESEND', | ||
FAILED = 'FAILED', | ||
} | ||
|
||
export type SentTxResult = [SentTxState, string] | ||
|
||
// Required for delayed jobs processing | ||
const sentTxQueueScheduler = new QueueScheduler(SENT_TX_QUEUE_NAME, { | ||
connection: redis, | ||
}) | ||
|
||
export const sentTxQueue = new Queue<SentTxPayload, string>(SENT_TX_QUEUE_NAME, { | ||
export const sentTxQueue = new Queue<SentTxPayload, SentTxResult>(SENT_TX_QUEUE_NAME, { | ||
connection: redis, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.