Skip to content

Commit

Permalink
Merge pull request #64 from sotatek-dev/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Sotatek-TanHoang authored Sep 24, 2024
2 parents b2e746d + 97c7ad3 commit ebf54ab
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/database/repositories/event-log.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,7 @@ export class EventLogRepository extends BaseRepository<EventLog> {

public async getHistories(options) {
const queryBuilder = this.createQb();
queryBuilder
.andWhere(`${this.alias}.status IN (:...status)`, { status: [EEventStatus.PROCESSING, EEventStatus.WAITING] })
.orderBy(`${this.alias}.id`, EDirection.DESC);
queryBuilder.orderBy(`${this.alias}.id`, EDirection.DESC);
if (options.address) {
queryBuilder.andWhere(`${this.alias}.sender_address = :address`, { address: options.address });
}
Expand Down
1 change: 0 additions & 1 deletion src/modules/crawler/crawler.console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ export class CrawlerConsole {
async handleValidateMinaLockTx() {
try {
while (true) {
this.logger.info('Start generating mina signatures.');
this.senderMinaBridge.handleValidateUnlockTxMina();
await sleep(1);
}
Expand Down
5 changes: 4 additions & 1 deletion src/modules/crawler/sender.minabridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class SenderMinaBridge {
this.tokenPriceRepository.getRateETHToMina(),
]);
if (!dataLock) {
this.logger.warn('No pending lock transaction!');
// this.logger.warn('No pending lock transaction!');
return;
}
await this.eventLogRepository.updateLockEvenLog(dataLock.id, EEventStatus.PROCESSING);
Expand Down Expand Up @@ -245,19 +245,22 @@ export class SenderMinaBridge {
if (!dataLock) {
return;
}
this.logger.info('Start generating mina signatures.');

const { tokenReceivedAddress, tokenFromAddress, receiveAddress, amountFrom } = dataLock;

const tokenPair = await this.tokenPairRepository.getTokenPair(tokenFromAddress, tokenReceivedAddress);

if (!tokenPair) {
this.logger.warn('Unknown token pair', tokenFromAddress, tokenReceivedAddress);
await this.eventLogRepository.updateStatusAndRetryEvenLog({
id: dataLock.id,
retry: dataLock.retry,
status: EEventStatus.NOTOKENPAIR,
});
return;
}

// check if this signature has been tried before.
let multiSignature = await this.multiSignatureRepository.findOneBy({
txId: dataLock.id,
Expand Down

0 comments on commit ebf54ab

Please sign in to comment.