Skip to content

Commit

Permalink
chore: add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
cinnabarhorse committed Nov 30, 2024
1 parent d30d911 commit 730ce48
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/deploy-alchemy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ jobs:
AAVEGOTCHI_DIAMOND=$(node -e "console.log(require('./config/$NETWORK.json').address)")
echo "AAVEGOTCHI_DIAMOND=$AAVEGOTCHI_DIAMOND" >> $GITHUB_OUTPUT
# - name: Generate Constants
# run: |
# NETWORK=${{ steps.extract-network.outputs.NETWORK }}
# npx ts-node scripts/generate-constants.ts $NETWORK

- name: Replace environment variables
run: |
sed -i "s/process.env.AAVEGOTCHI_DIAMOND/\"${{ steps.export-vars.outputs.AAVEGOTCHI_DIAMOND }}\"/g" src/helper.ts
Expand Down
3 changes: 2 additions & 1 deletion config/matic.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"address": "0x86935F11C86623deC8a25696E1C19a8659CbF95d",
"startBlock": 11500000,
"network": "matic"
"network": "matic",
"blockSideviewsActivated": 39130900
}
7 changes: 6 additions & 1 deletion src/mapping.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Address, BigInt, ethereum } from "@graphprotocol/graph-ts";
import { Address, BigInt, ethereum, log } from "@graphprotocol/graph-ts";
import {
ClaimAavegotchi,
EquipWearables,
Expand Down Expand Up @@ -122,11 +122,16 @@ export function handleBlock(block: ethereum.Block): void {

export function handleTransfer(event: Transfer): void {
if (event.params._from == Address.fromString(AAVEGOTCHI_BRIDGE_VAULT_MATIC)) {
log.info("Transfer from bridge vault for gotchi {}", [
event.params._tokenId.toString(),
]);

// - if from is bridge vault, update svg because the equipped wearables may have changed
let gotchi = event.block.number.ge(BLOCK_SIDEVIEWS_ACTIVATED)
? updateSideViews(event.params._tokenId)
: updateSvg(event.params._tokenId);
if (gotchi != null) {
log.info("saving gotchi {}", [event.params._tokenId.toString()]);
gotchi.save();
}
}
Expand Down

0 comments on commit 730ce48

Please sign in to comment.