Skip to content

Commit

Permalink
chore: async/await fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
frazarshad committed May 6, 2024
1 parent c35cc07 commit 6888367
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ type IBCTransfer @entity {
channel: IBCChannel!
srcAccount: Account!
destAccount: Account!
denomination: String!
denom: String!
amount: String!
transferType: TransferType!
}
10 changes: 5 additions & 5 deletions src/mappings/mappingHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async function saveIbcChannel(channelName: string) {
const generatedEscrowAddress = getEscrowAddress(TRANSFER_PORT_VALUE, channelName);

const channelRecord = new IBCChannel(channelName, channelName, generatedEscrowAddress);
channelRecord.save();
await channelRecord.save();
}

export async function handleIbcSendPacketEvent(cosmosEvent: CosmosEvent): Promise<void> {
Expand Down Expand Up @@ -80,7 +80,7 @@ export async function handleIbcSendPacketEvent(cosmosEvent: CosmosEvent): Promis
const { amount, denom, receiver, sender } = JSON.parse(packetDataAttr.value);
const sourceChannel = packetSrcChannelAttr.value;

saveIbcChannel(sourceChannel);
await saveIbcChannel(sourceChannel);

const transferRecord = new IBCTransfer(
tx.hash,
Expand All @@ -93,7 +93,7 @@ export async function handleIbcSendPacketEvent(cosmosEvent: CosmosEvent): Promis
amount,
TransferType.SEND,
);
transferRecord.save();
await transferRecord.save();
}

export async function handleIbcReceivePacketEvent(cosmosEvent: CosmosEvent): Promise<void> {
Expand Down Expand Up @@ -123,7 +123,7 @@ export async function handleIbcReceivePacketEvent(cosmosEvent: CosmosEvent): Pro
const { amount, denom, receiver, sender } = JSON.parse(packetDataAttr.value);
const destinationChannel = packetDstChannelAttr.value;

saveIbcChannel(destinationChannel);
await saveIbcChannel(destinationChannel);

const transferRecord = new IBCTransfer(
tx.hash,
Expand All @@ -136,7 +136,7 @@ export async function handleIbcReceivePacketEvent(cosmosEvent: CosmosEvent): Pro
amount,
TransferType.RECEIVE,
);
transferRecord.save();
await transferRecord.save();
}

export async function handleStateChangeEvent(cosmosEvent: CosmosEvent): Promise<void> {
Expand Down

0 comments on commit 6888367

Please sign in to comment.