Skip to content

Commit

Permalink
CosmosToOsmosisBridge -> BridgeEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
bgodlin committed Nov 27, 2023
1 parent 63ecf4a commit 0183fbe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Multi-Chain/osmosis-cosmos-bridge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ For this project, you can try to query with the following GraphQL code to get a

```graphql
query {
cosmosToOsmosisBridges {
BridgeEvents {
nodes {
id
senderId
Expand Down
2 changes: 1 addition & 1 deletion Multi-Chain/osmosis-cosmos-bridge/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Add the `@index` or `@index(unique: true)` annotation after any non-key field
# https://academy.subquery.network/build/graphql.html#indexing-by-non-primary-key-field

type CosmosToOsmosisBridge @entity {
type BridgeEvent @entity {
id: ID!
sender: User!
receiver: User!
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CosmosEvent } from "@subql/types-cosmos";
import { User, CosmosToOsmosisBridge } from "../types";
import { User, BridgeEvent } from "../types";

interface EssentialValues {
sender?: string;
Expand Down Expand Up @@ -50,9 +50,9 @@ async function populateValuesFromSource(
sequence: string,
event: CosmosEvent
) {
let bridgeTransactionRecord = await CosmosToOsmosisBridge.get(sequence);
let bridgeTransactionRecord = await BridgeEvent.get(sequence);
if (!bridgeTransactionRecord) {
bridgeTransactionRecord = CosmosToOsmosisBridge.create({
bridgeTransactionRecord = BridgeEvent.create({
id: sequence,
senderId: (await checkGetUser(sender)).id,
receiverId: (await checkGetUser(receiver)).id,
Expand All @@ -74,9 +74,9 @@ async function populateValuesFromDestination(
sequence: string,
event: CosmosEvent
) {
let bridgeTransactionRecord = await CosmosToOsmosisBridge.get(sequence);
let bridgeTransactionRecord = await BridgeEvent.get(sequence);
if (!bridgeTransactionRecord) {
bridgeTransactionRecord = CosmosToOsmosisBridge.create({
bridgeTransactionRecord = BridgeEvent.create({
id: sequence,
senderId: (await checkGetUser(sender)).id,
receiverId: (await checkGetUser(receiver)).id,
Expand Down

0 comments on commit 0183fbe

Please sign in to comment.