Skip to content

Commit

Permalink
Merge pull request #135 from Airstack-xyz/patch/custody_address_update
Browse files Browse the repository at this point in the history
subgraph changes
  • Loading branch information
garg-prashant authored Jun 17, 2024
2 parents 47f1a37 + 0813f47 commit a9fb850
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
22 changes: 19 additions & 3 deletions airstack-modules/modules/airstack/social/social.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export namespace social {
new Array<string>()
)
airSocialProfile.user = airSocialUser.id
airSocialProfile.lastUpdatedAt = airBlock.id
// airSocialProfile.lastUpdatedAt = airBlock.id
saveAirSocialProfile(airSocialProfile, airBlock)
// removing profile (tokenId) from - from user
const airSocialUserOld = getAirSocialUser(chainId, oldSocialUserId)
Expand Down Expand Up @@ -506,6 +506,21 @@ export namespace social {
}
const airAccountTo = getOrCreateAirAccount(chainId, to, airBlock)
airAccountTo.save()

if (airSocialUser != null && airSocialUser.profiles != null) {
// log.debug("Transfer: saving air social user profiles for {}", [airSocialUser.profiles!.toString()])

for (let i = 0; i < airSocialUser.profiles!.length; i++) {
// log.debug("saving air social user profiles for {}, block number {}", [airSocialUser.profiles!.toString(), block.number.toString()])
const profileId = airSocialUser.profiles![i]
const profile = AirSocialProfile.load(profileId)
if (profile != null) {
// log.debug("Profile not null, saving air social user profiles for {}, block number {}", [profile.id, block.number.toString()])
saveAirSocialProfile(profile, airBlock)
}
}
}

airSocialUser.address = airAccountTo.id
airSocialUser.lastUpdatedAt = airBlock.id
saveAirSocialUser(airSocialUser, airBlock)
Expand Down Expand Up @@ -581,7 +596,7 @@ export namespace social {
airExtras.push(extraEntity.id)
}
airSocialProfile.extras = airExtras
airSocialProfile.lastUpdatedAt = airBlock.id
// airSocialProfile.lastUpdatedAt = airBlock.id
}
saveAirSocialProfile(airSocialProfile, airBlock)
createAirSocialProfileRecoveryAddressChangeTransaction(
Expand Down Expand Up @@ -782,7 +797,7 @@ export namespace social {
}
airSocialProfile.expiryTimestamp = expiryTimestamp
airSocialProfile.renewalCost = renewalCost
airSocialProfile.lastUpdatedAt = airBlock.id
// airSocialProfile.lastUpdatedAt = airBlock.id
saveAirSocialProfile(airSocialProfile, airBlock)
createAirSocialProfileRenewalTransaction(
chainId,
Expand Down Expand Up @@ -1615,6 +1630,7 @@ export function trackSocialProfileHandleTransferTransaction(
AIR_SOCIAL_PROFILE_ENTITY_LAST_UPDATED_INDEX_COUNTER_ID,
airBlock
)
airSocialProfile.lastUpdatedAt = airBlock.id
airSocialProfile.save()
}
function saveAirSocialUser(airSocialUser: AirSocialUser, airBlock: AirBlock): void {
Expand Down
4 changes: 2 additions & 2 deletions airstack-modules/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions farcaster_v2.1/subgraph.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
specVersion: 0.0.5
schema:
file: ./schema.graphql
# graft:
# base: QmaZghWsJESFAB2MPUXeJSAxY7LXfEi3HyWougnDtLTB5A
# block: 120801920
# features:
# - grafting
dataSources:
- kind: ethereum
name: IdRegistry
Expand Down

0 comments on commit a9fb850

Please sign in to comment.