Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Up to one deposit per tx supported #58

Open
michprev opened this issue May 9, 2023 · 0 comments
Open

Up to one deposit per tx supported #58

michprev opened this issue May 9, 2023 · 0 comments

Comments

@michprev
Copy link

michprev commented May 9, 2023

This is the equivalent of https://github.com/Glitter-Finance/glitter-bridge-token-node/issues/71.

Up to one deposit per transaction is not something that should be relied on. Because of this implementation, all but one deposit are ignored and not even stored in the backend database.

public static async parseLogs(receipt: TransactionReceipt): Promise<TokenBridgeV2EventGroup | null> {
const parsedLogs = EvmBridgeV2EventsParser.parseLogs(receipt.logs);
const returnValue:TokenBridgeV2EventGroup = { };
const deposit = EvmBridgeV2EventsParser.parseDeposit(parsedLogs);
const release = EvmBridgeV2EventsParser.parseRelease(parsedLogs);
const refund = EvmBridgeV2EventsParser.parseRefund(parsedLogs);
const transfer = EvmBridgeV2EventsParser.parseTransfer(parsedLogs);
if (deposit) { returnValue.deposit = deposit; }
if (release) { returnValue.release = release; }
if (refund) { returnValue.refund = refund; }
if (transfer) { returnValue.transfer = transfer; }
return returnValue;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant