Skip to content

Commit

Permalink
bugfix:add relayer field
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoch05 committed Jan 3, 2024
1 parent 4f4176c commit de2fb2b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
18 changes: 9 additions & 9 deletions apollo/src/lnbridgev20/lnbridgev20.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class Lnbridgev20Service implements OnModuleInit {
) {}

protected genID(bridgeType: string, transferId: string): string {
return `lnbridgev2-${bridgeType}-${transferId}`;
return `lnv2-${bridgeType}-${transferId}`;
}

async onModuleInit() {
Expand Down Expand Up @@ -127,7 +127,7 @@ export class Lnbridgev20Service implements OnModuleInit {
}

private bridgeName(indexInfo: BridgeIndexInfo): string {
return 'lnbridgev2-' + indexInfo.bridgeType;
return 'lnv2-' + indexInfo.bridgeType;
}

private formatSortedMessageNonce(nonce: number): string {
Expand Down Expand Up @@ -344,15 +344,15 @@ export class Lnbridgev20Service implements OnModuleInit {
}
if (records && records.length > 0) {
this.logger.log(
`lnbridgev2 new records, from ${transfer.chainId}, latest nonce ${latestNonce}, added ${
`lnv2 new records, from ${transfer.chainId}, latest nonce ${latestNonce}, added ${
records.length - ignored
}, ignored ${ignored}`
);
}
this.fetchCache[index].latestNonce = latestNonce;
}
} catch (error) {
this.logger.warn(`lnbridgev2 fetch record failed, from ${transfer.chainId}, ${error}`);
this.logger.warn(`lnv2 fetch record failed, from ${transfer.chainId}, ${error}`);
}
}

Expand Down Expand Up @@ -440,13 +440,13 @@ export class Lnbridgev20Service implements OnModuleInit {
});

this.logger.log(
`[${record.fromChain}->${record.toChain}]lnv2bridge new status id: ${record.id} relayed responseTxHash: ${relayRecord.transactionHash}`
`[${record.fromChain}->${record.toChain}]lnv2 new status id: ${record.id} relayed responseTxHash: ${relayRecord.transactionHash}`
);
}
}
}
} catch (error) {
this.logger.warn(`fetch lnv2bridge status failed, error ${error}`);
this.logger.warn(`fetch lnv2 status failed, error ${error}`);
}
}

Expand Down Expand Up @@ -616,7 +616,7 @@ export class Lnbridgev20Service implements OnModuleInit {
);
}
} catch (error) {
this.logger.warn(`fetch lnv2bridge relay records failed, error ${error}`);
this.logger.warn(`fetch lnv2 relay records failed, error ${error}`);
}
}

Expand Down Expand Up @@ -721,7 +721,7 @@ export class Lnbridgev20Service implements OnModuleInit {
);
}
} catch (error) {
this.logger.warn(`fetch lnv2bridge relay records failed, error ${error}`);
this.logger.warn(`fetch lnv2 relay records failed, error ${error}`);
}
}

Expand Down Expand Up @@ -837,7 +837,7 @@ export class Lnbridgev20Service implements OnModuleInit {
);
}
} catch (error) {
this.logger.warn(`fetch lnv2bridge relay records failed, error ${error}`);
this.logger.warn(`fetch lnv2 relay records failed, error ${error}`);
}
}
}
1 change: 1 addition & 0 deletions apollo/src/lnv3/lnv3.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export class Lnv3Service implements OnModuleInit {
const endTime = 0;
await this.aggregationService.createHistoryRecord({
id: this.genID(transfer, transfer.chainId.toString(), record.remoteChainId, record.id),
relayer: record.provider,
fromChain: transfer.chain,
toChain: toChain.chain,
bridge: `lnv3`,
Expand Down

0 comments on commit de2fb2b

Please sign in to comment.