Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions src/lightbridge/lightbridge.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,15 @@ export class LightBridgeGraphQLService extends GraphQLService {
sourceChainId: number | string,
destChainId: number | string,
token: string,
amount: number | string,
depositId: number | string
): Promise<LightBridgeDisbursementSuccessEvent | undefined> {
if (!token) {
return undefined
}
const query =
gql(`query Teleportation($wallet: String!, $sourceChainId: BigInt!, $token: String!, $amount: String!, $depositId: String!) {
gql(`query Teleportation($wallet: String!, $sourceChainId: BigInt!, $token: String!, $depositId: String!) {
disbursementSuccesses(
where: { and: [{ to_contains: $wallet }, { sourceChainId: $sourceChainId }, { token_contains: $token }, { amount: $amount }, { depositId: $depositId }] }
where: { and: [{ to_contains: $wallet }, { sourceChainId: $sourceChainId }, { token_contains: $token }, { depositId: $depositId }] }
) {
depositId
to
Expand All @@ -110,7 +109,6 @@ export class LightBridgeGraphQLService extends GraphQLService {
wallet: walletAddress,
sourceChainId: sourceChainId.toString(),
token,
amount: amount.toString(),
depositId: depositId.toString(),
}
const events = retainOldStructure((
Expand All @@ -133,13 +131,12 @@ export class LightBridgeGraphQLService extends GraphQLService {
walletAddress: string,
sourceChainId: number | string,
destChainId: number | string,
amount: number | string,
depositId: number | string
): Promise<LightBridgeDisbursementFailedEvent | undefined> {
const query =
gql(`query Teleportation($wallet: String!, $sourceChainId: BigInt!, $amount: String!, $depositId: String!) {
gql(`query Teleportation($wallet: String!, $sourceChainId: BigInt!, $depositId: String!) {
disbursementFaileds(
where: { and: [{ to_contains: $wallet }, { sourceChainId: $sourceChainId }, { amount: $amount }, { depositId: $depositId }] }
where: { and: [{ to_contains: $wallet }, { sourceChainId: $sourceChainId }, { depositId: $depositId }] }
) {
depositId
to
Expand All @@ -155,7 +152,6 @@ export class LightBridgeGraphQLService extends GraphQLService {
const variables = {
wallet: walletAddress,
sourceChainId: sourceChainId.toString(),
amount: amount.toString(),
depositId: depositId.toString(),
}
const events = retainOldStructure((
Expand Down Expand Up @@ -184,13 +180,12 @@ export class LightBridgeGraphQLService extends GraphQLService {
walletAddress: string,
sourceChainId: number | string,
destChainId: number | string,
amount: number | string,
depositId: number | string
): Promise<LightBridgeDisbursementRetrySuccessEvent | undefined> {
const query =
gql(`query Teleportation($wallet: String!, $sourceChainId: BigInt!, $amount: String!, $depositId: String!) {
gql(`query Teleportation($wallet: String!, $sourceChainId: BigInt!, $depositId: String!) {
disbursementRetrySuccesses(
where: { and: [{ to_contains: $wallet }, { sourceChainId: $sourceChainId }, { amount: $amount }, { depositId: $depositId }] }
where: { and: [{ to_contains: $wallet }, { sourceChainId: $sourceChainId }, { depositId: $depositId }] }
) {
depositId
to
Expand All @@ -206,7 +201,6 @@ export class LightBridgeGraphQLService extends GraphQLService {
const variables = {
wallet: walletAddress,
sourceChainId: sourceChainId.toString(),
amount: amount.toString(),
depositId: depositId.toString(),
}
const events = retainOldStructure((
Expand Down
1 change: 0 additions & 1 deletion tests/integration/light-bridge.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ describe('LightBridge Integration Test', function () {
28882,
11155111,
'0x0000000000000000000000000000000000000000',
"2000000000000000000",
"3");

expect(res.__typename).toEqual("DisbursementSuccess")
Expand Down
Loading